public class Message extends Resource
Modifier and Type | Class and Description |
---|---|
static class |
Message.AddressRetention |
static class |
Message.ContentRetention |
static class |
Message.Direction |
static class |
Message.ScheduleType |
static class |
Message.Status |
static class |
Message.TrafficType |
Modifier and Type | Method and Description |
---|---|
static MessageCreator |
creator(PhoneNumber to,
PhoneNumber from,
List<URI> mediaUrl)
Create a MessageCreator to execute create.
|
static MessageCreator |
creator(PhoneNumber to,
PhoneNumber from,
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(PhoneNumber to,
String messagingServiceSid,
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,
PhoneNumber from,
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 MessageCreator |
creator(String pathAccountSid,
PhoneNumber to,
String messagingServiceSid,
String body)
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 SID of the Account that created the resource.
|
String |
getApiVersion()
Returns The API version used to process the message.
|
String |
getBody()
Returns The message text.
|
ZonedDateTime |
getDateCreated()
Returns The RFC 2822 date and time in GMT that the resource was created.
|
ZonedDateTime |
getDateSent()
Returns The RFC 2822 date and time in GMT when the message was sent.
|
ZonedDateTime |
getDateUpdated()
Returns The RFC 2822 date and time in GMT that the resource was last updated.
|
Message.Direction |
getDirection()
Returns The direction of the message.
|
Integer |
getErrorCode()
Returns The error code associated with the message.
|
String |
getErrorMessage()
Returns The description of the error_code.
|
PhoneNumber |
getFrom()
Returns The phone number that initiated the message.
|
String |
getMessagingServiceSid()
Returns The SID of the Messaging Service used with the message..
|
String |
getNumMedia()
Returns The number of media files associated with the message.
|
String |
getNumSegments()
Returns The number of messages used to deliver the message body.
|
String |
getPrice()
Returns The amount billed for the message.
|
Currency |
getPriceUnit()
Returns The currency in which price is measured.
|
String |
getSid()
Returns The unique string that identifies the resource.
|
Message.Status |
getStatus()
Returns The status of the message.
|
Map<String,String> |
getSubresourceUris()
Returns A list of related resources identified by their relative URIs.
|
String |
getTo()
Returns The phone number that received the message.
|
String |
getUri()
Returns 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.
|
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.
|
public static MessageCreator creator(String pathAccountSid, PhoneNumber to, PhoneNumber from, String body)
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.public static MessageCreator creator(PhoneNumber to, PhoneNumber from, String body)
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.public static MessageCreator creator(String pathAccountSid, PhoneNumber to, PhoneNumber from, List<URI> mediaUrl)
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 messagepublic static MessageCreator creator(PhoneNumber to, PhoneNumber from, List<URI> mediaUrl)
to
- The destination phone numberfrom
- The phone number that initiated the messagemediaUrl
- The URL of the media to send with the messagepublic static MessageCreator creator(String pathAccountSid, PhoneNumber to, String messagingServiceSid, String body)
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.public static MessageCreator creator(PhoneNumber to, String messagingServiceSid, String body)
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.public static MessageCreator creator(String pathAccountSid, PhoneNumber to, String messagingServiceSid, List<URI> mediaUrl)
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 messagepublic static MessageCreator creator(PhoneNumber to, String messagingServiceSid, List<URI> mediaUrl)
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 messagepublic static MessageDeleter deleter(String pathAccountSid, String pathSid)
pathAccountSid
- The SID of the Account that created the resources to
deletepathSid
- The unique string that identifies the resourcepublic static MessageDeleter deleter(String pathSid)
pathSid
- The unique string that identifies the resourcepublic static MessageFetcher fetcher(String pathAccountSid, String pathSid)
pathAccountSid
- The SID of the Account that created the resource to
fetchpathSid
- The unique string that identifies the resourcepublic static MessageFetcher fetcher(String pathSid)
pathSid
- The unique string that identifies the resourcepublic static MessageReader reader(String pathAccountSid)
pathAccountSid
- The SID of the Account that created the resources to
readpublic static MessageReader reader()
public static MessageUpdater updater(String pathAccountSid, String pathSid, String body)
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 sendpublic static MessageUpdater updater(String pathSid, String body)
pathSid
- The unique string that identifies the resourcebody
- The text of the message you want to sendpublic static Message fromJson(String json, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
json
- Raw JSON StringobjectMapper
- Jackson ObjectMapperpublic static Message fromJson(InputStream json, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
json
- Raw JSON InputStreamobjectMapper
- Jackson ObjectMapperpublic final String getBody()
public final String getNumSegments()
public final Message.Direction getDirection()
public final PhoneNumber getFrom()
public final String getTo()
public final ZonedDateTime getDateUpdated()
public final String getPrice()
public final String getErrorMessage()
public final String getUri()
public final String getAccountSid()
public final String getNumMedia()
public final Message.Status getStatus()
public final String getMessagingServiceSid()
public final String getSid()
public final ZonedDateTime getDateSent()
public final ZonedDateTime getDateCreated()
public final Integer getErrorCode()
public final Currency getPriceUnit()
public final String getApiVersion()
public final Map<String,String> getSubresourceUris()
Copyright © 2019 Twilio, Inc. All Rights Reserved.