twilio-ruby 6.8.3 → 6.9.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +36 -0
  3. data/README.md +2 -2
  4. data/lib/twilio-ruby/http/http_client.rb +3 -2
  5. data/lib/twilio-ruby/rest/api/v2010/account/authorized_connect_app.rb +0 -14
  6. data/lib/twilio-ruby/rest/client.rb +0 -5
  7. data/lib/twilio-ruby/rest/events/v1/event_type.rb +0 -2
  8. data/lib/twilio-ruby/rest/events/v1/schema/schema_version.rb +0 -2
  9. data/lib/twilio-ruby/rest/events/v1/schema.rb +0 -2
  10. data/lib/twilio-ruby/rest/events/v1/sink.rb +0 -2
  11. data/lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb +4 -6
  12. data/lib/twilio-ruby/rest/events/v1/subscription.rb +0 -2
  13. data/lib/twilio-ruby/rest/numbers/v1/porting_port_in_fetch.rb +245 -0
  14. data/lib/twilio-ruby/rest/numbers/v1.rb +15 -0
  15. data/lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb +27 -27
  16. data/lib/twilio-ruby/rest/preview/sync/service.rb +27 -27
  17. data/lib/twilio-ruby/rest/preview.rb +1 -11
  18. data/lib/twilio-ruby/rest/preview_base.rb +0 -5
  19. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +6 -0
  20. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb +6 -0
  21. data/lib/twilio-ruby/rest/trusthub/v1/compliance_tollfree_inquiries.rb +59 -2
  22. data/lib/twilio-ruby/version.rb +1 -1
  23. metadata +3 -35
  24. data/lib/twilio-ruby/rest/autopilot/v1/assistant/defaults.rb +0 -241
  25. data/lib/twilio-ruby/rest/autopilot/v1/assistant/dialogue.rb +0 -217
  26. data/lib/twilio-ruby/rest/autopilot/v1/assistant/field_type/field_value.rb +0 -389
  27. data/lib/twilio-ruby/rest/autopilot/v1/assistant/field_type.rb +0 -435
  28. data/lib/twilio-ruby/rest/autopilot/v1/assistant/model_build.rb +0 -409
  29. data/lib/twilio-ruby/rest/autopilot/v1/assistant/query.rb +0 -473
  30. data/lib/twilio-ruby/rest/autopilot/v1/assistant/style_sheet.rb +0 -241
  31. data/lib/twilio-ruby/rest/autopilot/v1/assistant/task/field.rb +0 -373
  32. data/lib/twilio-ruby/rest/autopilot/v1/assistant/task/sample.rb +0 -436
  33. data/lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_actions.rb +0 -253
  34. data/lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_statistics.rb +0 -226
  35. data/lib/twilio-ruby/rest/autopilot/v1/assistant/task.rb +0 -525
  36. data/lib/twilio-ruby/rest/autopilot/v1/assistant/webhook.rb +0 -433
  37. data/lib/twilio-ruby/rest/autopilot/v1/assistant.rb +0 -683
  38. data/lib/twilio-ruby/rest/autopilot/v1/restore_assistant.rb +0 -207
  39. data/lib/twilio-ruby/rest/autopilot/v1.rb +0 -55
  40. data/lib/twilio-ruby/rest/autopilot.rb +0 -22
  41. data/lib/twilio-ruby/rest/autopilot_base.rb +0 -38
  42. data/lib/twilio-ruby/rest/preview/understand/assistant/assistant_fallback_actions.rb +0 -241
  43. data/lib/twilio-ruby/rest/preview/understand/assistant/assistant_initiation_actions.rb +0 -241
  44. data/lib/twilio-ruby/rest/preview/understand/assistant/dialogue.rb +0 -217
  45. data/lib/twilio-ruby/rest/preview/understand/assistant/field_type/field_value.rb +0 -389
  46. data/lib/twilio-ruby/rest/preview/understand/assistant/field_type.rb +0 -435
  47. data/lib/twilio-ruby/rest/preview/understand/assistant/model_build.rb +0 -409
  48. data/lib/twilio-ruby/rest/preview/understand/assistant/query.rb +0 -463
  49. data/lib/twilio-ruby/rest/preview/understand/assistant/style_sheet.rb +0 -241
  50. data/lib/twilio-ruby/rest/preview/understand/assistant/task/field.rb +0 -373
  51. data/lib/twilio-ruby/rest/preview/understand/assistant/task/sample.rb +0 -436
  52. data/lib/twilio-ruby/rest/preview/understand/assistant/task/task_actions.rb +0 -253
  53. data/lib/twilio-ruby/rest/preview/understand/assistant/task/task_statistics.rb +0 -226
  54. data/lib/twilio-ruby/rest/preview/understand/assistant/task.rb +0 -525
  55. data/lib/twilio-ruby/rest/preview/understand/assistant.rb +0 -663
  56. data/lib/twilio-ruby/rest/preview/understand.rb +0 -49
