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 that contains the resource



26
27
28
29
30
31
32
33
# 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, identity: :unset, ui_version: :unset) ⇒ WebChannelsInstance

Create the WebChannelsInstance

Parameters:

Returns:

  • Created WebChannelsInstance



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
68
69
70
71
# File 'lib/twilio-ruby/rest/flex_api/v2/web_channels.rb', line 43

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

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

    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

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

Create the WebChannelsInstanceMetadata

Parameters:

Returns:

  • Created WebChannelsInstance



82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'lib/twilio-ruby/rest/flex_api/v2/web_channels.rb', line 82

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

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

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

#to_sObject

Provide a user friendly representation



122
123
124
# File 'lib/twilio-ruby/rest/flex_api/v2/web_channels.rb', line 122

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