twilio-ruby 7.5.0 → 7.5.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 (26) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +12 -0
  3. data/README.md +2 -2
  4. data/lib/twilio-ruby/rest/accounts/v1/safelist.rb +4 -4
  5. data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +1 -1
  6. data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +1 -1
  7. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +3 -0
  8. data/lib/twilio-ruby/rest/flex_api/v2/flex_user.rb +0 -39
  9. data/lib/twilio-ruby/rest/iam/v1/token.rb +186 -0
  10. data/lib/twilio-ruby/rest/iam/v1.rb +6 -0
  11. data/lib/twilio-ruby/rest/preview_base.rb +0 -5
  12. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +2 -2
  13. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb +2 -2
  14. data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +4 -1
  15. data/lib/twilio-ruby/version.rb +1 -1
  16. metadata +3 -12
  17. data/lib/twilio-ruby/rest/preview/sync/service/document/document_permission.rb +0 -407
  18. data/lib/twilio-ruby/rest/preview/sync/service/document.rb +0 -472
  19. data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb +0 -467
  20. data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb +0 -407
  21. data/lib/twilio-ruby/rest/preview/sync/service/sync_list.rb +0 -444
  22. data/lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_item.rb +0 -470
  23. data/lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_permission.rb +0 -407
  24. data/lib/twilio-ruby/rest/preview/sync/service/sync_map.rb +0 -444
  25. data/lib/twilio-ruby/rest/preview/sync/service.rb +0 -529
  26. data/lib/twilio-ruby/rest/preview/sync.rb +0 -49
