twilio-ruby 7.0.2 → 7.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +43 -0
  3. data/Gemfile +1 -0
  4. data/README.md +2 -2
  5. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +1 -1
  6. data/lib/twilio-ruby/rest/client.rb +0 -5
  7. data/lib/twilio-ruby/rest/content/v2/content.rb +259 -0
  8. data/lib/twilio-ruby/rest/content/v2/content_and_approvals.rb +252 -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/messaging/v1/service.rb +0 -7
  23. data/lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb +86 -1
  24. data/lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb +126 -2
  25. data/lib/twilio-ruby/rest/numbers/v1/porting_webhook_configuration.rb +148 -0
  26. data/lib/twilio-ruby/rest/numbers/v1/porting_webhook_configuration_delete.rb +167 -0
  27. data/lib/twilio-ruby/rest/numbers/v1/porting_webhook_configuration_fetch.rb +160 -0
  28. data/lib/twilio-ruby/rest/numbers/v1.rb +29 -32
  29. data/lib/twilio-ruby/rest/preview/sync/service/document.rb +1 -1
  30. data/lib/twilio-ruby/rest/preview/sync/service/sync_list.rb +2 -2
  31. data/lib/twilio-ruby/rest/preview/sync/service/sync_map.rb +2 -2
  32. data/lib/twilio-ruby/rest/preview/sync/service.rb +2 -2
  33. data/lib/twilio-ruby/rest/sync/v1/service/document.rb +1 -1
  34. data/lib/twilio-ruby/rest/sync/v1/service/sync_list.rb +2 -2
  35. data/lib/twilio-ruby/rest/sync/v1/service/sync_map.rb +2 -2
  36. data/lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb +1 -1
  37. data/lib/twilio-ruby/rest/sync/v1/service.rb +3 -3
  38. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +33 -4
  39. data/lib/twilio-ruby/rest/trusthub/v1/compliance_tollfree_inquiries.rb +4 -1
  40. data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb +7 -0
  41. data/lib/twilio-ruby/rest/trusthub/v1/trust_products.rb +7 -0
  42. data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +1 -1
  43. data/lib/twilio-ruby/rest/verify/v2/service/verification_check.rb +1 -1
  44. data/lib/twilio-ruby/rest/verify/v2/service.rb +1 -1
  45. data/lib/twilio-ruby/version.rb +1 -1
  46. metadata +14 -9
  47. data/lib/twilio-ruby/rest/numbers/v1/porting_bulk_portability.rb +0 -230
  48. data/lib/twilio-ruby/rest/numbers/v1/porting_port_in_fetch.rb +0 -252
  49. data/lib/twilio-ruby/rest/preview_messaging/v1/broadcast.rb +0 -164
  50. data/lib/twilio-ruby/rest/preview_messaging/v1/message.rb +0 -235
  51. data/lib/twilio-ruby/rest/preview_messaging/v1.rb +0 -46
  52. data/lib/twilio-ruby/rest/preview_messaging.rb +0 -12
  53. data/lib/twilio-ruby/rest/preview_messaging_base.rb +0 -38
@@ -22,16 +22,21 @@ module Twilio
22
22
  @host = "content.twilio.com"
23
23
  @port = 443
24
24
  @v1 = nil
25
+ @v2 = nil
25
26
  end
26
27
 
27
28
  def v1
28
29
  @v1 ||= Content::V1.new self
29
30
  end
30
31
 
32
+ def v2
33
+ @v2 ||= Content::V2.new self
34
+ end
35
+
31
36
  ##
32
37
  # Provide a user friendly representation
33
38
  def to_s
34
- '<Twilio::REST::Content::V1>';
39
+ '<Twilio::REST::Content>';
35
40
  end
36
41
  end
37
42
  end
@@ -38,7 +38,7 @@ module Twilio
38
38
  # @return [InteractionInstance] Created InteractionInstance
39
39
  def create(
40
40
  channel: nil,
41
- routing: nil,
41
+ routing: :unset,
42
42
  interaction_context_sid: :unset
43
43
  )
