Class SessionCreator


  • public class SessionCreator
    extends Creator<Session>
    PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
    • Constructor Detail

      • SessionCreator

        public SessionCreator​(String pathServiceSid)
        Construct a new SessionCreator.
        Parameters:
        pathServiceSid - The SID of the parent Service resource
    • Method Detail

      • setUniqueName

        public SessionCreator setUniqueName​(String uniqueName)
        An application-defined string that uniquely identifies the resource. This value must be 191 characters or fewer in length and be unique. **This value should not have PII.**.
        Parameters:
        uniqueName - An application-defined string that uniquely identifies the resource
        Returns:
        this
      • setDateExpiry

        public SessionCreator setDateExpiry​(org.joda.time.DateTime dateExpiry)
        The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date when the Session should expire. If this is value is present, it overrides the `ttl` value..
        Parameters:
        dateExpiry - The ISO 8601 date when the Session should expire
        Returns:
        this
      • setTtl

        public SessionCreator setTtl​(Integer ttl)
        The time, in seconds, when the session will expire. The time is measured from the last Session create or the Session's last Interaction..
        Parameters:
        ttl - When the session will expire
        Returns:
        this
      • setMode

        public SessionCreator setMode​(Session.Mode mode)
        The Mode of the Session. Can be: `message-only`, `voice-only`, or `voice-and-message` and the default value is `voice-and-message`..
        Parameters:
        mode - The Mode of the Session
        Returns:
        this
      • setStatus

        public SessionCreator setStatus​(Session.Status status)
        The initial status of the Session. Can be: `open`, `in-progress`, `closed`, `failed`, or `unknown`. The default is `open` on create..
        Parameters:
        status - Session status
        Returns:
        this
      • setParticipants

        public SessionCreator setParticipants​(List<Map<String,​Object>> participants)
        The Participant objects to include in the new session..
        Parameters:
        participants - The Participant objects to include in the new session
        Returns:
        this
      • setParticipants

        public SessionCreator setParticipants​(Map<String,​Object> participants)
        The Participant objects to include in the new session..
        Parameters:
        participants - The Participant objects to include in the new session
        Returns:
        this
      • create

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