twilio-ruby 5.64.0 → 5.66.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test-and-deploy.yml +5 -0
  3. data/CHANGES.md +78 -0
  4. data/README.md +2 -2
  5. data/lib/twilio-ruby/rest/api/v2010/account/call/payment.rb +2 -2
  6. data/lib/twilio-ruby/rest/api/v2010/account/call/siprec.rb +7 -0
  7. data/lib/twilio-ruby/rest/api/v2010/account/call/stream.rb +11 -4
  8. data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +27 -7
  9. data/lib/twilio-ruby/rest/chat/v2/service/user/user_channel.rb +10 -4
  10. data/lib/twilio-ruby/rest/chat/v3/channel.rb +275 -0
  11. data/lib/twilio-ruby/rest/chat/v3.rb +48 -0
  12. data/lib/twilio-ruby/rest/chat.rb +16 -0
  13. data/lib/twilio-ruby/rest/conversations/v1/address_configuration.rb +22 -10
  14. data/lib/twilio-ruby/rest/flex_api/v1/configuration.rb +7 -0
  15. data/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_invite.rb +236 -0
  16. data/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.rb +330 -0
  17. data/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb +377 -0
  18. data/lib/twilio-ruby/rest/flex_api/v1/interaction.rb +233 -0
  19. data/lib/twilio-ruby/rest/flex_api/v1.rb +16 -0
  20. data/lib/twilio-ruby/rest/flex_api.rb +9 -0
  21. data/lib/twilio-ruby/rest/insights/v1/annotation.rb +271 -0
  22. data/lib/twilio-ruby/rest/insights/v1.rb +16 -0
  23. data/lib/twilio-ruby/rest/insights.rb +8 -0
  24. data/lib/twilio-ruby/rest/media/v1/media_processor.rb +1 -1
  25. data/lib/twilio-ruby/rest/media/v1/media_recording.rb +406 -0
  26. data/lib/twilio-ruby/rest/media/v1/player_streamer.rb +14 -1
  27. data/lib/twilio-ruby/rest/media/v1.rb +16 -0
  28. data/lib/twilio-ruby/rest/media.rb +9 -0
  29. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb +6 -6
  30. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/supporting_document.rb +7 -0
  31. data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +3 -55
  32. data/lib/twilio-ruby/rest/supersim/v1/usage_record.rb +9 -9
  33. data/lib/twilio-ruby/rest/supersim/v1.rb +0 -16
  34. data/lib/twilio-ruby/rest/supersim.rb +0 -9
  35. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.rb +6 -2
  36. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.rb +4 -2
  37. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_cumulative_statistics.rb +4 -2
  38. data/lib/twilio-ruby/rest/verify/v2/service/access_token.rb +18 -1
  39. data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb +22 -4
  40. data/lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb +7 -0
  41. data/lib/twilio-ruby/rest/verify/v2/service/entity/new_factor.rb +16 -6
  42. data/lib/twilio-ruby/rest/video/v1/composition.rb +14 -0
  43. data/lib/twilio-ruby/rest/video/v1/recording.rb +14 -0
  44. data/lib/twilio-ruby/version.rb +1 -1
  45. data/lib/twilio-ruby.rb +1 -1
  46. metadata +10 -3
  47. data/lib/twilio-ruby/rest/supersim/v1/command.rb +0 -368
@@ -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