twilio-ruby 5.65.1 → 5.66.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/pr-lint.yml +15 -0
- data/CHANGES.md +41 -0
- data/README.md +2 -4
- data/lib/twilio-ruby/rest/api/v2010/account/call/payment.rb +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/call/stream.rb +4 -4
- data/lib/twilio-ruby/rest/api/v2010/account/call.rb +0 -7
- data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +10 -10
- data/lib/twilio-ruby/rest/chat/v3/channel.rb +275 -0
- data/lib/twilio-ruby/rest/chat/v3.rb +48 -0
- data/lib/twilio-ruby/rest/chat.rb +16 -0
- data/lib/twilio-ruby/rest/flex_api/v1/configuration.rb +7 -0
- data/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_invite.rb +236 -0
- data/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.rb +330 -0
- data/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb +377 -0
- data/lib/twilio-ruby/rest/flex_api/v1/interaction.rb +233 -0
- data/lib/twilio-ruby/rest/flex_api/v1.rb +16 -0
- data/lib/twilio-ruby/rest/flex_api.rb +9 -0
- data/lib/twilio-ruby/rest/insights/v1/annotation.rb +271 -0
- data/lib/twilio-ruby/rest/insights/v1.rb +16 -0
- data/lib/twilio-ruby/rest/insights.rb +8 -0
- data/lib/twilio-ruby/rest/media/v1/media_processor.rb +1 -1
- data/lib/twilio-ruby/rest/media/v1/media_recording.rb +26 -5
- data/lib/twilio-ruby/rest/media/v1/player_streamer.rb +14 -1
- data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +3 -55
- data/lib/twilio-ruby/rest/supersim/v1.rb +0 -16
- data/lib/twilio-ruby/rest/supersim.rb +0 -9
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.rb +6 -2
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.rb +4 -2
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_cumulative_statistics.rb +4 -2
- data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +2 -1
- data/lib/twilio-ruby/rest/verify/v2/verification_attempts_summary.rb +234 -0
- data/lib/twilio-ruby/rest/verify/v2.rb +7 -0
- data/lib/twilio-ruby/rest/verify.rb +6 -0
- data/lib/twilio-ruby/rest/video/v1/composition.rb +14 -0
- data/lib/twilio-ruby/rest/video/v1/recording.rb +14 -0
- data/lib/twilio-ruby/version.rb +1 -1
- metadata +11 -3
- data/lib/twilio-ruby/rest/supersim/v1/command.rb +0 -368
data/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_invite.rb
ADDED
@@ -0,0 +1,236 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# \ / _ _ _| _ _
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
5
|
+
# / /
|
6
|
+
#
|
7
|
+
# frozen_string_literal: true
|
8
|
+
|
9
|
+
module Twilio
|
10
|
+
module REST
|
11
|
+
class FlexApi < Domain
|
12
|
+
class V1 < Version
|
13
|
+
class InteractionContext < InstanceContext
|
14
|
+
class InteractionChannelContext < InstanceContext
|
15
|
+
class InteractionChannelInviteList < ListResource
|
16
|
+
##
|
17
|
+
# Initialize the InteractionChannelInviteList
|
18
|
+
# @param [Version] version Version that contains the resource
|
19
|
+
# @param [String] interaction_sid The interaction_sid
|
20
|
+
# @param [String] channel_sid The channel_sid
|
21
|
+
# @return [InteractionChannelInviteList] InteractionChannelInviteList
|
22
|
+
def initialize(version, interaction_sid: nil, channel_sid: nil)
|
23
|
+
super(version)
|
24
|
+
|
25
|
+
# Path Solution
|
26
|
+
@solution = {interaction_sid: interaction_sid, channel_sid: channel_sid}
|
27
|
+
@uri = "/Interactions/#{@solution[:interaction_sid]}/Channels/#{@solution[:channel_sid]}/Invites"
|
28
|
+
end
|
29
|
+
|
30
|
+
##
|
31
|
+
# Create the InteractionChannelInviteInstance
|
32
|
+
# @param [Hash] routing The routing
|
33
|
+
# @return [InteractionChannelInviteInstance] Created InteractionChannelInviteInstance
|
34
|
+
def create(routing: nil)
|
35
|
+
data = Twilio::Values.of({'Routing' => Twilio.serialize_object(routing), })
|
36
|
+
|
37
|
+
payload = @version.create('POST', @uri, data: data)
|
38
|
+
|
39
|
+
InteractionChannelInviteInstance.new(
|
40
|
+
@version,
|
41
|
+
payload,
|
42
|
+
interaction_sid: @solution[:interaction_sid],
|
43
|
+
channel_sid: @solution[:channel_sid],
|
44
|
+
)
|
45
|
+
end
|
46
|
+
|
47
|
+
##
|
48
|
+
# Lists InteractionChannelInviteInstance records from the API as a list.
|
49
|
+
# Unlike stream(), this operation is eager and will load `limit` records into
|
50
|
+
# memory before returning.
|
51
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
52
|
+
# guarantees to never return more than limit. Default is no limit
|
53
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
54
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
55
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
56
|
+
# efficient page size, i.e. min(limit, 1000)
|
57
|
+
# @return [Array] Array of up to limit results
|
58
|
+
def list(limit: nil, page_size: nil)
|
59
|
+
self.stream(limit: limit, page_size: page_size).entries
|
60
|
+
end
|
61
|
+
|
62
|
+
##
|
63
|
+
# Streams InteractionChannelInviteInstance records from the API as an Enumerable.
|
64
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
65
|
+
# is reached.
|
66
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
67
|
+
# guarantees to never return more than limit. Default is no limit.
|
68
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
69
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
70
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
71
|
+
# efficient page size, i.e. min(limit, 1000)
|
72
|
+
# @return [Enumerable] Enumerable that will yield up to limit results
|
73
|
+
def stream(limit: nil, page_size: nil)
|
74
|
+
limits = @version.read_limits(limit, page_size)
|
75
|
+
|
76
|
+
page = self.page(page_size: limits[:page_size], )
|
77
|
+
|
78
|
+
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
79
|
+
end
|
80
|
+
|
81
|
+
##
|
82
|
+
# When passed a block, yields InteractionChannelInviteInstance records from the API.
|
83
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
84
|
+
# is reached.
|
85
|
+
def each
|
86
|
+
limits = @version.read_limits
|
87
|
+
|
88
|
+
page = self.page(page_size: limits[:page_size], )
|
89
|
+
|
90
|
+
@version.stream(page,
|
91
|
+
limit: limits[:limit],
|
92
|
+
page_limit: limits[:page_limit]).each {|x| yield x}
|
93
|
+
end
|
94
|
+
|
95
|
+
##
|
96
|
+
# Retrieve a single page of InteractionChannelInviteInstance records from the API.
|
97
|
+
# Request is executed immediately.
|
98
|
+
# @param [String] page_token PageToken provided by the API
|
99
|
+
# @param [Integer] page_number Page Number, this value is simply for client state
|
100
|
+
# @param [Integer] page_size Number of records to return, defaults to 50
|
101
|
+
# @return [Page] Page of InteractionChannelInviteInstance
|
102
|
+
def page(page_token: :unset, page_number: :unset, page_size: :unset)
|
103
|
+
params = Twilio::Values.of({
|
104
|
+
'PageToken' => page_token,
|
105
|
+
'Page' => page_number,
|
106
|
+
'PageSize' => page_size,
|
107
|
+
})
|
108
|
+
|
109
|
+
response = @version.page('GET', @uri, params: params)
|
110
|
+
|
111
|
+
InteractionChannelInvitePage.new(@version, response, @solution)
|
112
|
+
end
|
113
|
+
|
114
|
+
##
|
115
|
+
# Retrieve a single page of InteractionChannelInviteInstance records from the API.
|
116
|
+
# Request is executed immediately.
|
117
|
+
# @param [String] target_url API-generated URL for the requested results page
|
118
|
+
# @return [Page] Page of InteractionChannelInviteInstance
|
119
|
+
def get_page(target_url)
|
120
|
+
response = @version.domain.request(
|
121
|
+
'GET',
|
122
|
+
target_url
|
123
|
+
)
|
124
|
+
InteractionChannelInvitePage.new(@version, response, @solution)
|
125
|
+
end
|
126
|
+
|
127
|
+
##
|
128
|
+
# Provide a user friendly representation
|
129
|
+
def to_s
|
130
|
+
'#<Twilio.FlexApi.V1.InteractionChannelInviteList>'
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
class InteractionChannelInvitePage < Page
|
135
|
+
##
|
136
|
+
# Initialize the InteractionChannelInvitePage
|
137
|
+
# @param [Version] version Version that contains the resource
|
138
|
+
# @param [Response] response Response from the API
|
139
|
+
# @param [Hash] solution Path solution for the resource
|
140
|
+
# @return [InteractionChannelInvitePage] InteractionChannelInvitePage
|
141
|
+
def initialize(version, response, solution)
|
142
|
+
super(version, response)
|
143
|
+
|
144
|
+
# Path Solution
|
145
|
+
@solution = solution
|
146
|
+
end
|
147
|
+
|
148
|
+
##
|
149
|
+
# Build an instance of InteractionChannelInviteInstance
|
150
|
+
# @param [Hash] payload Payload response from the API
|
151
|
+
# @return [InteractionChannelInviteInstance] InteractionChannelInviteInstance
|
152
|
+
def get_instance(payload)
|
153
|
+
InteractionChannelInviteInstance.new(
|
154
|
+
@version,
|
155
|
+
payload,
|
156
|
+
interaction_sid: @solution[:interaction_sid],
|
157
|
+
channel_sid: @solution[:channel_sid],
|
158
|
+
)
|
159
|
+
end
|
160
|
+
|
161
|
+
##
|
162
|
+
# Provide a user friendly representation
|
163
|
+
def to_s
|
164
|
+
'<Twilio.FlexApi.V1.InteractionChannelInvitePage>'
|
165
|
+
end
|
166
|
+
end
|
167
|
+
|
168
|
+
class InteractionChannelInviteInstance < InstanceResource
|
169
|
+
##
|
170
|
+
# Initialize the InteractionChannelInviteInstance
|
171
|
+
# @param [Version] version Version that contains the resource
|
172
|
+
# @param [Hash] payload payload that contains response from Twilio
|
173
|
+
# @param [String] interaction_sid The interaction_sid
|
174
|
+
# @param [String] channel_sid The channel_sid
|
175
|
+
# @return [InteractionChannelInviteInstance] InteractionChannelInviteInstance
|
176
|
+
def initialize(version, payload, interaction_sid: nil, channel_sid: nil)
|
177
|
+
super(version)
|
178
|
+
|
179
|
+
# Marshaled Properties
|
180
|
+
@properties = {
|
181
|
+
'sid' => payload['sid'],
|
182
|
+
'interaction_sid' => payload['interaction_sid'],
|
183
|
+
'channel_sid' => payload['channel_sid'],
|
184
|
+
'routing' => payload['routing'],
|
185
|
+
'url' => payload['url'],
|
186
|
+
}
|
187
|
+
end
|
188
|
+
|
189
|
+
##
|
190
|
+
# @return [String] The sid
|
191
|
+
def sid
|
192
|
+
@properties['sid']
|
193
|
+
end
|
194
|
+
|
195
|
+
##
|
196
|
+
# @return [String] The interaction_sid
|
197
|
+
def interaction_sid
|
198
|
+
@properties['interaction_sid']
|
199
|
+
end
|
200
|
+
|
201
|
+
##
|
202
|
+
# @return [String] The channel_sid
|
203
|
+
def channel_sid
|
204
|
+
@properties['channel_sid']
|
205
|
+
end
|
206
|
+
|
207
|
+
##
|
208
|
+
# @return [Hash] The routing
|
209
|
+
def routing
|
210
|
+
@properties['routing']
|
211
|
+
end
|
212
|
+
|
213
|
+
##
|
214
|
+
# @return [String] The url
|
215
|
+
def url
|
216
|
+
@properties['url']
|
217
|
+
end
|
218
|
+
|
219
|
+
##
|
220
|
+
# Provide a user friendly representation
|
221
|
+
def to_s
|
222
|
+
"<Twilio.FlexApi.V1.InteractionChannelInviteInstance>"
|
223
|
+
end
|
224
|
+
|
225
|
+
##
|
226
|
+
# Provide a detailed, user friendly representation
|
227
|
+
def inspect
|
228
|
+
"<Twilio.FlexApi.V1.InteractionChannelInviteInstance>"
|
229
|
+
end
|
230
|
+
end
|
231
|
+
end
|
232
|
+
end
|
233
|
+
end
|
234
|
+
end
|
235
|
+
end
|
236
|
+
end
|
@@ -0,0 +1,330 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# \ / _ _ _| _ _
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
5
|
+
# / /
|
6
|
+
#
|
7
|
+
# frozen_string_literal: true
|
8
|
+
|
9
|
+
module Twilio
|
10
|
+
module REST
|
11
|
+
class FlexApi < Domain
|
12
|
+
class V1 < Version
|
13
|
+
class InteractionContext < InstanceContext
|
14
|
+
class InteractionChannelContext < InstanceContext
|
15
|
+
class InteractionChannelParticipantList < ListResource
|
16
|
+
##
|
17
|
+
# Initialize the InteractionChannelParticipantList
|
18
|
+
# @param [Version] version Version that contains the resource
|
19
|
+
# @param [String] interaction_sid The Interaction Sid for this channel.
|
20
|
+
# @param [String] channel_sid The Channel Sid for this Participant.
|
21
|
+
# @return [InteractionChannelParticipantList] InteractionChannelParticipantList
|
22
|
+
def initialize(version, interaction_sid: nil, channel_sid: nil)
|
23
|
+
super(version)
|
24
|
+
|
25
|
+
# Path Solution
|
26
|
+
@solution = {interaction_sid: interaction_sid, channel_sid: channel_sid}
|
27
|
+
@uri = "/Interactions/#{@solution[:interaction_sid]}/Channels/#{@solution[:channel_sid]}/Participants"
|
28
|
+
end
|
29
|
+
|
30
|
+
##
|
31
|
+
# Create the InteractionChannelParticipantInstance
|
32
|
+
# @param [interaction_channel_participant.Type] type Participant type. Can be:
|
33
|
+
# `agent`, `customer`, `supervisor`, `external` or `unknown`.
|
34
|
+
# @param [Hash] media_properties JSON representing the Media Properties for the
|
35
|
+
# new Participant.
|
36
|
+
# @return [InteractionChannelParticipantInstance] Created InteractionChannelParticipantInstance
|
37
|
+
def create(type: nil, media_properties: nil)
|
38
|
+
data = Twilio::Values.of({
|
39
|
+
'Type' => type,
|
40
|
+
'MediaProperties' => Twilio.serialize_object(media_properties),
|
41
|
+
})
|
42
|
+
|
43
|
+
payload = @version.create('POST', @uri, data: data)
|
44
|
+
|
45
|
+
InteractionChannelParticipantInstance.new(
|
46
|
+
@version,
|
47
|
+
payload,
|
48
|
+
interaction_sid: @solution[:interaction_sid],
|
49
|
+
channel_sid: @solution[:channel_sid],
|
50
|
+
)
|
51
|
+
end
|
52
|
+
|
53
|
+
##
|
54
|
+
# Lists InteractionChannelParticipantInstance records from the API as a list.
|
55
|
+
# Unlike stream(), this operation is eager and will load `limit` records into
|
56
|
+
# memory before returning.
|
57
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
58
|
+
# guarantees to never return more than limit. Default is no limit
|
59
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
60
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
61
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
62
|
+
# efficient page size, i.e. min(limit, 1000)
|
63
|
+
# @return [Array] Array of up to limit results
|
64
|
+
def list(limit: nil, page_size: nil)
|
65
|
+
self.stream(limit: limit, page_size: page_size).entries
|
66
|
+
end
|
67
|
+
|
68
|
+
##
|
69
|
+
# Streams InteractionChannelParticipantInstance records from the API as an Enumerable.
|
70
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
71
|
+
# is reached.
|
72
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
73
|
+
# guarantees to never return more than limit. Default is no limit.
|
74
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
75
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
76
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
77
|
+
# efficient page size, i.e. min(limit, 1000)
|
78
|
+
# @return [Enumerable] Enumerable that will yield up to limit results
|
79
|
+
def stream(limit: nil, page_size: nil)
|
80
|
+
limits = @version.read_limits(limit, page_size)
|
81
|
+
|
82
|
+
page = self.page(page_size: limits[:page_size], )
|
83
|
+
|
84
|
+
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
85
|
+
end
|
86
|
+
|
87
|
+
##
|
88
|
+
# When passed a block, yields InteractionChannelParticipantInstance records from the API.
|
89
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
90
|
+
# is reached.
|
91
|
+
def each
|
92
|
+
limits = @version.read_limits
|
93
|
+
|
94
|
+
page = self.page(page_size: limits[:page_size], )
|
95
|
+
|
96
|
+
@version.stream(page,
|
97
|
+
limit: limits[:limit],
|
98
|
+
page_limit: limits[:page_limit]).each {|x| yield x}
|
99
|
+
end
|
100
|
+
|
101
|
+
##
|
102
|
+
# Retrieve a single page of InteractionChannelParticipantInstance records from the API.
|
103
|
+
# Request is executed immediately.
|
104
|
+
# @param [String] page_token PageToken provided by the API
|
105
|
+
# @param [Integer] page_number Page Number, this value is simply for client state
|
106
|
+
# @param [Integer] page_size Number of records to return, defaults to 50
|
107
|
+
# @return [Page] Page of InteractionChannelParticipantInstance
|
108
|
+
def page(page_token: :unset, page_number: :unset, page_size: :unset)
|
109
|
+
params = Twilio::Values.of({
|
110
|
+
'PageToken' => page_token,
|
111
|
+
'Page' => page_number,
|
112
|
+
'PageSize' => page_size,
|
113
|
+
})
|
114
|
+
|
115
|
+
response = @version.page('GET', @uri, params: params)
|
116
|
+
|
117
|
+
InteractionChannelParticipantPage.new(@version, response, @solution)
|
118
|
+
end
|
119
|
+
|
120
|
+
##
|
121
|
+
# Retrieve a single page of InteractionChannelParticipantInstance records from the API.
|
122
|
+
# Request is executed immediately.
|
123
|
+
# @param [String] target_url API-generated URL for the requested results page
|
124
|
+
# @return [Page] Page of InteractionChannelParticipantInstance
|
125
|
+
def get_page(target_url)
|
126
|
+
response = @version.domain.request(
|
127
|
+
'GET',
|
128
|
+
target_url
|
129
|
+
)
|
130
|
+
InteractionChannelParticipantPage.new(@version, response, @solution)
|
131
|
+
end
|
132
|
+
|
133
|
+
##
|
134
|
+
# Provide a user friendly representation
|
135
|
+
def to_s
|
136
|
+
'#<Twilio.FlexApi.V1.InteractionChannelParticipantList>'
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
class InteractionChannelParticipantPage < Page
|
141
|
+
##
|
142
|
+
# Initialize the InteractionChannelParticipantPage
|
143
|
+
# @param [Version] version Version that contains the resource
|
144
|
+
# @param [Response] response Response from the API
|
145
|
+
# @param [Hash] solution Path solution for the resource
|
146
|
+
# @return [InteractionChannelParticipantPage] InteractionChannelParticipantPage
|
147
|
+
def initialize(version, response, solution)
|
148
|
+
super(version, response)
|
149
|
+
|
150
|
+
# Path Solution
|
151
|
+
@solution = solution
|
152
|
+
end
|
153
|
+
|
154
|
+
##
|
155
|
+
# Build an instance of InteractionChannelParticipantInstance
|
156
|
+
# @param [Hash] payload Payload response from the API
|
157
|
+
# @return [InteractionChannelParticipantInstance] InteractionChannelParticipantInstance
|
158
|
+
def get_instance(payload)
|
159
|
+
InteractionChannelParticipantInstance.new(
|
160
|
+
@version,
|
161
|
+
payload,
|
162
|
+
interaction_sid: @solution[:interaction_sid],
|
163
|
+
channel_sid: @solution[:channel_sid],
|
164
|
+
)
|
165
|
+
end
|
166
|
+
|
167
|
+
##
|
168
|
+
# Provide a user friendly representation
|
169
|
+
def to_s
|
170
|
+
'<Twilio.FlexApi.V1.InteractionChannelParticipantPage>'
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
174
|
+
class InteractionChannelParticipantContext < InstanceContext
|
175
|
+
##
|
176
|
+
# Initialize the InteractionChannelParticipantContext
|
177
|
+
# @param [Version] version Version that contains the resource
|
178
|
+
# @param [String] interaction_sid The Interaction Sid for this channel.
|
179
|
+
# @param [String] channel_sid The Channel Sid for this Participant.
|
180
|
+
# @param [String] sid The unique string created by Twilio to identify an
|
181
|
+
# Interaction Channel resource.
|
182
|
+
# @return [InteractionChannelParticipantContext] InteractionChannelParticipantContext
|
183
|
+
def initialize(version, interaction_sid, channel_sid, sid)
|
184
|
+
super(version)
|
185
|
+
|
186
|
+
# Path Solution
|
187
|
+
@solution = {interaction_sid: interaction_sid, channel_sid: channel_sid, sid: sid, }
|
188
|
+
@uri = "/Interactions/#{@solution[:interaction_sid]}/Channels/#{@solution[:channel_sid]}/Participants/#{@solution[:sid]}"
|
189
|
+
end
|
190
|
+
|
191
|
+
##
|
192
|
+
# Update the InteractionChannelParticipantInstance
|
193
|
+
# @param [interaction_channel_participant.Status] status The Participant's status.
|
194
|
+
# Can be: `closed` or `wrapup`. Participant must be an agent.
|
195
|
+
# @return [InteractionChannelParticipantInstance] Updated InteractionChannelParticipantInstance
|
196
|
+
def update(status: nil)
|
197
|
+
data = Twilio::Values.of({'Status' => status, })
|
198
|
+
|
199
|
+
payload = @version.update('POST', @uri, data: data)
|
200
|
+
|
201
|
+
InteractionChannelParticipantInstance.new(
|
202
|
+
@version,
|
203
|
+
payload,
|
204
|
+
interaction_sid: @solution[:interaction_sid],
|
205
|
+
channel_sid: @solution[:channel_sid],
|
206
|
+
sid: @solution[:sid],
|
207
|
+
)
|
208
|
+
end
|
209
|
+
|
210
|
+
##
|
211
|
+
# Provide a user friendly representation
|
212
|
+
def to_s
|
213
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
214
|
+
"#<Twilio.FlexApi.V1.InteractionChannelParticipantContext #{context}>"
|
215
|
+
end
|
216
|
+
|
217
|
+
##
|
218
|
+
# Provide a detailed, user friendly representation
|
219
|
+
def inspect
|
220
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
221
|
+
"#<Twilio.FlexApi.V1.InteractionChannelParticipantContext #{context}>"
|
222
|
+
end
|
223
|
+
end
|
224
|
+
|
225
|
+
class InteractionChannelParticipantInstance < InstanceResource
|
226
|
+
##
|
227
|
+
# Initialize the InteractionChannelParticipantInstance
|
228
|
+
# @param [Version] version Version that contains the resource
|
229
|
+
# @param [Hash] payload payload that contains response from Twilio
|
230
|
+
# @param [String] interaction_sid The Interaction Sid for this channel.
|
231
|
+
# @param [String] channel_sid The Channel Sid for this Participant.
|
232
|
+
# @param [String] sid The unique string created by Twilio to identify an
|
233
|
+
# Interaction Channel resource.
|
234
|
+
# @return [InteractionChannelParticipantInstance] InteractionChannelParticipantInstance
|
235
|
+
def initialize(version, payload, interaction_sid: nil, channel_sid: nil, sid: nil)
|
236
|
+
super(version)
|
237
|
+
|
238
|
+
# Marshaled Properties
|
239
|
+
@properties = {
|
240
|
+
'sid' => payload['sid'],
|
241
|
+
'type' => payload['type'],
|
242
|
+
'interaction_sid' => payload['interaction_sid'],
|
243
|
+
'channel_sid' => payload['channel_sid'],
|
244
|
+
'url' => payload['url'],
|
245
|
+
}
|
246
|
+
|
247
|
+
# Context
|
248
|
+
@instance_context = nil
|
249
|
+
@params = {
|
250
|
+
'interaction_sid' => interaction_sid,
|
251
|
+
'channel_sid' => channel_sid,
|
252
|
+
'sid' => sid || @properties['sid'],
|
253
|
+
}
|
254
|
+
end
|
255
|
+
|
256
|
+
##
|
257
|
+
# Generate an instance context for the instance, the context is capable of
|
258
|
+
# performing various actions. All instance actions are proxied to the context
|
259
|
+
# @return [InteractionChannelParticipantContext] InteractionChannelParticipantContext for this InteractionChannelParticipantInstance
|
260
|
+
def context
|
261
|
+
unless @instance_context
|
262
|
+
@instance_context = InteractionChannelParticipantContext.new(
|
263
|
+
@version,
|
264
|
+
@params['interaction_sid'],
|
265
|
+
@params['channel_sid'],
|
266
|
+
@params['sid'],
|
267
|
+
)
|
268
|
+
end
|
269
|
+
@instance_context
|
270
|
+
end
|
271
|
+
|
272
|
+
##
|
273
|
+
# @return [String] The unique string that identifies the resource
|
274
|
+
def sid
|
275
|
+
@properties['sid']
|
276
|
+
end
|
277
|
+
|
278
|
+
##
|
279
|
+
# @return [interaction_channel_participant.Type] Participant type.
|
280
|
+
def type
|
281
|
+
@properties['type']
|
282
|
+
end
|
283
|
+
|
284
|
+
##
|
285
|
+
# @return [String] The Interaction Sid for this channel.
|
286
|
+
def interaction_sid
|
287
|
+
@properties['interaction_sid']
|
288
|
+
end
|
289
|
+
|
290
|
+
##
|
291
|
+
# @return [String] The Channel Sid for this Participant.
|
292
|
+
def channel_sid
|
293
|
+
@properties['channel_sid']
|
294
|
+
end
|
295
|
+
|
296
|
+
##
|
297
|
+
# @return [String] The url
|
298
|
+
def url
|
299
|
+
@properties['url']
|
300
|
+
end
|
301
|
+
|
302
|
+
##
|
303
|
+
# Update the InteractionChannelParticipantInstance
|
304
|
+
# @param [interaction_channel_participant.Status] status The Participant's status.
|
305
|
+
# Can be: `closed` or `wrapup`. Participant must be an agent.
|
306
|
+
# @return [InteractionChannelParticipantInstance] Updated InteractionChannelParticipantInstance
|
307
|
+
def update(status: nil)
|
308
|
+
context.update(status: status, )
|
309
|
+
end
|
310
|
+
|
311
|
+
##
|
312
|
+
# Provide a user friendly representation
|
313
|
+
def to_s
|
314
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
315
|
+
"<Twilio.FlexApi.V1.InteractionChannelParticipantInstance #{values}>"
|
316
|
+
end
|
317
|
+
|
318
|
+
##
|
319
|
+
# Provide a detailed, user friendly representation
|
320
|
+
def inspect
|
321
|
+
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
322
|
+
"<Twilio.FlexApi.V1.InteractionChannelParticipantInstance #{values}>"
|
323
|
+
end
|
324
|
+
end
|
325
|
+
end
|
326
|
+
end
|
327
|
+
end
|
328
|
+
end
|
329
|
+
end
|
330
|
+
end
|