Class: Twilio::REST::FlexApi::V2::WebChannelsList

Inherits:
ListResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/flex_api/v2/web_channels.rb

Instance Method Summary collapse

Constructor Details

#initialize(version) ⇒ WebChannelsList

Initialize the WebChannelsList

Parameters:

  • version (Version)

    Version that contains the resource



26
27
28
29
30
31
32
# File 'lib/twilio-ruby/rest/flex_api/v2/web_channels.rb', line 26

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

Instance Method Details

#create(address_sid: nil, chat_friendly_name: :unset, customer_friendly_name: :unset, pre_engagement_data: :unset, ui_version: :unset) ⇒ WebChannelsInstance

Create the WebChannelsInstance

Parameters:

  • address_sid (String) (defaults to: nil)

    The SID of the Conversations Address. See [Address Configuration Resource](www.twilio.com/docs/conversations/api/address-configuration-resource) for configuration details. When a conversation is created on the Flex backend, the callback URL will be set to the corresponding Studio Flow SID or webhook URL in your address configuration.

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

    The Conversation’s friendly name. See the [Conversation resource](www.twilio.com/docs/conversations/api/conversation-resource) for an example.

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

    The Conversation participant’s friendly name. See the [Conversation Participant Resource](www.twilio.com/docs/conversations/api/conversation-participant-resource) for an example.

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

    The pre-engagement data.

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

    The Ui-Version HTTP request header

Returns:



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/twilio-ruby/rest/flex_api/v2/web_channels.rb', line 41

def create(
    address_sid: nil, 
    chat_friendly_name: :unset, 
    customer_friendly_name: :unset, 
    pre_engagement_data: :unset, 
    ui_version: :unset
)

    data = Twilio::Values.of({
        'AddressSid' => address_sid,
        'ChatFriendlyName' => chat_friendly_name,
        'CustomerFriendlyName' => customer_friendly_name,
        'PreEngagementData' => pre_engagement_data,
    })

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', 'Ui-Version' => ui_version, })
    
    
    
    
    
    payload = @version.create('POST', @uri, data: data, headers: headers)
    WebChannelsInstance.new(
        @version,
        payload,
    )
end

#to_sObject

Provide a user friendly representation



73
74
75
# File 'lib/twilio-ruby/rest/flex_api/v2/web_channels.rb', line 73

def to_s
    '#<Twilio.FlexApi.V2.WebChannelsList>'
end