Class Message
- java.lang.Object
-
- com.twilio.base.Resource
-
- com.twilio.rest.api.v2010.account.Message
-
- All Implemented Interfaces:
Serializable
public class Message extends Resource
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Message.AddressRetention
static class
Message.ContentRetention
static class
Message.Direction
static class
Message.Status
static class
Message.TrafficType
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MessageCreator
creator(PhoneNumber to, PhoneNumber from, String body)
Create a MessageCreator to execute create.static MessageCreator
creator(PhoneNumber to, PhoneNumber from, List<URI> mediaUrl)
Create a MessageCreator to execute create.static MessageCreator
creator(PhoneNumber to, String messagingServiceSid, String body)
Create a MessageCreator to execute create.static MessageCreator
creator(PhoneNumber to, String messagingServiceSid, List<URI> mediaUrl)
Create a MessageCreator to execute create.static MessageCreator
creator(String pathAccountSid, PhoneNumber to, PhoneNumber from, String body)
Create a MessageCreator to execute create.static MessageCreator
creator(String pathAccountSid, PhoneNumber to, PhoneNumber from, List<URI> mediaUrl)
Create a MessageCreator to execute create.static MessageCreator
creator(String pathAccountSid, PhoneNumber to, String messagingServiceSid, String body)
Create a MessageCreator to execute create.static MessageCreator
creator(String pathAccountSid, PhoneNumber to, String messagingServiceSid, List<URI> mediaUrl)
Create a MessageCreator to execute create.static MessageDeleter
deleter(String pathSid)
Create a MessageDeleter to execute delete.static MessageDeleter
deleter(String pathAccountSid, String pathSid)
Create a MessageDeleter to execute delete.boolean
equals(Object o)
static MessageFetcher
fetcher(String pathSid)
Create a MessageFetcher to execute fetch.static MessageFetcher
fetcher(String pathAccountSid, String pathSid)
Create a MessageFetcher to execute fetch.static Message
fromJson(InputStream json, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
Converts a JSON InputStream into a Message object using the provided ObjectMapper.static Message
fromJson(String json, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
Converts a JSON String into a Message object using the provided ObjectMapper.String
getAccountSid()
Returns The The SID of the Account that created the resource.String
getApiVersion()
Returns The The API version used to process the message.String
getBody()
Returns The The message text.org.joda.time.DateTime
getDateCreated()
Returns The The RFC 2822 date and time in GMT that the resource was created.org.joda.time.DateTime
getDateSent()
Returns The The RFC 2822 date and time in GMT when the message was sent.org.joda.time.DateTime
getDateUpdated()
Returns The The RFC 2822 date and time in GMT that the resource was last updated.Message.Direction
getDirection()
Returns The The direction of the message.Integer
getErrorCode()
Returns The The error code associated with the message.String
getErrorMessage()
Returns The The description of the error_code.PhoneNumber
getFrom()
Returns The The phone number that initiated the message.String
getMessagingServiceSid()
Returns The The SID of the Messaging Service used with the message..String
getNumMedia()
Returns The The number of media files associated with the message.String
getNumSegments()
Returns The The number of messages used to deliver the message body.String
getPrice()
Returns The The amount billed for the message.Currency
getPriceUnit()
Returns The The currency in which price is measured.String
getSid()
Returns The The unique string that identifies the resource.Message.Status
getStatus()
Returns The The status of the message.Map<String,String>
getSubresourceUris()
Returns The A list of related resources identified by their relative URIs.String
getTo()
Returns The The phone number that received the message.String
getUri()
Returns The The URI of the resource, relative to `https://api.twilio.com`.int
hashCode()
static MessageReader
reader()
Create a MessageReader to execute read.static MessageReader
reader(String pathAccountSid)
Create a MessageReader to execute read.String
toString()
static MessageUpdater
updater(String pathSid, String body)
Create a MessageUpdater to execute update.static MessageUpdater
updater(String pathAccountSid, String pathSid, String body)
Create a MessageUpdater to execute update.
-
-
-
Method Detail
-
creator
public static MessageCreator creator(String pathAccountSid, PhoneNumber to, PhoneNumber from, String body)
Create a MessageCreator to execute create.- Parameters:
pathAccountSid
- The SID of the Account that will create the resourceto
- The destination phone numberfrom
- The phone number that initiated the messagebody
- The text of the message you want to send. Can be up to 1,600 characters in length.- Returns:
- MessageCreator capable of executing the create
-
creator
public static MessageCreator creator(PhoneNumber to, PhoneNumber from, String body)
Create a MessageCreator to execute create.- Parameters:
to
- The destination phone numberfrom
- The phone number that initiated the messagebody
- The text of the message you want to send. Can be up to 1,600 characters in length.- Returns:
- MessageCreator capable of executing the create
-
creator
public static MessageCreator creator(String pathAccountSid, PhoneNumber to, PhoneNumber from, List<URI> mediaUrl)
Create a MessageCreator to execute create.- Parameters:
pathAccountSid
- The SID of the Account that will create the resourceto
- The destination phone numberfrom
- The phone number that initiated the messagemediaUrl
- The URL of the media to send with the message- Returns:
- MessageCreator capable of executing the create
-
creator
public static MessageCreator creator(PhoneNumber to, PhoneNumber from, List<URI> mediaUrl)
Create a MessageCreator to execute create.- Parameters:
to
- The destination phone numberfrom
- The phone number that initiated the messagemediaUrl
- The URL of the media to send with the message- Returns:
- MessageCreator capable of executing the create
-
creator
public static MessageCreator creator(String pathAccountSid, PhoneNumber to, String messagingServiceSid, String body)
Create a MessageCreator to execute create.- Parameters:
pathAccountSid
- The SID of the Account that will create the resourceto
- The destination phone numbermessagingServiceSid
- The SID of the Messaging Service you want to associate with the message.body
- The text of the message you want to send. Can be up to 1,600 characters in length.- Returns:
- MessageCreator capable of executing the create
-
creator
public static MessageCreator creator(PhoneNumber to, String messagingServiceSid, String body)
Create a MessageCreator to execute create.- Parameters:
to
- The destination phone numbermessagingServiceSid
- The SID of the Messaging Service you want to associate with the message.body
- The text of the message you want to send. Can be up to 1,600 characters in length.- Returns:
- MessageCreator capable of executing the create
-
creator
public static MessageCreator creator(String pathAccountSid, PhoneNumber to, String messagingServiceSid, List<URI> mediaUrl)
Create a MessageCreator to execute create.- Parameters:
pathAccountSid
- The SID of the Account that will create the resourceto
- The destination phone numbermessagingServiceSid
- The SID of the Messaging Service you want to associate with the message.mediaUrl
- The URL of the media to send with the message- Returns:
- MessageCreator capable of executing the create
-
creator
public static MessageCreator creator(PhoneNumber to, String messagingServiceSid, List<URI> mediaUrl)
Create a MessageCreator to execute create.- Parameters:
to
- The destination phone numbermessagingServiceSid
- The SID of the Messaging Service you want to associate with the message.mediaUrl
- The URL of the media to send with the message- Returns:
- MessageCreator capable of executing the create
-
deleter
public static MessageDeleter deleter(String pathAccountSid, String pathSid)
Create a MessageDeleter to execute delete.- Parameters:
pathAccountSid
- The SID of the Account that created the resources to deletepathSid
- The unique string that identifies the resource- Returns:
- MessageDeleter capable of executing the delete
-
deleter
public static MessageDeleter deleter(String pathSid)
Create a MessageDeleter to execute delete.- Parameters:
pathSid
- The unique string that identifies the resource- Returns:
- MessageDeleter capable of executing the delete
-
fetcher
public static MessageFetcher fetcher(String pathAccountSid, String pathSid)
Create a MessageFetcher to execute fetch.- Parameters:
pathAccountSid
- The SID of the Account that created the resource to fetchpathSid
- The unique string that identifies the resource- Returns:
- MessageFetcher capable of executing the fetch
-
fetcher
public static MessageFetcher fetcher(String pathSid)
Create a MessageFetcher to execute fetch.- Parameters:
pathSid
- The unique string that identifies the resource- Returns:
- MessageFetcher capable of executing the fetch
-
reader
public static MessageReader reader(String pathAccountSid)
Create a MessageReader to execute read.- Parameters:
pathAccountSid
- The SID of the Account that created the resources to read- Returns:
- MessageReader capable of executing the read
-
reader
public static MessageReader reader()
Create a MessageReader to execute read.- Returns:
- MessageReader capable of executing the read
-
updater
public static MessageUpdater updater(String pathAccountSid, String pathSid, String body)
Create a MessageUpdater to execute update.- Parameters:
pathAccountSid
- The SID of the Account that created the resources to updatepathSid
- The unique string that identifies the resourcebody
- The text of the message you want to send- Returns:
- MessageUpdater capable of executing the update
-
updater
public static MessageUpdater updater(String pathSid, String body)
Create a MessageUpdater to execute update.- Parameters:
pathSid
- The unique string that identifies the resourcebody
- The text of the message you want to send- Returns:
- MessageUpdater capable of executing the update
-
fromJson
public static Message fromJson(String json, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
Converts a JSON String into a Message object using the provided ObjectMapper.- Parameters:
json
- Raw JSON StringobjectMapper
- Jackson ObjectMapper- Returns:
- Message object represented by the provided JSON
-
fromJson
public static Message fromJson(InputStream json, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
Converts a JSON InputStream into a Message object using the provided ObjectMapper.- Parameters:
json
- Raw JSON InputStreamobjectMapper
- Jackson ObjectMapper- Returns:
- Message object represented by the provided JSON
-
getAccountSid
public final String getAccountSid()
Returns The The SID of the Account that created the resource.- Returns:
- The SID of the Account that created the resource
-
getApiVersion
public final String getApiVersion()
Returns The The API version used to process the message.- Returns:
- The API version used to process the message
-
getBody
public final String getBody()
Returns The The message text.- Returns:
- The message text
-
getDateCreated
public final org.joda.time.DateTime getDateCreated()
Returns The The RFC 2822 date and time in GMT that the resource was created.- Returns:
- The RFC 2822 date and time in GMT that the resource was created
-
getDateUpdated
public final org.joda.time.DateTime getDateUpdated()
Returns The The RFC 2822 date and time in GMT that the resource was last updated.- Returns:
- The RFC 2822 date and time in GMT that the resource was last updated
-
getDateSent
public final org.joda.time.DateTime getDateSent()
Returns The The RFC 2822 date and time in GMT when the message was sent.- Returns:
- The RFC 2822 date and time in GMT when the message was sent
-
getDirection
public final Message.Direction getDirection()
Returns The The direction of the message.- Returns:
- The direction of the message
-
getErrorCode
public final Integer getErrorCode()
Returns The The error code associated with the message.- Returns:
- The error code associated with the message
-
getErrorMessage
public final String getErrorMessage()
Returns The The description of the error_code.- Returns:
- The description of the error_code
-
getFrom
public final PhoneNumber getFrom()
Returns The The phone number that initiated the message.- Returns:
- The phone number that initiated the message
-
getMessagingServiceSid
public final String getMessagingServiceSid()
Returns The The SID of the Messaging Service used with the message..- Returns:
- The SID of the Messaging Service used with the message.
-
getNumMedia
public final String getNumMedia()
Returns The The number of media files associated with the message.- Returns:
- The number of media files associated with the message
-
getNumSegments
public final String getNumSegments()
Returns The The number of messages used to deliver the message body.- Returns:
- The number of messages used to deliver the message body
-
getPrice
public final String getPrice()
Returns The The amount billed for the message.- Returns:
- The amount billed for the message
-
getPriceUnit
public final Currency getPriceUnit()
Returns The The currency in which price is measured.- Returns:
- The currency in which price is measured
-
getSid
public final String getSid()
Returns The The unique string that identifies the resource.- Returns:
- The unique string that identifies the resource
-
getStatus
public final Message.Status getStatus()
Returns The The status of the message.- Returns:
- The status of the message
-
getSubresourceUris
public final Map<String,String> getSubresourceUris()
Returns The A list of related resources identified by their relative URIs.- Returns:
- A list of related resources identified by their relative URIs
-
getTo
public final String getTo()
Returns The The phone number that received the message.- Returns:
- The phone number that received the message
-
getUri
public final String getUri()
Returns The The URI of the resource, relative to `https://api.twilio.com`.- Returns:
- The URI of the resource, relative to `https://api.twilio.com`
-
-