Package com.twilio.twiml.messaging
Class Message.Builder
- java.lang.Object
-
- com.twilio.twiml.TwiML.Builder<Message.Builder>
-
- com.twilio.twiml.messaging.Message.Builder
-
- Enclosing class:
- Message
public static class Message.Builder extends TwiML.Builder<Message.Builder>
Create a new<Message>element
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Message.Builderaction(String action)A URL specifying where Twilio should send status callbacks for the created outbound message.Message.Builderaction(URI action)A URL specifying where Twilio should send status callbacks for the created outbound message.Message.Builderbody(Body body)Add a child<Body>elementMessagebuild()Create and return resulting<Message>elementMessage.Builderfrom(String from)Phone Number to send Message fromstatic Message.BuilderfromXml(String xml)Create and return a<Message.Builder>from an XML stringMessage.Buildermedia(Media media)Add a child<Media>elementMessage.Buildermethod(HttpMethod method)Action URL MethodMessage.BuilderstatusCallback(String statusCallback)Status callback URL.Message.BuilderstatusCallback(URI statusCallback)Status callback URL.Message.Builderto(String to)Phone Number to send Message to-
Methods inherited from class com.twilio.twiml.TwiML.Builder
addChild, addText, option
-
-
-
-
Constructor Detail
-
Builder
public Builder(String body)
Create a<Message>with body
-
Builder
public Builder()
Create a<Message>with child elements
-
-
Method Detail
-
fromXml
public static Message.Builder fromXml(String xml) throws TwiMLException
Create and return a<Message.Builder>from an XML string- Throws:
TwiMLException
-
to
public Message.Builder to(String to)
Phone Number to send Message to
-
from
public Message.Builder from(String from)
Phone Number to send Message from
-
action
public Message.Builder action(URI action)
A URL specifying where Twilio should send status callbacks for the created outbound message.
-
action
public Message.Builder action(String action)
A URL specifying where Twilio should send status callbacks for the created outbound message.
-
method
public Message.Builder method(HttpMethod method)
Action URL Method
-
statusCallback
public Message.Builder statusCallback(URI statusCallback)
Status callback URL. Deprecated in favor of action.
-
statusCallback
public Message.Builder statusCallback(String statusCallback)
Status callback URL. Deprecated in favor of action.
-
body
public Message.Builder body(Body body)
Add a child<Body>element
-
media
public Message.Builder media(Media media)
Add a child<Media>element
-
build
public Message build()
Create and return resulting<Message>element
-
-