twilio-ruby 7.0.2 → 7.1.1

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 (64) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +58 -0
  3. data/Gemfile +1 -0
  4. data/README.md +2 -2
  5. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +3 -3
  6. data/lib/twilio-ruby/rest/client.rb +3 -3
  7. data/lib/twilio-ruby/rest/content/v2/content.rb +316 -0
  8. data/lib/twilio-ruby/rest/content/v2/content_and_approvals.rb +309 -0
  9. data/lib/twilio-ruby/rest/content/v2.rb +46 -0
  10. data/lib/twilio-ruby/rest/content_base.rb +6 -1
  11. data/lib/twilio-ruby/rest/flex_api/v1/interaction.rb +1 -1
  12. data/lib/twilio-ruby/rest/flex_api/v1/plugin/plugin_versions.rb +8 -1
  13. data/lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb +444 -0
  14. data/lib/twilio-ruby/rest/intelligence/v2/operator.rb +355 -0
  15. data/lib/twilio-ruby/rest/intelligence/v2/operator_attachment.rb +215 -0
  16. data/lib/twilio-ruby/rest/intelligence/v2/operator_attachments.rb +196 -0
  17. data/lib/twilio-ruby/rest/intelligence/v2/operator_type.rb +357 -0
  18. data/lib/twilio-ruby/rest/intelligence/v2/prebuilt_operator.rb +355 -0
  19. data/lib/twilio-ruby/rest/intelligence/v2/service.rb +9 -8
  20. data/lib/twilio-ruby/rest/intelligence/v2/transcript.rb +18 -18
  21. data/lib/twilio-ruby/rest/intelligence/v2.rb +112 -0
  22. data/lib/twilio-ruby/rest/marketplace/v1/available_add_on/available_add_on_extension.rb +308 -0
  23. data/lib/twilio-ruby/rest/marketplace/v1/available_add_on.rb +335 -0
  24. data/lib/twilio-ruby/rest/marketplace/v1/installed_add_on/installed_add_on_extension.rb +350 -0
  25. data/lib/twilio-ruby/rest/marketplace/v1/installed_add_on/installed_add_on_usage.rb +169 -0
  26. data/lib/twilio-ruby/rest/marketplace/v1/installed_add_on.rb +461 -0
  27. data/lib/twilio-ruby/rest/marketplace/v1/module_data_management.rb +282 -0
  28. data/lib/twilio-ruby/rest/marketplace/v1.rb +79 -0
  29. data/lib/twilio-ruby/rest/marketplace.rb +6 -0
  30. data/lib/twilio-ruby/rest/{preview_messaging_base.rb → marketplace_base.rb} +6 -6
  31. data/lib/twilio-ruby/rest/messaging/v1/service.rb +0 -7
  32. data/lib/twilio-ruby/rest/messaging/v1/tollfree_verification.rb +15 -3
  33. data/lib/twilio-ruby/rest/messaging/v1.rb +1 -1
  34. data/lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb +86 -1
  35. data/lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb +126 -2
  36. data/lib/twilio-ruby/rest/numbers/v1/porting_webhook_configuration.rb +148 -0
  37. data/lib/twilio-ruby/rest/numbers/v1/porting_webhook_configuration_delete.rb +167 -0
  38. data/lib/twilio-ruby/rest/numbers/v1/porting_webhook_configuration_fetch.rb +160 -0
  39. data/lib/twilio-ruby/rest/numbers/v1/signing_request_configuration.rb +176 -0
  40. data/lib/twilio-ruby/rest/numbers/v1.rb +35 -32
  41. data/lib/twilio-ruby/rest/preview/sync/service/document.rb +1 -1
  42. data/lib/twilio-ruby/rest/preview/sync/service/sync_list.rb +2 -2
  43. data/lib/twilio-ruby/rest/preview/sync/service/sync_map.rb +2 -2
  44. data/lib/twilio-ruby/rest/preview/sync/service.rb +2 -2
  45. data/lib/twilio-ruby/rest/sync/v1/service/document.rb +1 -1
  46. data/lib/twilio-ruby/rest/sync/v1/service/sync_list.rb +2 -2
  47. data/lib/twilio-ruby/rest/sync/v1/service/sync_map.rb +2 -2
  48. data/lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb +1 -1
  49. data/lib/twilio-ruby/rest/sync/v1/service.rb +3 -3
  50. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +33 -4
  51. data/lib/twilio-ruby/rest/trusthub/v1/compliance_tollfree_inquiries.rb +4 -1
  52. data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb +7 -0
  53. data/lib/twilio-ruby/rest/trusthub/v1/trust_products.rb +7 -0
  54. data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +1 -1
  55. data/lib/twilio-ruby/rest/verify/v2/service/verification_check.rb +1 -1
  56. data/lib/twilio-ruby/rest/verify/v2/service.rb +1 -1
  57. data/lib/twilio-ruby/version.rb +1 -1
  58. metadata +24 -9
  59. data/lib/twilio-ruby/rest/numbers/v1/porting_bulk_portability.rb +0 -230
  60. data/lib/twilio-ruby/rest/numbers/v1/porting_port_in_fetch.rb +0 -252
  61. data/lib/twilio-ruby/rest/preview_messaging/v1/broadcast.rb +0 -164
  62. data/lib/twilio-ruby/rest/preview_messaging/v1/message.rb +0 -235
  63. data/lib/twilio-ruby/rest/preview_messaging/v1.rb +0 -46
  64. data/lib/twilio-ruby/rest/preview_messaging.rb +0 -12
