twilio-ruby 5.11.2 → 5.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +20 -0
  3. data/Makefile +2 -0
  4. data/README.md +2 -2
  5. data/lib/twilio-ruby/rest/chat/v2/service/channel.rb +13 -6
  6. data/lib/twilio-ruby/rest/chat/v2/service/channel/member.rb +10 -4
  7. data/lib/twilio-ruby/rest/chat/v2/service/channel/message.rb +18 -6
  8. data/lib/twilio-ruby/rest/chat/v2/service/user.rb +7 -3
  9. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb +13 -6
  10. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/member.rb +10 -4
  11. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/message.rb +18 -6
  12. data/lib/twilio-ruby/rest/ip_messaging/v2/service/user.rb +7 -3
  13. data/lib/twilio-ruby/rest/notify/v1/service.rb +0 -46
  14. data/lib/twilio-ruby/rest/preview.rb +13 -20
  15. data/lib/twilio-ruby/rest/preview/marketplace.rb +13 -13
  16. data/lib/twilio-ruby/rest/preview/understand/assistant/intent.rb +16 -0
  17. data/lib/twilio-ruby/rest/preview/understand/assistant/intent/intent_statistics.rb +226 -0
  18. data/lib/twilio-ruby/rest/studio/v1/flow/execution.rb +1 -1
  19. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +102 -50
  20. data/lib/twilio-ruby/rest/video.rb +9 -9
  21. data/lib/twilio-ruby/rest/video/v1.rb +16 -16
  22. data/lib/twilio-ruby/twiml/voice_response.rb +42 -0
  23. data/lib/twilio-ruby/version.rb +1 -1
  24. data/spec/integration/chat/v2/service/channel/message_spec.rb +1 -1
  25. data/spec/integration/ip_messaging/v2/service/channel/message_spec.rb +1 -1
  26. data/spec/integration/preview/understand/assistant/intent/intent_statistics_spec.rb +50 -0
  27. data/spec/integration/preview/understand/assistant/intent_spec.rb +8 -4
  28. data/spec/integration/taskrouter/v1/workspace/task/reservation_spec.rb +31 -0
  29. metadata +6 -37
  30. data/lib/twilio-ruby/rest/notify/v1/service/segment.rb +0 -225
  31. data/lib/twilio-ruby/rest/notify/v1/service/user.rb +0 -438
  32. data/lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb +0 -262
  33. data/lib/twilio-ruby/rest/notify/v1/service/user/user_binding.rb +0 -438
  34. data/lib/twilio-ruby/rest/preview/proxy.rb +0 -43
  35. data/lib/twilio-ruby/rest/preview/proxy/service.rb +0 -464
  36. data/lib/twilio-ruby/rest/preview/proxy/service/phone_number.rb +0 -347
  37. data/lib/twilio-ruby/rest/preview/proxy/service/session.rb +0 -497
  38. data/lib/twilio-ruby/rest/preview/proxy/service/session/interaction.rb +0 -437
  39. data/lib/twilio-ruby/rest/preview/proxy/service/session/participant.rb +0 -514
  40. data/lib/twilio-ruby/rest/preview/proxy/service/session/participant/message_interaction.rb +0 -455
  41. data/lib/twilio-ruby/rest/preview/proxy/service/short_code.rb +0 -342
  42. data/spec/integration/notify/v1/service/segment_spec.rb +0 -86
  43. data/spec/integration/notify/v1/service/user/segment_memberships_spec.rb +0 -118
  44. data/spec/integration/notify/v1/service/user/user_binding_spec.rb +0 -268
  45. data/spec/integration/notify/v1/service/user_spec.rb +0 -213
  46. data/spec/integration/preview/proxy/service/phone_number_spec.rb +0 -173
  47. data/spec/integration/preview/proxy/service/session/interaction_spec.rb +0 -106
  48. data/spec/integration/preview/proxy/service/session/participant/message_interaction_spec.rb +0 -166
  49. data/spec/integration/preview/proxy/service/session/participant_spec.rb +0 -226
  50. data/spec/integration/preview/proxy/service/session_spec.rb +0 -218
  51. data/spec/integration/preview/proxy/service/short_code_spec.rb +0 -173
  52. data/spec/integration/preview/proxy/service_spec.rb +0 -202