@@ -1,470 +0,0 @@
1
- ##
2
- # This code was generated by
3
- # ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
4
- # | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5
- # | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6
- #
7
- # Twilio - Preview
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 Preview < PreviewBase
19
- class Sync < Version
20
- class ServiceContext < InstanceContext
21
- class SyncMapContext < InstanceContext
22
-
23
- class SyncMapItemList < ListResource
24
-
25
- ##
26
- # Initialize the SyncMapItemList
27
- # @param [Version] version Version that contains the resource
28
- # @return [SyncMapItemList] SyncMapItemList
29
- def initialize(version, service_sid: nil, map_sid: nil)
30
- super(version)
31
- # Path Solution
32
- @solution = { service_sid: service_sid, map_sid: map_sid }
33
- @uri = "/Services/#{@solution[:service_sid]}/Maps/#{@solution[:map_sid]}/Items"
34
-
35
- end
36
- ##
37
- # Create the SyncMapItemInstance
38
- # @param [String] key
39
- # @param [Object] data
40
- # @return [SyncMapItemInstance] Created SyncMapItemInstance
41
- def create(
42
- key: nil,
43
- data: nil
44
- )
45
-
46
- data = Twilio::Values.of({
47
- 'Key' => key,
48
- 'Data' => Twilio.serialize_object(data),
49
- })
50
-
51
- headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
52
-
53
-
54
-
55
-
56
-
57
- payload = @version.create('POST', @uri, data: data, headers: headers)
58
- SyncMapItemInstance.new(
59
- @version,
60
- payload,
61
- service_sid: @solution[:service_sid],
62
- map_sid: @solution[:map_sid],
63
- )
64
- end
65
-
66
-
67
- ##
68
- # Lists SyncMapItemInstance records from the API as a list.
69
- # Unlike stream(), this operation is eager and will load `limit` records into
70
- # memory before returning.
71
- # @param [QueryResultOrder] order
72
- # @param [String] from
73
- # @param [QueryFromBoundType] bounds
74
- # @param [Integer] limit Upper limit for the number of records to return. stream()
75
- # guarantees to never return more than limit. Default is no limit
76
- # @param [Integer] page_size Number of records to fetch per request, when
77
- # not set will use the default value of 50 records. If no page_size is defined
78
- # but a limit is defined, stream() will attempt to read the limit with the most
79
- # efficient page size, i.e. min(limit, 1000)
80
- # @return [Array] Array of up to limit results
81
- def list(order: :unset, from: :unset, bounds: :unset, limit: nil, page_size: nil)
82
- self.stream(
83
- order: order,
84
- from: from,
85
- bounds: bounds,
86
- limit: limit,
87
- page_size: page_size
88
- ).entries
89
- end
90
-
91
- ##
92
- # Streams Instance records from the API as an Enumerable.
93
- # This operation lazily loads records as efficiently as possible until the limit
94
- # is reached.
95
- # @param [QueryResultOrder] order
96
- # @param [String] from
97
- # @param [QueryFromBoundType] bounds
98
- # @param [Integer] limit Upper limit for the number of records to return. stream()
99
- # guarantees to never return more than limit. Default is no limit
100
- # @param [Integer] page_size Number of records to fetch per request, when
101
- # not set will use the default value of 50 records. If no page_size is defined
102
- # but a limit is defined, stream() will attempt to read the limit with the most
103
- # efficient page size, i.e. min(limit, 1000)
104
- # @return [Enumerable] Enumerable that will yield up to limit results
105
- def stream(order: :unset, from: :unset, bounds: :unset, limit: nil, page_size: nil)
106
- limits = @version.read_limits(limit, page_size)
107
-
108
- page = self.page(
109
- order: order,
110
- from: from,
111
- bounds: bounds,
112
- page_size: limits[:page_size], )
113
-
114
- @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
115
- end
116
-
117
- ##
118
- # When passed a block, yields SyncMapItemInstance records from the API.
119
- # This operation lazily loads records as efficiently as possible until the limit
120
- # is reached.
121
- def each
122
- limits = @version.read_limits
123
-
124
- page = self.page(page_size: limits[:page_size], )
125
-
126
- @version.stream(page,
127
- limit: limits[:limit],
128
- page_limit: limits[:page_limit]).each {|x| yield x}
129
- end
130
-
131
- ##
132
- # Retrieve a single page of SyncMapItemInstance records from the API.
133
- # Request is executed immediately.
134
- # @param [QueryResultOrder] order
135
- # @param [String] from
136
- # @param [QueryFromBoundType] bounds
137
- # @param [String] page_token PageToken provided by the API
138
- # @param [Integer] page_number Page Number, this value is simply for client state
139
- # @param [Integer] page_size Number of records to return, defaults to 50
140
- # @return [Page] Page of SyncMapItemInstance
141
- def page(order: :unset, from: :unset, bounds: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
142
- params = Twilio::Values.of({
143
- 'Order' => order,
144
- 'From' => from,
145
- 'Bounds' => bounds,
146
- 'PageToken' => page_token,
147
- 'Page' => page_number,
148
- 'PageSize' => page_size,
149
- })
150
- headers = Twilio::Values.of({})
151
-
152
-
153
-
154
- response = @version.page('GET', @uri, params: params, headers: headers)
155
-
156
- SyncMapItemPage.new(@version, response, @solution)
157
- end
158
-
159
- ##
160
- # Retrieve a single page of SyncMapItemInstance records from the API.
161
- # Request is executed immediately.
162
- # @param [String] target_url API-generated URL for the requested results page
163
- # @return [Page] Page of SyncMapItemInstance
164
- def get_page(target_url)
165
- response = @version.domain.request(
166
- 'GET',
167
- target_url
168
- )
169
- SyncMapItemPage.new(@version, response, @solution)
170
- end
171
-
172
-
173
-
174
- # Provide a user friendly representation
175
- def to_s
176
- '#<Twilio.Preview.Sync.SyncMapItemList>'
177
- end
178
- end
179
-
180
-
181
- class SyncMapItemContext < InstanceContext
182
- ##
183
- # Initialize the SyncMapItemContext
184
- # @param [Version] version Version that contains the resource
185
- # @param [String] service_sid
186
- # @param [String] map_sid
187
- # @param [String] key
188
- # @return [SyncMapItemContext] SyncMapItemContext
189
- def initialize(version, service_sid, map_sid, key)
190
- super(version)
191
-
192
- # Path Solution
193
- @solution = { service_sid: service_sid, map_sid: map_sid, key: key, }
194
- @uri = "/Services/#{@solution[:service_sid]}/Maps/#{@solution[:map_sid]}/Items/#{@solution[:key]}"
195
-
196
-
197
- end
198
- ##
199
- # Delete the SyncMapItemInstance
200
- # @param [String] if_match The If-Match HTTP request header
201
- # @return [Boolean] True if delete succeeds, false otherwise
202
- def delete(
203
- if_match: :unset
204
- )
205
-
206
- headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', 'If-Match' => if_match, })
207
-
208
-
209
-
210
- @version.delete('DELETE', @uri, headers: headers)
211
- end
212
-
213
- ##
214
- # Fetch the SyncMapItemInstance
215
- # @return [SyncMapItemInstance] Fetched SyncMapItemInstance
216
- def fetch
217
-
218
- headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
219
-
220
-
221
-
222
-
223
-
224
- payload = @version.fetch('GET', @uri, headers: headers)
225
- SyncMapItemInstance.new(
226
- @version,
227
- payload,
228
- service_sid: @solution[:service_sid],
229
- map_sid: @solution[:map_sid],
230
- key: @solution[:key],
231
- )
232
- end
233
-
234
- ##
235
- # Update the SyncMapItemInstance
236
- # @param [Object] data
237
- # @param [String] if_match The If-Match HTTP request header
238
- # @return [SyncMapItemInstance] Updated SyncMapItemInstance
239
- def update(
240
- data: nil,
241
- if_match: :unset
242
- )
243
-
244
- data = Twilio::Values.of({
245
- 'Data' => Twilio.serialize_object(data),
246
- })
247
-
248
- headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', 'If-Match' => if_match, })
249
-
250
-
251
-
252
-
253
-
254
- payload = @version.update('POST', @uri, data: data, headers: headers)
255
- SyncMapItemInstance.new(
256
- @version,
257
- payload,
258
- service_sid: @solution[:service_sid],
259
- map_sid: @solution[:map_sid],
260
- key: @solution[:key],
261
- )
262
- end
263
-
264
-
265
- ##
266
- # Provide a user friendly representation
267
- def to_s
268
- context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
269
- "#<Twilio.Preview.Sync.SyncMapItemContext #{context}>"
270
- end
271
-
272
- ##
273
- # Provide a detailed, user friendly representation
274
- def inspect
275
- context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
276
- "#<Twilio.Preview.Sync.SyncMapItemContext #{context}>"
277
- end
278
- end
279
-
280
- class SyncMapItemPage < Page
281
- ##
282
- # Initialize the SyncMapItemPage
283
- # @param [Version] version Version that contains the resource
284
- # @param [Response] response Response from the API
285
- # @param [Hash] solution Path solution for the resource
286
- # @return [SyncMapItemPage] SyncMapItemPage
287
- def initialize(version, response, solution)
288
- super(version, response)
289
-
290
- # Path Solution
291
- @solution = solution
292
- end
293
-
294
- ##
295
- # Build an instance of SyncMapItemInstance
296
- # @param [Hash] payload Payload response from the API
297
- # @return [SyncMapItemInstance] SyncMapItemInstance
298
- def get_instance(payload)
299
- SyncMapItemInstance.new(@version, payload, service_sid: @solution[:service_sid], map_sid: @solution[:map_sid])
300
- end
301
-
302
- ##
303
- # Provide a user friendly representation
304
- def to_s
305
- '<Twilio.Preview.Sync.SyncMapItemPage>'
306
- end
307
- end
308
- class SyncMapItemInstance < InstanceResource
309
- ##
310
- # Initialize the SyncMapItemInstance
311
- # @param [Version] version Version that contains the resource
312
- # @param [Hash] payload payload that contains response from Twilio
313
- # @param [String] account_sid The SID of the
314
- # {Account}[https://www.twilio.com/docs/iam/api/account] that created this SyncMapItem
315
- # resource.
316
- # @param [String] sid The SID of the Call resource to fetch.
317
- # @return [SyncMapItemInstance] SyncMapItemInstance
318
- def initialize(version, payload , service_sid: nil, map_sid: nil, key: nil)
319
- super(version)
320
-
321
- # Marshaled Properties
322
- @properties = {
323
- 'key' => payload['key'],
324
- 'account_sid' => payload['account_sid'],
325
- 'service_sid' => payload['service_sid'],
326
- 'map_sid' => payload['map_sid'],
327
- 'url' => payload['url'],
328
- 'revision' => payload['revision'],
329
- 'data' => payload['data'],
330
- 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
331
- 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
332
- 'created_by' => payload['created_by'],
333
- }
334
-
335
- # Context
336
- @instance_context = nil
337
- @params = { 'service_sid' => service_sid || @properties['service_sid'] ,'map_sid' => map_sid || @properties['map_sid'] ,'key' => key || @properties['key'] , }
338
- end
339
-
340
- ##
341
- # Generate an instance context for the instance, the context is capable of
342
- # performing various actions. All instance actions are proxied to the context
343
- # @return [SyncMapItemContext] CallContext for this CallInstance
344
- def context
345
- unless @instance_context
346
- @instance_context = SyncMapItemContext.new(@version , @params['service_sid'], @params['map_sid'], @params['key'])
347
- end
348
- @instance_context
349
- end
350
-
351
- ##
352
- # @return [String]
353
- def key
354
- @properties['key']
355
- end
356
-
357
- ##
358
- # @return [String]
359
- def account_sid
360
- @properties['account_sid']
361
- end
362
-
363
- ##
364
- # @return [String]
365
- def service_sid
366
- @properties['service_sid']
367
- end
368
-
369
- ##
370
- # @return [String]
371
- def map_sid
372
- @properties['map_sid']
373
- end
374
-
375
- ##
376
- # @return [String]
377
- def url
378
- @properties['url']
379
- end
380
-
381
- ##
382
- # @return [String]
383
- def revision
384
- @properties['revision']
385
- end
386
-
387
- ##
388
- # @return [Hash]
389
- def data
390
- @properties['data']
391
- end
392
-
393
- ##
394
- # @return [Time]
395
- def date_created
396
- @properties['date_created']
397
- end
398
-
399
- ##
400
- # @return [Time]
401
- def date_updated
402
- @properties['date_updated']
403
- end
404
-
405
- ##
406
- # @return [String]
407
- def created_by
408
- @properties['created_by']
409
- end
410
-
411
- ##
412
- # Delete the SyncMapItemInstance
413
- # @param [String] if_match The If-Match HTTP request header
414
- # @return [Boolean] True if delete succeeds, false otherwise
415
- def delete(
416
- if_match: :unset
417
- )
418
-
419
- context.delete(
420
- if_match: if_match,
421
- )
422
- end
423
-
424
- ##
425
- # Fetch the SyncMapItemInstance
426
- # @return [SyncMapItemInstance] Fetched SyncMapItemInstance
427
- def fetch
428
-
429
- context.fetch
430
- end
431
-
432
- ##
433
- # Update the SyncMapItemInstance
434
- # @param [Object] data
435
- # @param [String] if_match The If-Match HTTP request header
436
- # @return [SyncMapItemInstance] Updated SyncMapItemInstance
437
- def update(
438
- data: nil,
439
- if_match: :unset
440
- )
441
-
442
- context.update(
443
- data: data,
444
- if_match: if_match,
445
- )
446
- end
447
-
448
- ##
449
- # Provide a user friendly representation
450
- def to_s
451
- values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
452
- "<Twilio.Preview.Sync.SyncMapItemInstance #{values}>"
453
- end
454
-
455
- ##
456
- # Provide a detailed, user friendly representation
457
- def inspect
458
- values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
459
- "<Twilio.Preview.Sync.SyncMapItemInstance #{values}>"
460
- end
461
- end
462
-
463
- end
464
- end
465
- end
466
- end
467
- end
468
- end
469
-
470
-