@@ -0,0 +1,461 @@
1
+ ##
2
+ # This code was generated by
3
+ # ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
4
+ # | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5
+ # | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6
+ #
7
+ # Twilio - Marketplace
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 Marketplace < MarketplaceBase
19
+ class V1 < Version
20
+ class InstalledAddOnList < ListResource
21
+
22
+ ##
23
+ # Initialize the InstalledAddOnList
24
+ # @param [Version] version Version that contains the resource
25
+ # @return [InstalledAddOnList] InstalledAddOnList
26
+ def initialize(version)
27
+ super(version)
28
+ # Path Solution
29
+ @solution = { }
30
+ @uri = "/InstalledAddOns"
31
+
32
+ end
33
+ ##
34
+ # Create the InstalledAddOnInstance
35
+ # @param [String] available_add_on_sid The SID of the AvaliableAddOn to install.
36
+ # @param [Boolean] accept_terms_of_service Whether the Terms of Service were accepted.
37
+ # @param [Object] configuration The JSON object that represents the configuration of the new Add-on being installed.
38
+ # @param [String] unique_name An application-defined string that uniquely identifies the resource. This value must be unique within the Account.
39
+ # @return [InstalledAddOnInstance] Created InstalledAddOnInstance
40
+ def create(
41
+ available_add_on_sid: nil,
42
+ accept_terms_of_service: nil,
43
+ configuration: :unset,
44
+ unique_name: :unset
45
+ )
46
+
47
+ data = Twilio::Values.of({
48
+ 'AvailableAddOnSid' => available_add_on_sid,
49
+ 'AcceptTermsOfService' => accept_terms_of_service,
50
+ 'Configuration' => Twilio.serialize_object(configuration),
51
+ 'UniqueName' => unique_name,
52
+ })
53
+
54
+
55
+ payload = @version.create('POST', @uri, data: data)
56
+ InstalledAddOnInstance.new(
57
+ @version,
58
+ payload,
59
+ )
60
+ end
61
+
62
+
63
+ ##
64
+ # Lists InstalledAddOnInstance records from the API as a list.
65
+ # Unlike stream(), this operation is eager and will load `limit` records into
66
+ # memory before returning.
67
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
68
+ # guarantees to never return more than limit. Default is no limit
69
+ # @param [Integer] page_size Number of records to fetch per request, when
70
+ # not set will use the default value of 50 records. If no page_size is defined
71
+ # but a limit is defined, stream() will attempt to read the limit with the most
72
+ # efficient page size, i.e. min(limit, 1000)
73
+ # @return [Array] Array of up to limit results
74
+ def list(limit: nil, page_size: nil)
75
+ self.stream(
76
+ limit: limit,
77
+ page_size: page_size
78
+ ).entries
79
+ end
80
+
81
+ ##
82
+ # Streams Instance records from the API as an Enumerable.
83
+ # This operation lazily loads records as efficiently as possible until the limit
84
+ # is reached.
85
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
86
+ # guarantees to never return more than limit. Default is no limit
87
+ # @param [Integer] page_size Number of records to fetch per request, when
88
+ # not set will use the default value of 50 records. If no page_size is defined
89
+ # but a limit is defined, stream() will attempt to read the limit with the most
90
+ # efficient page size, i.e. min(limit, 1000)
91
+ # @return [Enumerable] Enumerable that will yield up to limit results
92
+ def stream(limit: nil, page_size: nil)
93
+ limits = @version.read_limits(limit, page_size)
94
+
95
+ page = self.page(
96
+ page_size: limits[:page_size], )
97
+
98
+ @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
99
+ end
100
+
101
+ ##
102
+ # When passed a block, yields InstalledAddOnInstance records from the API.
103
+ # This operation lazily loads records as efficiently as possible until the limit
104
+ # is reached.
105
+ def each
106
+ limits = @version.read_limits
107
+
108
+ page = self.page(page_size: limits[:page_size], )
109
+
110
+ @version.stream(page,
111
+ limit: limits[:limit],
112
+ page_limit: limits[:page_limit]).each {|x| yield x}
113
+ end
114
+
115
+ ##
116
+ # Retrieve a single page of InstalledAddOnInstance records from the API.
117
+ # Request is executed immediately.
118
+ # @param [String] page_token PageToken provided by the API
119
+ # @param [Integer] page_number Page Number, this value is simply for client state
120
+ # @param [Integer] page_size Number of records to return, defaults to 50
121
+ # @return [Page] Page of InstalledAddOnInstance
122
+ def page(page_token: :unset, page_number: :unset, page_size: :unset)
123
+ params = Twilio::Values.of({
124
+ 'PageToken' => page_token,
125
+ 'Page' => page_number,
126
+ 'PageSize' => page_size,
127
+ })
128
+
129
+ response = @version.page('GET', @uri, params: params)
130
+
131
+ InstalledAddOnPage.new(@version, response, @solution)
132
+ end
133
+
134
+ ##
135
+ # Retrieve a single page of InstalledAddOnInstance records from the API.
136
+ # Request is executed immediately.
137
+ # @param [String] target_url API-generated URL for the requested results page
138
+ # @return [Page] Page of InstalledAddOnInstance
139
+ def get_page(target_url)
140
+ response = @version.domain.request(
141
+ 'GET',
142
+ target_url
143
+ )
144
+ InstalledAddOnPage.new(@version, response, @solution)
145
+ end
146
+
147
+
148
+
149
+ # Provide a user friendly representation
150
+ def to_s
151
+ '#<Twilio.Marketplace.V1.InstalledAddOnList>'
152
+ end
153
+ end
154
+
155
+
156
+ class InstalledAddOnContext < InstanceContext
157
+ ##
158
+ # Initialize the InstalledAddOnContext
159
+ # @param [Version] version Version that contains the resource
160
+ # @param [String] sid The SID of the InstalledAddOn resource to update.
161
+ # @return [InstalledAddOnContext] InstalledAddOnContext
162
+ def initialize(version, sid)
163
+ super(version)
164
+
165
+ # Path Solution
166
+ @solution = { sid: sid, }
167
+ @uri = "/InstalledAddOns/#{@solution[:sid]}"
168
+
169
+ # Dependents
170
+ @usage = nil
171
+ @extensions = nil
172
+ end
173
+ ##
174
+ # Delete the InstalledAddOnInstance
175
+ # @return [Boolean] True if delete succeeds, false otherwise
176
+ def delete
177
+
178
+
179
+ @version.delete('DELETE', @uri)
180
+ end
181
+
182
+ ##
183
+ # Fetch the InstalledAddOnInstance
184
+ # @return [InstalledAddOnInstance] Fetched InstalledAddOnInstance
185
+ def fetch
186
+
187
+
188
+ payload = @version.fetch('GET', @uri)
189
+ InstalledAddOnInstance.new(
190
+ @version,
191
+ payload,
192
+ sid: @solution[:sid],
193
+ )
194
+ end
195
+
196
+ ##
197
+ # Update the InstalledAddOnInstance
198
+ # @param [Object] configuration Valid JSON object that conform to the configuration schema exposed by the associated AvailableAddOn resource. This is only required by Add-ons that need to be configured
199
+ # @param [String] unique_name An application-defined string that uniquely identifies the resource. This value must be unique within the Account.
200
+ # @return [InstalledAddOnInstance] Updated InstalledAddOnInstance
201
+ def update(
202
+ configuration: :unset,
203
+ unique_name: :unset
204
+ )
205
+
206
+ data = Twilio::Values.of({
207
+ 'Configuration' => Twilio.serialize_object(configuration),
208
+ 'UniqueName' => unique_name,
209
+ })
210
+
211
+
212
+ payload = @version.update('POST', @uri, data: data)
213
+ InstalledAddOnInstance.new(
214
+ @version,
215
+ payload,
216
+ sid: @solution[:sid],
217
+ )
218
+ end
219
+
220
+ ##
221
+ # Access the usage
222
+ # @return [InstalledAddOnUsageList]
223
+ # @return [InstalledAddOnUsageContext]
224
+ def usage
225
+ unless @usage
226
+ @usage = InstalledAddOnUsageList.new(
227
+ @version, installed_add_on_sid: @solution[:sid], )
228
+ end
229
+ @usage
230
+ end
231
+ ##
232
+ # Access the extensions
233
+ # @return [InstalledAddOnExtensionList]
234
+ # @return [InstalledAddOnExtensionContext] if sid was passed.
235
+ def extensions(sid=:unset)
236
+
237
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
238
+
239
+ if sid != :unset
240
+ return InstalledAddOnExtensionContext.new(@version, @solution[:sid],sid )
241
+ end
242
+
243
+ unless @extensions
244
+ @extensions = InstalledAddOnExtensionList.new(
245
+ @version, installed_add_on_sid: @solution[:sid], )
246
+ end
247
+
248
+ @extensions
249
+ end
250
+
251
+ ##
252
+ # Provide a user friendly representation
253
+ def to_s
254
+ context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
255
+ "#<Twilio.Marketplace.V1.InstalledAddOnContext #{context}>"
256
+ end
257
+
258
+ ##
259
+ # Provide a detailed, user friendly representation
260
+ def inspect
261
+ context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
262
+ "#<Twilio.Marketplace.V1.InstalledAddOnContext #{context}>"
263
+ end
264
+ end
265
+
266
+ class InstalledAddOnPage < Page
267
+ ##
268
+ # Initialize the InstalledAddOnPage
269
+ # @param [Version] version Version that contains the resource
270
+ # @param [Response] response Response from the API
271
+ # @param [Hash] solution Path solution for the resource
272
+ # @return [InstalledAddOnPage] InstalledAddOnPage
273
+ def initialize(version, response, solution)
274
+ super(version, response)
275
+
276
+ # Path Solution
277
+ @solution = solution
278
+ end
279
+
280
+ ##
281
+ # Build an instance of InstalledAddOnInstance
282
+ # @param [Hash] payload Payload response from the API
283
+ # @return [InstalledAddOnInstance] InstalledAddOnInstance
284
+ def get_instance(payload)
285
+ InstalledAddOnInstance.new(@version, payload)
286
+ end
287
+
288
+ ##
289
+ # Provide a user friendly representation
290
+ def to_s
291
+ '<Twilio.Marketplace.V1.InstalledAddOnPage>'
292
+ end
293
+ end
294
+ class InstalledAddOnInstance < InstanceResource
295
+ ##
296
+ # Initialize the InstalledAddOnInstance
297
+ # @param [Version] version Version that contains the resource
298
+ # @param [Hash] payload payload that contains response from Twilio
299
+ # @param [String] account_sid The SID of the
300
+ # {Account}[https://www.twilio.com/docs/iam/api/account] that created this InstalledAddOn
301
+ # resource.
302
+ # @param [String] sid The SID of the Call resource to fetch.
303
+ # @return [InstalledAddOnInstance] InstalledAddOnInstance
304
+ def initialize(version, payload , sid: nil)
305
+ super(version)
306
+
307
+ # Marshaled Properties
308
+ @properties = {
309
+ 'sid' => payload['sid'],
310
+ 'account_sid' => payload['account_sid'],
311
+ 'friendly_name' => payload['friendly_name'],
312
+ 'description' => payload['description'],
313
+ 'configuration' => payload['configuration'],
314
+ 'unique_name' => payload['unique_name'],
315
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
316
+ 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
317
+ 'url' => payload['url'],
318
+ 'links' => payload['links'],
319
+ }
320
+
321
+ # Context
322
+ @instance_context = nil
323
+ @params = { 'sid' => sid || @properties['sid'] , }
324
+ end
325
+
326
+ ##
327
+ # Generate an instance context for the instance, the context is capable of
328
+ # performing various actions. All instance actions are proxied to the context
329
+ # @return [InstalledAddOnContext] CallContext for this CallInstance
330
+ def context
331
+ unless @instance_context
332
+ @instance_context = InstalledAddOnContext.new(@version , @params['sid'])
333
+ end
334
+ @instance_context
335
+ end
336
+
337
+ ##
338
+ # @return [String] The unique string that we created to identify the InstalledAddOn resource. This Sid can also be found in the Console on that specific Add-ons page as the 'Available Add-on Sid'.
339
+ def sid
340
+ @properties['sid']
341
+ end
342
+
343
+ ##
344
+ # @return [String] The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the InstalledAddOn resource.
345
+ def account_sid
346
+ @properties['account_sid']
347
+ end
348
+
349
+ ##
350
+ # @return [String] The string that you assigned to describe the resource.
351
+ def friendly_name
352
+ @properties['friendly_name']
353
+ end
354
+
355
+ ##
356
+ # @return [String] A short description of the Add-on's functionality.
357
+ def description
358
+ @properties['description']
359
+ end
360
+
361
+ ##
362
+ # @return [Hash] The JSON object that represents the current configuration of installed Add-on.
363
+ def configuration
364
+ @properties['configuration']
365
+ end
366
+
367
+ ##
368
+ # @return [String] An application-defined string that uniquely identifies the resource.
369
+ def unique_name
370
+ @properties['unique_name']
371
+ end
372
+
373
+ ##
374
+ # @return [Time] The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
375
+ def date_created
376
+ @properties['date_created']
377
+ end
378
+
379
+ ##
380
+ # @return [Time] The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
381
+ def date_updated
382
+ @properties['date_updated']
383
+ end
384
+
385
+ ##
386
+ # @return [String] The absolute URL of the resource.
387
+ def url
388
+ @properties['url']
389
+ end
390
+
391
+ ##
392
+ # @return [Hash] The URLs of related resources.
393
+ def links
394
+ @properties['links']
395
+ end
396
+
397
+ ##
398
+ # Delete the InstalledAddOnInstance
399
+ # @return [Boolean] True if delete succeeds, false otherwise
400
+ def delete
401
+
402
+ context.delete
403
+ end
404
+
405
+ ##
406
+ # Fetch the InstalledAddOnInstance
407
+ # @return [InstalledAddOnInstance] Fetched InstalledAddOnInstance
408
+ def fetch
409
+
410
+ context.fetch
411
+ end
412
+
413
+ ##
414
+ # Update the InstalledAddOnInstance
415
+ # @param [Object] configuration Valid JSON object that conform to the configuration schema exposed by the associated AvailableAddOn resource. This is only required by Add-ons that need to be configured
416
+ # @param [String] unique_name An application-defined string that uniquely identifies the resource. This value must be unique within the Account.
417
+ # @return [InstalledAddOnInstance] Updated InstalledAddOnInstance
418
+ def update(
419
+ configuration: :unset,
420
+ unique_name: :unset
421
+ )
422
+
423
+ context.update(
424
+ configuration: configuration,
425
+ unique_name: unique_name,
426
+ )
427
+ end
428
+
429
+ ##
430
+ # Access the usage
431
+ # @return [usage] usage
432
+ def usage
433
+ context.usage
434
+ end
435
+
436
+ ##
437
+ # Access the extensions
438
+ # @return [extensions] extensions
439
+ def extensions
440
+ context.extensions
441
+ end
442
+
443
+ ##
444
+ # Provide a user friendly representation
445
+ def to_s
446
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
447
+ "<Twilio.Marketplace.V1.InstalledAddOnInstance #{values}>"
448
+ end
449
+
450
+ ##
451
+ # Provide a detailed, user friendly representation
452
+ def inspect
453
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
454
+ "<Twilio.Marketplace.V1.InstalledAddOnInstance #{values}>"
455
+ end
456
+ end
457
+
458
+ end
459
+ end
460
+ end
461
+ end