Class Message

    • 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 resource
        to - The destination phone number
        from - The phone number that initiated 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,
                                             PhoneNumber from,
                                             String body)
        Create a MessageCreator to execute create.
        Parameters:
        to - The destination phone number
        from - The phone number that initiated 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,
                                             PhoneNumber from,
                                             List<URI> mediaUrl)
        Create a MessageCreator to execute create.
        Parameters:
        pathAccountSid - The SID of the Account that will create the resource
        to - The destination phone number
        from - The phone number that initiated 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,
                                             PhoneNumber from,
                                             List<URI> mediaUrl)
        Create a MessageCreator to execute create.
        Parameters:
        to - The destination phone number
        from - The phone number that initiated 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​(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 resource
        to - The destination phone number
        messagingServiceSid - 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 number
        messagingServiceSid - 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 resource
        to - The destination phone number
        messagingServiceSid - 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 number
        messagingServiceSid - 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 delete
        pathSid - 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 fetch
        pathSid - 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 update
        pathSid - The unique string that identifies the resource
        body - 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 resource
        body - 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 String
        objectMapper - 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 InputStream
        objectMapper - 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`
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object