Class: Twilio::REST::Conversations::V1::ConversationWithParticipantsList

Inherits:
ListResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/conversations/v1/conversation_with_participants.rb

Instance Method Summary collapse

Constructor Details

#initialize(version) ⇒ ConversationWithParticipantsList

Initialize the ConversationWithParticipantsList

Parameters:

  • version (Version)

    Version that contains the resource



26
27
28
29
30
31
32
# File 'lib/twilio-ruby/rest/conversations/v1/conversation_with_participants.rb', line 26

def initialize(version)
    super(version)
    # Path Solution
    @solution = {  }
    @uri = "/ConversationWithParticipants"
    
end

Instance Method Details

#create(friendly_name: :unset, unique_name: :unset, date_created: :unset, date_updated: :unset, messaging_service_sid: :unset, attributes: :unset, state: :unset, timers_inactive: :unset, timers_closed: :unset, bindings_email_address: :unset, bindings_email_name: :unset, participant: :unset, x_twilio_webhook_enabled: :unset) ⇒ ConversationWithParticipantsInstance

Create the ConversationWithParticipantsInstance

Parameters:

  • friendly_name (String) (defaults to: :unset)

    The human-readable name of this conversation, limited to 256 characters. Optional.

  • unique_name (String) (defaults to: :unset)

    An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource’s ‘sid` in the URL.

  • date_created (Time) (defaults to: :unset)

    The date that this resource was created.

  • date_updated (Time) (defaults to: :unset)

    The date that this resource was last updated.

  • messaging_service_sid (String) (defaults to: :unset)

    The unique ID of the [Messaging Service](www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to.

  • attributes (String) (defaults to: :unset)

    An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. Note that if the attributes are not set \"{}\" will be returned.

  • state (State) (defaults to: :unset)
  • timers_inactive (String) (defaults to: :unset)

    ISO8601 duration when conversation will be switched to ‘inactive` state. Minimum value for this timer is 1 minute.

  • timers_closed (String) (defaults to: :unset)

    ISO8601 duration when conversation will be switched to ‘closed` state. Minimum value for this timer is 10 minutes.

  • bindings_email_address (String) (defaults to: :unset)

    The default email address that will be used when sending outbound emails in this conversation.

  • bindings_email_name (String) (defaults to: :unset)

    The default name that will be used when sending outbound emails in this conversation.

  • participant (Array[String]) (defaults to: :unset)

    The participant to be added to the conversation in JSON format. The JSON object attributes are as parameters in [Participant Resource](www.twilio.com/docs/conversations/api/conversation-participant-resource). The maximum number of participants that can be added in a single request is 10.

  • x_twilio_webhook_enabled (ConversationWithParticipantsEnumWebhookEnabledType) (defaults to: :unset)

    The X-Twilio-Webhook-Enabled HTTP request header

Returns:



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/twilio-ruby/rest/conversations/v1/conversation_with_participants.rb', line 49

def create(
    friendly_name: :unset, 
    unique_name: :unset, 
    date_created: :unset, 
    date_updated: :unset, 
    messaging_service_sid: :unset, 
    attributes: :unset, 
    state: :unset, 
    timers_inactive: :unset, 
    timers_closed: :unset, 
    bindings_email_address: :unset, 
    bindings_email_name: :unset, 
    participant: :unset, 
    x_twilio_webhook_enabled: :unset
)

    data = Twilio::Values.of({
        'FriendlyName' => friendly_name,
        'UniqueName' => unique_name,
        'DateCreated' => Twilio.serialize_iso8601_datetime(date_created),
        'DateUpdated' => Twilio.serialize_iso8601_datetime(date_updated),
        'MessagingServiceSid' => messaging_service_sid,
        'Attributes' => attributes,
        'State' => state,
        'Timers.Inactive' => timers_inactive,
        'Timers.Closed' => timers_closed,
        'Bindings.Email.Address' => bindings_email_address,
        'Bindings.Email.Name' => bindings_email_name,
        'Participant' => Twilio.serialize_list(participant) { |e| e },
    })

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', 'X-Twilio-Webhook-Enabled' => x_twilio_webhook_enabled, })
    
    
    
    
    
    payload = @version.create('POST', @uri, data: data, headers: headers)
    ConversationWithParticipantsInstance.new(
        @version,
        payload,
    )
end

#to_sObject

Provide a user friendly representation



97
98
99
# File 'lib/twilio-ruby/rest/conversations/v1/conversation_with_participants.rb', line 97

def to_s
    '#<Twilio.Conversations.V1.ConversationWithParticipantsList>'
end