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