@@ -1,525 +0,0 @@
1
- ##
2
- # This code was generated by
3
- # ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
4
- # | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5
- # | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6
- #
7
- # Twilio - Autopilot
8
- # This is the public Twilio REST API.
9
- #
10
- # NOTE: This class is auto generated by OpenAPI Generator.
11
- # https://openapi-generator.tech
12
- # Do not edit the class manually.
13
- #
14
-
15
-
16
- module Twilio
17
- module REST
18
- class Autopilot < AutopilotBase
19
- class V1 < Version
20
- class AssistantContext < InstanceContext
21
-
22
- class TaskList < ListResource
23
- ##
24
- # Initialize the TaskList
25
- # @param [Version] version Version that contains the resource
26
- # @return [TaskList] TaskList
27
- def initialize(version, assistant_sid: nil)
28
- super(version)
29
- # Path Solution
30
- @solution = { assistant_sid: assistant_sid }
31
- @uri = "/Assistants/#{@solution[:assistant_sid]}/Tasks"
32
-
33
- end
34
- ##
35
- # Create the TaskInstance
36
- # @param [String] unique_name An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. This value must be unique and 64 characters or less in length.
37
- # @param [String] friendly_name A descriptive string that you create to describe the new resource. It is not unique and can be up to 255 characters long.
38
- # @param [Object] actions The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task. It is optional and not unique.
39
- # @param [String] actions_url The URL from which the Assistant can fetch actions.
40
- # @return [TaskInstance] Created TaskInstance
41
- def create(
42
- unique_name: nil,
43
- friendly_name: :unset,
44
- actions: :unset,
45
- actions_url: :unset
46
- )
47
-
48
- data = Twilio::Values.of({
49
- 'UniqueName' => unique_name,
50
- 'FriendlyName' => friendly_name,
51
- 'Actions' => Twilio.serialize_object(actions),
52
- 'ActionsUrl' => actions_url,
53
- })
54
-
55
- payload = @version.create('POST', @uri, data: data)
56
- TaskInstance.new(
57
- @version,
58
- payload,
59
- assistant_sid: @solution[:assistant_sid],
60
- )
61
- end
62
-
63
-
64
- ##
65
- # Lists TaskInstance records from the API as a list.
66
- # Unlike stream(), this operation is eager and will load `limit` records into
67
- # memory before returning.
68
- # @param [Integer] limit Upper limit for the number of records to return. stream()
69
- # guarantees to never return more than limit. Default is no limit
70
- # @param [Integer] page_size Number of records to fetch per request, when
71
- # not set will use the default value of 50 records. If no page_size is defined
72
- # but a limit is defined, stream() will attempt to read the limit with the most
73
- # efficient page size, i.e. min(limit, 1000)
74
- # @return [Array] Array of up to limit results
75
- def list(limit: nil, page_size: nil)
76
- self.stream(
77
- limit: limit,
78
- page_size: page_size
79
- ).entries
80
- end
81
-
82
- ##
83
- # Streams Instance records from the API as an Enumerable.
84
- # This operation lazily loads records as efficiently as possible until the limit
85
- # is reached.
86
- # @param [Integer] limit Upper limit for the number of records to return. stream()
87
- # guarantees to never return more than limit. Default is no limit
88
- # @param [Integer] page_size Number of records to fetch per request, when
89
- # not set will use the default value of 50 records. If no page_size is defined
90
- # but a limit is defined, stream() will attempt to read the limit with the most
91
- # efficient page size, i.e. min(limit, 1000)
92
- # @return [Enumerable] Enumerable that will yield up to limit results
93
- def stream(limit: nil, page_size: nil)
94
- limits = @version.read_limits(limit, page_size)
95
-
96
- page = self.page(
97
- page_size: limits[:page_size], )
98
-
99
- @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
100
- end
101
-
102
- ##
103
- # When passed a block, yields TaskInstance records from the API.
104
- # This operation lazily loads records as efficiently as possible until the limit
105
- # is reached.
106
- def each
107
- limits = @version.read_limits
108
-
109
- page = self.page(page_size: limits[:page_size], )
110
-
111
- @version.stream(page,
112
- limit: limits[:limit],
113
- page_limit: limits[:page_limit]).each {|x| yield x}
114
- end
115
-
116
- ##
117
- # Retrieve a single page of TaskInstance records from the API.
118
- # Request is executed immediately.
119
- # @param [String] page_token PageToken provided by the API
120
- # @param [Integer] page_number Page Number, this value is simply for client state
121
- # @param [Integer] page_size Number of records to return, defaults to 50
122
- # @return [Page] Page of TaskInstance
123
- def page(page_token: :unset, page_number: :unset, page_size: :unset)
124
- params = Twilio::Values.of({
125
- 'PageToken' => page_token,
126
- 'Page' => page_number,
127
- 'PageSize' => page_size,
128
- })
129
-
130
- response = @version.page('GET', @uri, params: params)
131
-
132
- TaskPage.new(@version, response, @solution)
133
- end
134
-
135
- ##
136
- # Retrieve a single page of TaskInstance records from the API.
137
- # Request is executed immediately.
138
- # @param [String] target_url API-generated URL for the requested results page
139
- # @return [Page] Page of TaskInstance
140
- def get_page(target_url)
141
- response = @version.domain.request(
142
- 'GET',
143
- target_url
144
- )
145
- TaskPage.new(@version, response, @solution)
146
- end
147
-
148
-
149
-
150
- # Provide a user friendly representation
151
- def to_s
152
- '#<Twilio.Autopilot.V1.TaskList>'
153
- end
154
- end
155
-
156
-
157
- ##
158
- #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.
159
- class TaskContext < InstanceContext
160
- ##
161
- # Initialize the TaskContext
162
- # @param [Version] version Version that contains the resource
163
- # @param [String] assistant_sid The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to update.
164
- # @param [String] sid The Twilio-provided string that uniquely identifies the Task resource to update.
165
- # @return [TaskContext] TaskContext
166
- def initialize(version, assistant_sid, sid)
167
- super(version)
168
-
169
- # Path Solution
170
- @solution = { assistant_sid: assistant_sid, sid: sid, }
171
- @uri = "/Assistants/#{@solution[:assistant_sid]}/Tasks/#{@solution[:sid]}"
172
-
173
- # Dependents
174
- @samples = nil
175
- @task_actions = nil
176
- @statistics = nil
177
- @fields = nil
178
- end
179
- ##
180
- # Delete the TaskInstance
181
- # @return [Boolean] True if delete succeeds, false otherwise
182
- def delete
183
-
184
- @version.delete('DELETE', @uri)
185
- end
186
-
187
- ##
188
- # Fetch the TaskInstance
189
- # @return [TaskInstance] Fetched TaskInstance
190
- def fetch
191
-
192
- payload = @version.fetch('GET', @uri)
193
- TaskInstance.new(
194
- @version,
195
- payload,
196
- assistant_sid: @solution[:assistant_sid],
197
- sid: @solution[:sid],
198
- )
199
- end
200
-
201
- ##
202
- # Update the TaskInstance
203
- # @param [String] friendly_name A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long.
204
- # @param [String] unique_name An application-defined string that uniquely identifies the resource. This value must be 64 characters or less in length and be unique. It can be used as an alternative to the `sid` in the URL path to address the resource.
205
- # @param [Object] actions The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task.
206
- # @param [String] actions_url The URL from which the Assistant can fetch actions.
207
- # @return [TaskInstance] Updated TaskInstance
208
- def update(
209
- friendly_name: :unset,
210
- unique_name: :unset,
211
- actions: :unset,
212
- actions_url: :unset
213
- )
214
-
215
- data = Twilio::Values.of({
216
- 'FriendlyName' => friendly_name,
217
- 'UniqueName' => unique_name,
218
- 'Actions' => Twilio.serialize_object(actions),
219
- 'ActionsUrl' => actions_url,
220
- })
221
-
222
- payload = @version.update('POST', @uri, data: data)
223
- TaskInstance.new(
224
- @version,
225
- payload,
226
- assistant_sid: @solution[:assistant_sid],
227
- sid: @solution[:sid],
228
- )
229
- end
230
-
231
- ##
232
- # Access the samples
233
- # @return [SampleList]
234
- # @return [SampleContext] if sid was passed.
235
- def samples(sid=:unset)
236
-
237
- raise ArgumentError, 'sid cannot be nil' if sid.nil?
238
-
239
- if sid != :unset
240
- return SampleContext.new(@version, @solution[:assistant_sid], @solution[:sid],sid )
241
- end
242
-
243
- unless @samples
244
- @samples = SampleList.new(
245
- @version, assistant_sid: @solution[:assistant_sid], task_sid: @solution[:sid], )
246
- end
247
-
248
- @samples
249
- end
250
- ##
251
- # Access the task_actions
252
- # @return [TaskActionsList]
253
- # @return [TaskActionsContext]
254
- def task_actions
255
- TaskActionsContext.new(
256
- @version,
257
- @solution[:assistant_sid],
258
- @solution[:sid]
259
- )
260
- end
261
- ##
262
- # Access the statistics
263
- # @return [TaskStatisticsList]
264
- # @return [TaskStatisticsContext]
265
- def statistics
266
- TaskStatisticsContext.new(
267
- @version,
268
- @solution[:assistant_sid],
269
- @solution[:sid]
270
- )
271
- end
272
- ##
273
- # Access the fields
274
- # @return [FieldList]
275
- # @return [FieldContext] if sid was passed.
276
- def fields(sid=:unset)
277
-
278
- raise ArgumentError, 'sid cannot be nil' if sid.nil?
279
-
280
- if sid != :unset
281
- return FieldContext.new(@version, @solution[:assistant_sid], @solution[:sid],sid )
282
- end
283
-
284
- unless @fields
285
- @fields = FieldList.new(
286
- @version, assistant_sid: @solution[:assistant_sid], task_sid: @solution[:sid], )
287
- end
288
-
289
- @fields
290
- end
291
-
292
- ##
293
- # Provide a user friendly representation
294
- def to_s
295
- context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
296
- "#<Twilio.Autopilot.V1.TaskContext #{context}>"
297
- end
298
-
299
- ##
300
- # Provide a detailed, user friendly representation
301
- def inspect
302
- context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
303
- "#<Twilio.Autopilot.V1.TaskContext #{context}>"
304
- end
305
- end
306
-
307
- class TaskPage < Page
308
- ##
309
- # Initialize the TaskPage
310
- # @param [Version] version Version that contains the resource
311
- # @param [Response] response Response from the API
312
- # @param [Hash] solution Path solution for the resource
313
- # @return [TaskPage] TaskPage
314
- def initialize(version, response, solution)
315
- super(version, response)
316
-
317
- # Path Solution
318
- @solution = solution
319
- end
320
-
321
- ##
322
- # Build an instance of TaskInstance
323
- # @param [Hash] payload Payload response from the API
324
- # @return [TaskInstance] TaskInstance
325
- def get_instance(payload)
326
- TaskInstance.new(@version, payload, assistant_sid: @solution[:assistant_sid])
327
- end
328
-
329
- ##
330
- # Provide a user friendly representation
331
- def to_s
332
- '<Twilio.Autopilot.V1.TaskPage>'
333
- end
334
- end
335
- class TaskInstance < InstanceResource
336
- ##
337
- # Initialize the TaskInstance
338
- # @param [Version] version Version that contains the resource
339
- # @param [Hash] payload payload that contains response from Twilio
340
- # @param [String] account_sid The SID of the
341
- # {Account}[https://www.twilio.com/docs/iam/api/account] that created this Task
342
- # resource.
343
- # @param [String] sid The SID of the Call resource to fetch.
344
- # @return [TaskInstance] TaskInstance
345
- def initialize(version, payload , assistant_sid: nil, sid: nil)
346
- super(version)
347
-
348
- # Marshaled Properties
349
- @properties = {
350
- 'account_sid' => payload['account_sid'],
351
- 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
352
- 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
353
- 'friendly_name' => payload['friendly_name'],
354
- 'links' => payload['links'],
355
- 'assistant_sid' => payload['assistant_sid'],
356
- 'sid' => payload['sid'],
357
- 'unique_name' => payload['unique_name'],
358
- 'actions_url' => payload['actions_url'],
359
- 'url' => payload['url'],
360
- }
361
-
362
- # Context
363
- @instance_context = nil
364
- @params = { 'assistant_sid' => assistant_sid || @properties['assistant_sid'] ,'sid' => sid || @properties['sid'] , }
365
- end
366
-
367
- ##
368
- # Generate an instance context for the instance, the context is capable of
369
- # performing various actions. All instance actions are proxied to the context
370
- # @return [TaskContext] CallContext for this CallInstance
371
- def context
372
- unless @instance_context
373
- @instance_context = TaskContext.new(@version , @params['assistant_sid'], @params['sid'])
374
- end
375
- @instance_context
376
- end
377
-
378
- ##
379
- # @return [String] The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Task resource.
380
- def account_sid
381
- @properties['account_sid']
382
- end
383
-
384
- ##
385
- # @return [Time] The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
386
- def date_created
387
- @properties['date_created']
388
- end
389
-
390
- ##
391
- # @return [Time] The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
392
- def date_updated
393
- @properties['date_updated']
394
- end
395
-
396
- ##
397
- # @return [String] The string that you assigned to describe the resource. It is not unique and can be up to 255 characters long.
398
- def friendly_name
399
- @properties['friendly_name']
400
- end
401
-
402
- ##
403
- # @return [Hash] A list of the URLs of related resources.
404
- def links
405
- @properties['links']
406
- end
407
-
408
- ##
409
- # @return [String] The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource.
410
- def assistant_sid
411
- @properties['assistant_sid']
412
- end
413
-
414
- ##
415
- # @return [String] The unique string that we created to identify the Task resource.
416
- def sid
417
- @properties['sid']
418
- end
419
-
420
- ##
421
- # @return [String] An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource.
422
- def unique_name
423
- @properties['unique_name']
424
- end
425
-
426
- ##
427
- # @return [String] The URL from which the Assistant can fetch actions.
428
- def actions_url
429
- @properties['actions_url']
430
- end
431
-
432
- ##
433
- # @return [String] The absolute URL of the Task resource.
434
- def url
435
- @properties['url']
436
- end
437
-
438
- ##
439
- # Delete the TaskInstance
440
- # @return [Boolean] True if delete succeeds, false otherwise
441
- def delete
442
-
443
- context.delete
444
- end
445
-
446
- ##
447
- # Fetch the TaskInstance
448
- # @return [TaskInstance] Fetched TaskInstance
449
- def fetch
450
-
451
- context.fetch
452
- end
453
-
454
- ##
455
- # Update the TaskInstance
456
- # @param [String] friendly_name A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long.
457
- # @param [String] unique_name An application-defined string that uniquely identifies the resource. This value must be 64 characters or less in length and be unique. It can be used as an alternative to the `sid` in the URL path to address the resource.
458
- # @param [Object] actions The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task.
459
- # @param [String] actions_url The URL from which the Assistant can fetch actions.
460
- # @return [TaskInstance] Updated TaskInstance
461
- def update(
462
- friendly_name: :unset,
463
- unique_name: :unset,
464
- actions: :unset,
465
- actions_url: :unset
466
- )
467
-
468
- context.update(
469
- friendly_name: friendly_name,
470
- unique_name: unique_name,
471
- actions: actions,
472
- actions_url: actions_url,
473
- )
474
- end
475
-
476
- ##
477
- # Access the samples
478
- # @return [samples] samples
479
- def samples
480
- context.samples
481
- end
482
-
483
- ##
484
- # Access the task_actions
485
- # @return [task_actions] task_actions
486
- def task_actions
487
- context.task_actions
488
- end
489
-
490
- ##
491
- # Access the statistics
492
- # @return [statistics] statistics
493
- def statistics
494
- context.statistics
495
- end
496
-
497
- ##
498
- # Access the fields
499
- # @return [fields] fields
500
- def fields
501
- context.fields
502
- end
503
-
504
- ##
505
- # Provide a user friendly representation
506
- def to_s
507
- values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
508
- "<Twilio.Autopilot.V1.TaskInstance #{values}>"
509
- end
510
-
511
- ##
512
- # Provide a detailed, user friendly representation
513
- def inspect
514
- values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
515
- "<Twilio.Autopilot.V1.TaskInstance #{values}>"
516
- end
517
- end
518
-
519
- end
520
- end
521
- end
522
- end
523
- end
524
-
525
-