Class MessageCreator


  • public class MessageCreator
    extends Creator<Message>
    PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact [email protected].
    • Constructor Detail

      • MessageCreator

        public MessageCreator​(String pathSessionSid)
        Construct a new MessageCreator.
        Parameters:
        pathSessionSid - The unique id of the Session for this message.
    • Method Detail

      • setAuthor

        public MessageCreator setAuthor​(String author)
        The [identity](https://www.twilio.com/docs/api/chat/guides/identity) of the message's author. Defaults to `system`..
        Parameters:
        author - The identity of the message's author.
        Returns:
        this
      • setAttributes

        public MessageCreator setAttributes​(String attributes)
        A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified..
        Parameters:
        attributes - A string metadata field you can use to store any data you wish.
        Returns:
        this
      • setDateCreated

        public MessageCreator setDateCreated​(org.joda.time.DateTime dateCreated)
        The date that this resource was created..
        Parameters:
        dateCreated - The date that this resource was created.
        Returns:
        this
      • setDateUpdated

        public MessageCreator setDateUpdated​(org.joda.time.DateTime dateUpdated)
        The date that this resource was last updated. `null` if the message has not been edited..
        Parameters:
        dateUpdated - The date that this resource was last updated.
        Returns:
        this
      • setBody

        public MessageCreator setBody​(String body)
        The contents of the message..
        Parameters:
        body - The contents of the message.
        Returns:
        this
      • create

        public Message create​(TwilioRestClient client)
        Make the request to the Twilio API to perform the create.
        Specified by:
        create in class Creator<Message>
        Parameters:
        client - TwilioRestClient with which to make the request
        Returns:
        Created Message