@@ -1,455 +0,0 @@
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 Preview < Domain
12
- class Proxy < Version
13
- class ServiceContext < InstanceContext
14
- class SessionContext < InstanceContext
15
- class ParticipantContext < InstanceContext
16
- ##
17
- # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
18
- class MessageInteractionList < ListResource
19
- ##
20
- # Initialize the MessageInteractionList
21
- # @param [Version] version Version that contains the resource
22
- # @param [String] service_sid The unique SID identifier of the Service.
23
- # @param [String] session_sid The unique SID identifier of the Session.
24
- # @param [String] participant_sid The participant_sid
25
- # @return [MessageInteractionList] MessageInteractionList
26
- def initialize(version, service_sid: nil, session_sid: nil, participant_sid: nil)
27
- super(version)
28
-
29
- # Path Solution
30
- @solution = {service_sid: service_sid, session_sid: session_sid, participant_sid: participant_sid}
31
- @uri = "/Services/#{@solution[:service_sid]}/Sessions/#{@solution[:session_sid]}/Participants/#{@solution[:participant_sid]}/MessageInteractions"
32
- end
33
-
34
- ##
35
- # Retrieve a single page of MessageInteractionInstance records from the API.
36
- # Request is executed immediately.
37
- # @param [String] body The text body of the message to send to the Participant. Up
38
- # to 1600 characters long.
39
- # @param [String] media_url The public url of an image or video to send to the
40
- # Participant.
41
- # @return [MessageInteractionInstance] Newly created MessageInteractionInstance
42
- def create(body: :unset, media_url: :unset)
43
- data = Twilio::Values.of({'Body' => body, 'MediaUrl' => Twilio.serialize_list(media_url) { |e| e }, })
44
-
45
- payload = @version.create(
46
- 'POST',
47
- @uri,
48
- data: data
49
- )
50
-
51
- MessageInteractionInstance.new(
52
- @version,
53
- payload,
54
- service_sid: @solution[:service_sid],
55
- session_sid: @solution[:session_sid],
56
- participant_sid: @solution[:participant_sid],
57
- )
58
- end
59
-
60
- ##
61
- # Lists MessageInteractionInstance records from the API as a list.
62
- # Unlike stream(), this operation is eager and will load `limit` records into
63
- # memory before returning.
64
- # @param [Integer] limit Upper limit for the number of records to return. stream()
65
- # guarantees to never return more than limit. Default is no limit
66
- # @param [Integer] page_size Number of records to fetch per request, when
67
- # not set will use the default value of 50 records. If no page_size is defined
68
- # but a limit is defined, stream() will attempt to read the limit with the most
69
- # efficient page size, i.e. min(limit, 1000)
70
- # @return [Array] Array of up to limit results
71
- def list(limit: nil, page_size: nil)
72
- self.stream(limit: limit, page_size: page_size).entries
73
- end
74
-
75
- ##
76
- # Streams MessageInteractionInstance records from the API as an Enumerable.
77
- # This operation lazily loads records as efficiently as possible until the limit
78
- # is reached.
79
- # @param [Integer] limit Upper limit for the number of records to return. stream()
80
- # guarantees to never return more than limit. Default is no limit.
81
- # @param [Integer] page_size Number of records to fetch per request, when
82
- # not set will use the default value of 50 records. If no page_size is defined
83
- # but a limit is defined, stream() will attempt to read the limit with the most
84
- # efficient page size, i.e. min(limit, 1000)
85
- # @return [Enumerable] Enumerable that will yield up to limit results
86
- def stream(limit: nil, page_size: nil)
87
- limits = @version.read_limits(limit, page_size)
88
-
89
- page = self.page(page_size: limits[:page_size], )
90
-
91
- @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
92
- end
93
-
94
- ##
95
- # When passed a block, yields MessageInteractionInstance records from the API.
96
- # This operation lazily loads records as efficiently as possible until the limit
97
- # is reached.
98
- def each
99
- limits = @version.read_limits
100
-
101
- page = self.page(page_size: limits[:page_size], )
102
-
103
- @version.stream(page,
104
- limit: limits[:limit],
105
- page_limit: limits[:page_limit]).each {|x| yield x}
106
- end
107
-
108
- ##
109
- # Retrieve a single page of MessageInteractionInstance records from the API.
110
- # Request is executed immediately.
111
- # @param [String] page_token PageToken provided by the API
112
- # @param [Integer] page_number Page Number, this value is simply for client state
113
- # @param [Integer] page_size Number of records to return, defaults to 50
114
- # @return [Page] Page of MessageInteractionInstance
115
- def page(page_token: :unset, page_number: :unset, page_size: :unset)
116
- params = Twilio::Values.of({
117
- 'PageToken' => page_token,
118
- 'Page' => page_number,
119
- 'PageSize' => page_size,
120
- })
121
- response = @version.page(
122
- 'GET',
123
- @uri,
124
- params
125
- )
126
- MessageInteractionPage.new(@version, response, @solution)
127
- end
128
-
129
- ##
130
- # Retrieve a single page of MessageInteractionInstance records from the API.
131
- # Request is executed immediately.
132
- # @param [String] target_url API-generated URL for the requested results page
133
- # @return [Page] Page of MessageInteractionInstance
134
- def get_page(target_url)
135
- response = @version.domain.request(
136
- 'GET',
137
- target_url
138
- )
139
- MessageInteractionPage.new(@version, response, @solution)
140
- end
141
-
142
- ##
143
- # Provide a user friendly representation
144
- def to_s
145
- '#<Twilio.Preview.Proxy.MessageInteractionList>'
146
- end
147
- end
148
-
149
- ##
150
- # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
151
- class MessageInteractionPage < Page
152
- ##
153
- # Initialize the MessageInteractionPage
154
- # @param [Version] version Version that contains the resource
155
- # @param [Response] response Response from the API
156
- # @param [Hash] solution Path solution for the resource
157
- # @return [MessageInteractionPage] MessageInteractionPage
158
- def initialize(version, response, solution)
159
- super(version, response)
160
-
161
- # Path Solution
162
- @solution = solution
163
- end
164
-
165
- ##
166
- # Build an instance of MessageInteractionInstance
167
- # @param [Hash] payload Payload response from the API
168
- # @return [MessageInteractionInstance] MessageInteractionInstance
169
- def get_instance(payload)
170
- MessageInteractionInstance.new(
171
- @version,
172
- payload,
173
- service_sid: @solution[:service_sid],
174
- session_sid: @solution[:session_sid],
175
- participant_sid: @solution[:participant_sid],
176
- )
177
- end
178
-
179
- ##
180
- # Provide a user friendly representation
181
- def to_s
182
- '<Twilio.Preview.Proxy.MessageInteractionPage>'
183
- end
184
- end
185
-
186
- ##
187
- # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
188
- class MessageInteractionContext < InstanceContext
189
- ##
190
- # Initialize the MessageInteractionContext
191
- # @param [Version] version Version that contains the resource
192
- # @param [String] service_sid The unique SID identifier of the Service.
193
- # @param [String] session_sid The unique SID identifier of the Session.
194
- # @param [String] participant_sid The unique SID identifier of the Participant.
195
- # @param [String] sid A 34 character string that uniquely identifies this
196
- # Interaction.
197
- # @return [MessageInteractionContext] MessageInteractionContext
198
- def initialize(version, service_sid, session_sid, participant_sid, sid)
199
- super(version)
200
-
201
- # Path Solution
202
- @solution = {
203
- service_sid: service_sid,
204
- session_sid: session_sid,
205
- participant_sid: participant_sid,
206
- sid: sid,
207
- }
208
- @uri = "/Services/#{@solution[:service_sid]}/Sessions/#{@solution[:session_sid]}/Participants/#{@solution[:participant_sid]}/MessageInteractions/#{@solution[:sid]}"
209
- end
210
-
211
- ##
212
- # Fetch a MessageInteractionInstance
213
- # @return [MessageInteractionInstance] Fetched MessageInteractionInstance
214
- def fetch
215
- params = Twilio::Values.of({})
216
-
217
- payload = @version.fetch(
218
- 'GET',
219
- @uri,
220
- params,
221
- )
222
-
223
- MessageInteractionInstance.new(
224
- @version,
225
- payload,
226
- service_sid: @solution[:service_sid],
227
- session_sid: @solution[:session_sid],
228
- participant_sid: @solution[:participant_sid],
229
- sid: @solution[:sid],
230
- )
231
- end
232
-
233
- ##
234
- # Provide a user friendly representation
235
- def to_s
236
- context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
237
- "#<Twilio.Preview.Proxy.MessageInteractionContext #{context}>"
238
- end
239
- end
240
-
241
- ##
242
- # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
243
- class MessageInteractionInstance < InstanceResource
244
- ##
245
- # Initialize the MessageInteractionInstance
246
- # @param [Version] version Version that contains the resource
247
- # @param [Hash] payload payload that contains response from Twilio
248
- # @param [String] service_sid The unique SID identifier of the Service.
249
- # @param [String] session_sid The unique SID identifier of the Session.
250
- # @param [String] participant_sid The participant_sid
251
- # @param [String] sid A 34 character string that uniquely identifies this
252
- # Interaction.
253
- # @return [MessageInteractionInstance] MessageInteractionInstance
254
- def initialize(version, payload, service_sid: nil, session_sid: nil, participant_sid: nil, sid: nil)
255
- super(version)
256
-
257
- # Marshaled Properties
258
- @properties = {
259
- 'sid' => payload['sid'],
260
- 'session_sid' => payload['session_sid'],
261
- 'service_sid' => payload['service_sid'],
262
- 'account_sid' => payload['account_sid'],
263
- 'data' => payload['data'],
264
- 'status' => payload['status'],
265
- 'participant_sid' => payload['participant_sid'],
266
- 'inbound_participant_sid' => payload['inbound_participant_sid'],
267
- 'inbound_resource_sid' => payload['inbound_resource_sid'],
268
- 'inbound_resource_status' => payload['inbound_resource_status'],
269
- 'inbound_resource_type' => payload['inbound_resource_type'],
270
- 'inbound_resource_url' => payload['inbound_resource_url'],
271
- 'outbound_participant_sid' => payload['outbound_participant_sid'],
272
- 'outbound_resource_sid' => payload['outbound_resource_sid'],
273
- 'outbound_resource_status' => payload['outbound_resource_status'],
274
- 'outbound_resource_type' => payload['outbound_resource_type'],
275
- 'outbound_resource_url' => payload['outbound_resource_url'],
276
- 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
277
- 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
278
- 'url' => payload['url'],
279
- }
280
-
281
- # Context
282
- @instance_context = nil
283
- @params = {
284
- 'service_sid' => service_sid,
285
- 'session_sid' => session_sid,
286
- 'participant_sid' => participant_sid,
287
- 'sid' => sid || @properties['sid'],
288
- }
289
- end
290
-
291
- ##
292
- # Generate an instance context for the instance, the context is capable of
293
- # performing various actions. All instance actions are proxied to the context
294
- # @return [MessageInteractionContext] MessageInteractionContext for this MessageInteractionInstance
295
- def context
296
- unless @instance_context
297
- @instance_context = MessageInteractionContext.new(
298
- @version,
299
- @params['service_sid'],
300
- @params['session_sid'],
301
- @params['participant_sid'],
302
- @params['sid'],
303
- )
304
- end
305
- @instance_context
306
- end
307
-
308
- ##
309
- # @return [String] A string that uniquely identifies this Interaction.
310
- def sid
311
- @properties['sid']
312
- end
313
-
314
- ##
315
- # @return [String] Session Sid.
316
- def session_sid
317
- @properties['session_sid']
318
- end
319
-
320
- ##
321
- # @return [String] Service Sid.
322
- def service_sid
323
- @properties['service_sid']
324
- end
325
-
326
- ##
327
- # @return [String] Account Sid.
328
- def account_sid
329
- @properties['account_sid']
330
- end
331
-
332
- ##
333
- # @return [String] What happened in this Interaction.
334
- def data
335
- @properties['data']
336
- end
337
-
338
- ##
339
- # @return [message_interaction.Status] The Status of this Interaction
340
- def status
341
- @properties['status']
342
- end
343
-
344
- ##
345
- # @return [String] The participant_sid
346
- def participant_sid
347
- @properties['participant_sid']
348
- end
349
-
350
- ##
351
- # @return [String] The inbound_participant_sid
352
- def inbound_participant_sid
353
- @properties['inbound_participant_sid']
354
- end
355
-
356
- ##
357
- # @return [String] The SID of the inbound resource.
358
- def inbound_resource_sid
359
- @properties['inbound_resource_sid']
360
- end
361
-
362
- ##
363
- # @return [message_interaction.ResourceStatus] The Inbound Resource Status of this Interaction
364
- def inbound_resource_status
365
- @properties['inbound_resource_status']
366
- end
367
-
368
- ##
369
- # @return [String] The Twilio object type of the inbound resource.
370
- def inbound_resource_type
371
- @properties['inbound_resource_type']
372
- end
373
-
374
- ##
375
- # @return [String] The URL of the inbound resource.
376
- def inbound_resource_url
377
- @properties['inbound_resource_url']
378
- end
379
-
380
- ##
381
- # @return [String] The outbound_participant_sid
382
- def outbound_participant_sid
383
- @properties['outbound_participant_sid']
384
- end
385
-
386
- ##
387
- # @return [String] The SID of the outbound resource.
388
- def outbound_resource_sid
389
- @properties['outbound_resource_sid']
390
- end
391
-
392
- ##
393
- # @return [message_interaction.ResourceStatus] The Outbound Resource Status of this Interaction
394
- def outbound_resource_status
395
- @properties['outbound_resource_status']
396
- end
397
-
398
- ##
399
- # @return [String] The Twilio object type of the outbound resource.
400
- def outbound_resource_type
401
- @properties['outbound_resource_type']
402
- end
403
-
404
- ##
405
- # @return [String] The URL of the outbound resource.
406
- def outbound_resource_url
407
- @properties['outbound_resource_url']
408
- end
409
-
410
- ##
411
- # @return [Time] The date this Interaction was created
412
- def date_created
413
- @properties['date_created']
414
- end
415
-
416
- ##
417
- # @return [Time] The date this Interaction was updated
418
- def date_updated
419
- @properties['date_updated']
420
- end
421
-
422
- ##
423
- # @return [String] The URL of this Interaction.
424
- def url
425
- @properties['url']
426
- end
427
-
428
- ##
429
- # Fetch a MessageInteractionInstance
430
- # @return [MessageInteractionInstance] Fetched MessageInteractionInstance
431
- def fetch
432
- context.fetch
433
- end
434
-
435
- ##
436
- # Provide a user friendly representation
437
- def to_s
438
- values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
439
- "<Twilio.Preview.Proxy.MessageInteractionInstance #{values}>"
440
- end
441
-
442
- ##
443
- # Provide a detailed, user friendly representation
444
- def inspect
445
- values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
446
- "<Twilio.Preview.Proxy.MessageInteractionInstance #{values}>"
447
- end
448
- end
449
- end
450
- end
451
- end
452
- end
453
- end
454
- end
455
- end