Class MessageCreator

    • Constructor Detail

      • MessageCreator

        public MessageCreator​(String pathServiceSid,
                              String pathChannelSid,
                              String body)
        Construct a new MessageCreator.
        Parameters:
        pathServiceSid - The SID of the Service to create the resource under
        pathChannelSid - The unique ID of the channel the new resource belongs to
        body - The message to send to the channel
    • Method Detail

      • setFrom

        public MessageCreator setFrom​(String from)
        The [identity](https://www.twilio.com/docs/api/chat/guides/identity) of the new message's author. The default value is `system`..
        Parameters:
        from - The identity of the new message's author
        Returns:
        this
      • setAttributes

        public MessageCreator setAttributes​(String attributes)
        A valid JSON string that contains application-specific data..
        Parameters:
        attributes - A valid JSON string that contains application-specific data
        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