44
44
 
@@ -273,6 +273,7 @@ module Twilio
273
273
  'changelog' => payload['changelog'],
274
274
  'private' => payload['private'],
275
275
  'archived' => payload['archived'],
276
+ 'validated' => payload['validated'],
276
277
  'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
277
278
  'url' => payload['url'],
278
279
  }
@@ -330,7 +331,7 @@ module Twilio
330
331
  end
331
332
 
332
333
  ##
333
- # @return [Boolean] Whether to inject credentials while accessing this Plugin Version. The default value is false.
334
+ # @return [Boolean] Whether the Flex Plugin Version is validated. The default value is false.
334
335
  def private
335
336
  @properties['private']
336
337
  end
@@ -341,6 +342,12 @@ module Twilio
341
342
  @properties['archived']
342
343
  end
343
344
 
345
+ ##
346
+ # @return [Boolean]
347
+ def validated
348
+ @properties['validated']
349
+ end
350
+
344
351
  ##
345
352
  # @return [Time] The date and time in GMT when the Flex Plugin Version was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
346
353
  def date_created
@@ -0,0 +1,444 @@
1
+ ##
2
+ # This code was generated by
3
+ # ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
4
+ # | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5
+ # | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6
+ #
7
+ # Twilio - Intelligence
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 Intelligence < IntelligenceBase
19
+ class V2 < Version
20
+ class CustomOperatorList < ListResource
21
+
22
+ ##
23
+ # Initialize the CustomOperatorList
24
+ # @param [Version] version Version that contains the resource
25
+ # @return [CustomOperatorList] CustomOperatorList
26
+ def initialize(version)
27
+ super(version)
28
+ # Path Solution
29
+ @solution = { }
30
+ @uri = "/Operators/Custom"
31
+
32
+ end
33
+ ##
34
+ # Create the CustomOperatorInstance
35
+ # @param [String] friendly_name A human readable description of the new Operator, up to 64 characters.
36
+ # @param [String] operator_type Operator Type for this Operator. References an existing Operator Type resource.
37
+ # @param [Object] config Operator configuration, following the schema defined by the Operator Type.
38
+ # @return [CustomOperatorInstance] Created CustomOperatorInstance
39
+ def create(
40
+ friendly_name: nil,
41
+ operator_type: nil,
42
+ config: nil
43
+ )
44
+
45
+ data = Twilio::Values.of({
46
+ 'FriendlyName' => friendly_name,
47
+ 'OperatorType' => operator_type,
48
+ 'Config' => Twilio.serialize_object(config),
49
+ })
50
+
51
+
52
+ payload = @version.create('POST', @uri, data: data)
53
+ CustomOperatorInstance.new(
54
+ @version,
55
+ payload,
56
+ )
57
+ end
58
+
59
+
60
+ ##
61
+ # Lists CustomOperatorInstance 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 [Availability] availability Returns Custom Operators with the provided availability type. Possible values: internal, beta, public, retired.
65
+ # @param [String] language_code Returns Custom Operators that support the provided language code.
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 [Array] Array of up to limit results
73
+ def list(availability: :unset, language_code: :unset, limit: nil, page_size: nil)
74
+ self.stream(
75
+ availability: availability,
76
+ language_code: language_code,
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 [Availability] availability Returns Custom Operators with the provided availability type. Possible values: internal, beta, public, retired.
87
+ # @param [String] language_code Returns Custom Operators that support the provided language code.
88
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
89
+ # guarantees to never return more than limit. Default is no limit
90
+ # @param [Integer] page_size Number of records to fetch per request, when
91
+ # not set will use the default value of 50 records. If no page_size is defined
92
+ # but a limit is defined, stream() will attempt to read the limit with the most
93
+ # efficient page size, i.e. min(limit, 1000)
94
+ # @return [Enumerable] Enumerable that will yield up to limit results
95
+ def stream(availability: :unset, language_code: :unset, limit: nil, page_size: nil)
96
+ limits = @version.read_limits(limit, page_size)
97
+
98
+ page = self.page(
99
+ availability: availability,
100
+ language_code: language_code,
101
+ page_size: limits[:page_size], )
102
+
103
+ @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
104
+ end
105
+
106
+ ##
107
+ # When passed a block, yields CustomOperatorInstance records from the API.
108
+ # This operation lazily loads records as efficiently as possible until the limit
109
+ # is reached.
110
+ def each
111
+ limits = @version.read_limits
112
+
113
+ page = self.page(page_size: limits[:page_size], )
114
+
115
+ @version.stream(page,
116
+ limit: limits[:limit],
117
+ page_limit: limits[:page_limit]).each {|x| yield x}
118
+ end
119
+
120
+ ##
121
+ # Retrieve a single page of CustomOperatorInstance records from the API.
122
+ # Request is executed immediately.
123
+ # @param [Availability] availability Returns Custom Operators with the provided availability type. Possible values: internal, beta, public, retired.
124
+ # @param [String] language_code Returns Custom Operators that support the provided language code.
125
+ # @param [String] page_token PageToken provided by the API
126
+ # @param [Integer] page_number Page Number, this value is simply for client state
127
+ # @param [Integer] page_size Number of records to return, defaults to 50
128
+ # @return [Page] Page of CustomOperatorInstance
129
+ def page(availability: :unset, language_code: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
130
+ params = Twilio::Values.of({
131
+ 'Availability' => availability,
132
+ 'LanguageCode' => language_code,
133
+ 'PageToken' => page_token,
134
+ 'Page' => page_number,
135
+ 'PageSize' => page_size,
136
+ })
137
+
138
+ response = @version.page('GET', @uri, params: params)
139
+
140
+ CustomOperatorPage.new(@version, response, @solution)
141
+ end
142
+
143
+ ##
144
+ # Retrieve a single page of CustomOperatorInstance records from the API.
145
+ # Request is executed immediately.
146
+ # @param [String] target_url API-generated URL for the requested results page
147
+ # @return [Page] Page of CustomOperatorInstance
148
+ def get_page(target_url)
149
+ response = @version.domain.request(
150
+ 'GET',
151
+ target_url
152
+ )
153
+ CustomOperatorPage.new(@version, response, @solution)
154
+ end
155
+
156
+
157
+
158
+ # Provide a user friendly representation
159
+ def to_s
160
+ '#<Twilio.Intelligence.V2.CustomOperatorList>'
161
+ end
162
+ end
163
+
164
+
165
+ class CustomOperatorContext < InstanceContext
166
+ ##
167
+ # Initialize the CustomOperatorContext
168
+ # @param [Version] version Version that contains the resource
169
+ # @param [String] sid A 34 character string that uniquely identifies this Custom Operator.
170
+ # @return [CustomOperatorContext] CustomOperatorContext
171
+ def initialize(version, sid)
172
+ super(version)
173
+
174
+ # Path Solution
175
+ @solution = { sid: sid, }
176
+ @uri = "/Operators/Custom/#{@solution[:sid]}"
177
+
178
+
179
+ end
180
+ ##
181
+ # Delete the CustomOperatorInstance
182
+ # @return [Boolean] True if delete succeeds, false otherwise
183
+ def delete
184
+
185
+
186
+ @version.delete('DELETE', @uri)
187
+ end
188
+
189
+ ##
190
+ # Fetch the CustomOperatorInstance
191
+ # @return [CustomOperatorInstance] Fetched CustomOperatorInstance
192
+ def fetch
193
+
194
+
195
+ payload = @version.fetch('GET', @uri)
196
+ CustomOperatorInstance.new(
197
+ @version,
198
+ payload,
199
+ sid: @solution[:sid],
200
+ )
201
+ end
202
+
203
+ ##
204
+ # Update the CustomOperatorInstance
205
+ # @param [String] friendly_name A human-readable name of this resource, up to 64 characters.
206
+ # @param [Object] config Operator configuration, following the schema defined by the Operator Type.
207
+ # @param [String] if_match The If-Match HTTP request header
208
+ # @return [CustomOperatorInstance] Updated CustomOperatorInstance
209
+ def update(
210
+ friendly_name: nil,
211
+ config: nil,
212
+ if_match: :unset
213
+ )
214
+
215
+ data = Twilio::Values.of({
216
+ 'FriendlyName' => friendly_name,
217
+ 'Config' => Twilio.serialize_object(config),
218
+ })
219
+
220
+
221
+ headers = Twilio::Values.of({ 'If-Match' => if_match, })
222
+ payload = @version.update('POST', @uri, data: data, headers: headers)
223
+ CustomOperatorInstance.new(
224
+ @version,
225
+ payload,
226
+ sid: @solution[:sid],
227
+ )
228
+ end
229
+
230
+
231
+ ##
232
+ # Provide a user friendly representation
233
+ def to_s
234
+ context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
235
+ "#<Twilio.Intelligence.V2.CustomOperatorContext #{context}>"
236
+ end
237
+
238
+ ##
239
+ # Provide a detailed, user friendly representation
240
+ def inspect
241
+ context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
242
+ "#<Twilio.Intelligence.V2.CustomOperatorContext #{context}>"
243
+ end
244
+ end
245
+
246
+ class CustomOperatorPage < Page
247
+ ##
248
+ # Initialize the CustomOperatorPage
249
+ # @param [Version] version Version that contains the resource
250
+ # @param [Response] response Response from the API
251
+ # @param [Hash] solution Path solution for the resource
252
+ # @return [CustomOperatorPage] CustomOperatorPage
253
+ def initialize(version, response, solution)
254
+ super(version, response)
255
+
256
+ # Path Solution
257
+ @solution = solution
258
+ end
259
+
260
+ ##
261
+ # Build an instance of CustomOperatorInstance
262
+ # @param [Hash] payload Payload response from the API
263
+ # @return [CustomOperatorInstance] CustomOperatorInstance
264
+ def get_instance(payload)
265
+ CustomOperatorInstance.new(@version, payload)
266
+ end
267
+
268
+ ##
269
+ # Provide a user friendly representation
270
+ def to_s
271
+ '<Twilio.Intelligence.V2.CustomOperatorPage>'
272
+ end
273
+ end
274
+ class CustomOperatorInstance < InstanceResource
275
+ ##
276
+ # Initialize the CustomOperatorInstance
277
+ # @param [Version] version Version that contains the resource
278
+ # @param [Hash] payload payload that contains response from Twilio
279
+ # @param [String] account_sid The SID of the
280
+ # {Account}[https://www.twilio.com/docs/iam/api/account] that created this CustomOperator
281
+ # resource.
282
+ # @param [String] sid The SID of the Call resource to fetch.
283
+ # @return [CustomOperatorInstance] CustomOperatorInstance
284
+ def initialize(version, payload , sid: nil)
285
+ super(version)
286
+
287
+ # Marshaled Properties
288
+ @properties = {
289
+ 'account_sid' => payload['account_sid'],
290
+ 'sid' => payload['sid'],
291
+ 'friendly_name' => payload['friendly_name'],
292
+ 'description' => payload['description'],
293
+ 'author' => payload['author'],
294
+ 'operator_type' => payload['operator_type'],
295
+ 'version' => payload['version'] == nil ? payload['version'] : payload['version'].to_i,
296
+ 'availability' => payload['availability'],
297
+ 'config' => payload['config'],
298
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
299
+ 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
300
+ 'url' => payload['url'],
301
+ }
302
+
303
+ # Context
304
+ @instance_context = nil
305
+ @params = { 'sid' => sid || @properties['sid'] , }
306
+ end
307
+
308
+ ##
309
+ # Generate an instance context for the instance, the context is capable of
310
+ # performing various actions. All instance actions are proxied to the context
311
+ # @return [CustomOperatorContext] CallContext for this CallInstance
312
+ def context
313
+ unless @instance_context
314
+ @instance_context = CustomOperatorContext.new(@version , @params['sid'])
315
+ end
316
+ @instance_context
317
+ end
318
+
319
+ ##
320
+ # @return [String] The unique SID identifier of the Account the Custom Operator belongs to.
321
+ def account_sid
322
+ @properties['account_sid']
323
+ end
324
+
325
+ ##
326
+ # @return [String] A 34 character string that uniquely identifies this Custom Operator.
327
+ def sid
328
+ @properties['sid']
329
+ end
330
+
331
+ ##
332
+ # @return [String] A human-readable name of this resource, up to 64 characters.
333
+ def friendly_name
334
+ @properties['friendly_name']
335
+ end
336
+
337
+ ##
338
+ # @return [String] A human-readable description of this resource, longer than the friendly name.
339
+ def description
340
+ @properties['description']
341
+ end
342
+
343
+ ##
344
+ # @return [String] The creator of the Custom Operator. Custom Operators can only be created by a Twilio Account.
345
+ def author
346
+ @properties['author']
347
+ end
348
+
349
+ ##
350
+ # @return [String] Operator Type for this Operator. References an existing Operator Type resource.
351
+ def operator_type
352
+ @properties['operator_type']
353
+ end
354
+
355
+ ##
356
+ # @return [String] Numeric Custom Operator version. Incremented with each update on the resource, used to ensure integrity when updating the Custom Operator.
357
+ def version
358
+ @properties['version']
359
+ end
360
+
361
+ ##
362
+ # @return [Availability]
363
+ def availability
364
+ @properties['availability']
365
+ end
366
+
367
+ ##
368
+ # @return [Hash] Operator configuration, following the schema defined by the Operator Type. Only available on Operators created by the Account.
369
+ def config
370
+ @properties['config']
371
+ end
372
+
373
+ ##
374
+ # @return [Time] The date that this Custom Operator was created, given in ISO 8601 format.
375
+ def date_created
376
+ @properties['date_created']
377
+ end
378
+
379
+ ##
380
+ # @return [Time] The date that this Custom Operator was updated, given in ISO 8601 format.
381
+ def date_updated
382
+ @properties['date_updated']
383
+ end
384
+
385
+ ##
386
+ # @return [String] The URL of this resource.
387
+ def url
388
+ @properties['url']
389
+ end
390
+
391
+ ##
392
+ # Delete the CustomOperatorInstance
393
+ # @return [Boolean] True if delete succeeds, false otherwise
394
+ def delete
395
+
396
+ context.delete
397
+ end
398
+
399
+ ##
400
+ # Fetch the CustomOperatorInstance
401
+ # @return [CustomOperatorInstance] Fetched CustomOperatorInstance
402
+ def fetch
403
+
404
+ context.fetch
405
+ end
406
+
407
+ ##
408
+ # Update the CustomOperatorInstance
409
+ # @param [String] friendly_name A human-readable name of this resource, up to 64 characters.
410
+ # @param [Object] config Operator configuration, following the schema defined by the Operator Type.
411
+ # @param [String] if_match The If-Match HTTP request header
412
+ # @return [CustomOperatorInstance] Updated CustomOperatorInstance
413
+ def update(
414
+ friendly_name: nil,
415
+ config: nil,
416
+ if_match: :unset
417
+ )
418
+
419
+ context.update(
420
+ friendly_name: friendly_name,
421
+ config: config,
422
+ if_match: if_match,
423
+ )
424
+ end
425
+
426
+ ##
427
+ # Provide a user friendly representation
428
+ def to_s
429
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
430
+ "<Twilio.Intelligence.V2.CustomOperatorInstance #{values}>"
431
+ end
432
+
433
+ ##
434
+ # Provide a detailed, user friendly representation
435
+ def inspect
436
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
437
+ "<Twilio.Intelligence.V2.CustomOperatorInstance #{values}>"
438
+ end
439
+ end
440
+
441
+ end
442
+ end
443
+ end
444
+ end