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