twilio-ruby 5.63.0 → 5.63.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/.github/workflows/test-and-deploy.yml +25 -1
- data/.rubocop.yml +1 -1
- data/.rubocop_todo.yml +84 -21
- data/CHANGES.md +21 -0
- data/Makefile +1 -4
- data/README.md +2 -2
- data/lib/rack/twilio_webhook_authentication.rb +25 -1
- data/lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb +33 -18
- data/lib/twilio-ruby/rest/insights/v1/conference/conference_participant.rb +483 -0
- data/lib/twilio-ruby/rest/insights/v1/conference.rb +484 -0
- data/lib/twilio-ruby/rest/insights/v1.rb +16 -0
- data/lib/twilio-ruby/rest/insights.rb +8 -0
- data/lib/twilio-ruby/rest/messaging/v1/brand_registration.rb +7 -0
- data/lib/twilio-ruby/rest/supersim/v1/esim_profile.rb +372 -0
- data/lib/twilio-ruby/rest/supersim/v1.rb +16 -0
- data/lib/twilio-ruby/rest/supersim.rb +9 -0
- data/lib/twilio-ruby/rest/verify/v2/service/access_token.rb +130 -8
- data/lib/twilio-ruby/rest/verify/v2/service.rb +8 -2
- data/lib/twilio-ruby/version.rb +1 -1
- data/sonar-project.properties +1 -1
- data/twilio-ruby.gemspec +0 -1
- metadata +5 -16
@@ -0,0 +1,372 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# \ / _ _ _| _ _
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
5
|
+
# / /
|
6
|
+
#
|
7
|
+
# frozen_string_literal: true
|
8
|
+
|
9
|
+
module Twilio
|
10
|
+
module REST
|
11
|
+
class Supersim < Domain
|
12
|
+
class V1 < Version
|
13
|
+
##
|
14
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
15
|
+
class EsimProfileList < ListResource
|
16
|
+
##
|
17
|
+
# Initialize the EsimProfileList
|
18
|
+
# @param [Version] version Version that contains the resource
|
19
|
+
# @return [EsimProfileList] EsimProfileList
|
20
|
+
def initialize(version)
|
21
|
+
super(version)
|
22
|
+
|
23
|
+
# Path Solution
|
24
|
+
@solution = {}
|
25
|
+
@uri = "/ESimProfiles"
|
26
|
+
end
|
27
|
+
|
28
|
+
##
|
29
|
+
# Create the EsimProfileInstance
|
30
|
+
# @param [String] eid Identifier of the eUICC that will claim the eSIM Profile.
|
31
|
+
# @param [String] callback_url The URL we should call using the `callback_method`
|
32
|
+
# when the status of the eSIM Profile changes. At this stage of the eSIM Profile
|
33
|
+
# pilot, the a request to the URL will only be called when the ESimProfile
|
34
|
+
# resource changes from `reserving` to `available`.
|
35
|
+
# @param [String] callback_method The HTTP method we should use to call
|
36
|
+
# `callback_url`. Can be: `GET` or `POST` and the default is POST.
|
37
|
+
# @return [EsimProfileInstance] Created EsimProfileInstance
|
38
|
+
def create(eid: nil, callback_url: :unset, callback_method: :unset)
|
39
|
+
data = Twilio::Values.of({
|
40
|
+
'Eid' => eid,
|
41
|
+
'CallbackUrl' => callback_url,
|
42
|
+
'CallbackMethod' => callback_method,
|
43
|
+
})
|
44
|
+
|
45
|
+
payload = @version.create('POST', @uri, data: data)
|
46
|
+
|
47
|
+
EsimProfileInstance.new(@version, payload, )
|
48
|
+
end
|
49
|
+
|
50
|
+
##
|
51
|
+
# Lists EsimProfileInstance records from the API as a list.
|
52
|
+
# Unlike stream(), this operation is eager and will load `limit` records into
|
53
|
+
# memory before returning.
|
54
|
+
# @param [String] eid List the eSIM Profiles that have been associated with an
|
55
|
+
# EId.
|
56
|
+
# @param [String] sim_sid Find the eSIM Profile resource related to a
|
57
|
+
# {Sim}[https://www.twilio.com/docs/wireless/api/sim-resource] resource by
|
58
|
+
# providing the SIM SID. Will always return an array with either 1 or 0 records.
|
59
|
+
# @param [esim_profile.Status] status List the eSIM Profiles that are in a given
|
60
|
+
# status.
|
61
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
62
|
+
# guarantees to never return more than limit. Default is no limit
|
63
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
64
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
65
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
66
|
+
# efficient page size, i.e. min(limit, 1000)
|
67
|
+
# @return [Array] Array of up to limit results
|
68
|
+
def list(eid: :unset, sim_sid: :unset, status: :unset, limit: nil, page_size: nil)
|
69
|
+
self.stream(eid: eid, sim_sid: sim_sid, status: status, limit: limit, page_size: page_size).entries
|
70
|
+
end
|
71
|
+
|
72
|
+
##
|
73
|
+
# Streams EsimProfileInstance records from the API as an Enumerable.
|
74
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
75
|
+
# is reached.
|
76
|
+
# @param [String] eid List the eSIM Profiles that have been associated with an
|
77
|
+
# EId.
|
78
|
+
# @param [String] sim_sid Find the eSIM Profile resource related to a
|
79
|
+
# {Sim}[https://www.twilio.com/docs/wireless/api/sim-resource] resource by
|
80
|
+
# providing the SIM SID. Will always return an array with either 1 or 0 records.
|
81
|
+
# @param [esim_profile.Status] status List the eSIM Profiles that are in a given
|
82
|
+
# status.
|
83
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
84
|
+
# guarantees to never return more than limit. Default is no limit.
|
85
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
86
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
87
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
88
|
+
# efficient page size, i.e. min(limit, 1000)
|
89
|
+
# @return [Enumerable] Enumerable that will yield up to limit results
|
90
|
+
def stream(eid: :unset, sim_sid: :unset, status: :unset, limit: nil, page_size: nil)
|
91
|
+
limits = @version.read_limits(limit, page_size)
|
92
|
+
|
93
|
+
page = self.page(eid: eid, sim_sid: sim_sid, status: status, page_size: limits[:page_size], )
|
94
|
+
|
95
|
+
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
96
|
+
end
|
97
|
+
|
98
|
+
##
|
99
|
+
# When passed a block, yields EsimProfileInstance records from the API.
|
100
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
101
|
+
# is reached.
|
102
|
+
def each
|
103
|
+
limits = @version.read_limits
|
104
|
+
|
105
|
+
page = self.page(page_size: limits[:page_size], )
|
106
|
+
|
107
|
+
@version.stream(page,
|
108
|
+
limit: limits[:limit],
|
109
|
+
page_limit: limits[:page_limit]).each {|x| yield x}
|
110
|
+
end
|
111
|
+
|
112
|
+
##
|
113
|
+
# Retrieve a single page of EsimProfileInstance records from the API.
|
114
|
+
# Request is executed immediately.
|
115
|
+
# @param [String] eid List the eSIM Profiles that have been associated with an
|
116
|
+
# EId.
|
117
|
+
# @param [String] sim_sid Find the eSIM Profile resource related to a
|
118
|
+
# {Sim}[https://www.twilio.com/docs/wireless/api/sim-resource] resource by
|
119
|
+
# providing the SIM SID. Will always return an array with either 1 or 0 records.
|
120
|
+
# @param [esim_profile.Status] status List the eSIM Profiles that are in a given
|
121
|
+
# status.
|
122
|
+
# @param [String] page_token PageToken provided by the API
|
123
|
+
# @param [Integer] page_number Page Number, this value is simply for client state
|
124
|
+
# @param [Integer] page_size Number of records to return, defaults to 50
|
125
|
+
# @return [Page] Page of EsimProfileInstance
|
126
|
+
def page(eid: :unset, sim_sid: :unset, status: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
|
127
|
+
params = Twilio::Values.of({
|
128
|
+
'Eid' => eid,
|
129
|
+
'SimSid' => sim_sid,
|
130
|
+
'Status' => status,
|
131
|
+
'PageToken' => page_token,
|
132
|
+
'Page' => page_number,
|
133
|
+
'PageSize' => page_size,
|
134
|
+
})
|
135
|
+
|
136
|
+
response = @version.page('GET', @uri, params: params)
|
137
|
+
|
138
|
+
EsimProfilePage.new(@version, response, @solution)
|
139
|
+
end
|
140
|
+
|
141
|
+
##
|
142
|
+
# Retrieve a single page of EsimProfileInstance records from the API.
|
143
|
+
# Request is executed immediately.
|
144
|
+
# @param [String] target_url API-generated URL for the requested results page
|
145
|
+
# @return [Page] Page of EsimProfileInstance
|
146
|
+
def get_page(target_url)
|
147
|
+
response = @version.domain.request(
|
148
|
+
'GET',
|
149
|
+
target_url
|
150
|
+
)
|
151
|
+
EsimProfilePage.new(@version, response, @solution)
|
152
|
+
end
|
153
|
+
|
154
|
+
##
|
155
|
+
# Provide a user friendly representation
|
156
|
+
def to_s
|
157
|
+
'#<Twilio.Supersim.V1.EsimProfileList>'
|
158
|
+
end
|
159
|
+
end
|
160
|
+
|
161
|
+
##
|
162
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
163
|
+
class EsimProfilePage < Page
|
164
|
+
##
|
165
|
+
# Initialize the EsimProfilePage
|
166
|
+
# @param [Version] version Version that contains the resource
|
167
|
+
# @param [Response] response Response from the API
|
168
|
+
# @param [Hash] solution Path solution for the resource
|
169
|
+
# @return [EsimProfilePage] EsimProfilePage
|
170
|
+
def initialize(version, response, solution)
|
171
|
+
super(version, response)
|
172
|
+
|
173
|
+
# Path Solution
|
174
|
+
@solution = solution
|
175
|
+
end
|
176
|
+
|
177
|
+
##
|
178
|
+
# Build an instance of EsimProfileInstance
|
179
|
+
# @param [Hash] payload Payload response from the API
|
180
|
+
# @return [EsimProfileInstance] EsimProfileInstance
|
181
|
+
def get_instance(payload)
|
182
|
+
EsimProfileInstance.new(@version, payload, )
|
183
|
+
end
|
184
|
+
|
185
|
+
##
|
186
|
+
# Provide a user friendly representation
|
187
|
+
def to_s
|
188
|
+
'<Twilio.Supersim.V1.EsimProfilePage>'
|
189
|
+
end
|
190
|
+
end
|
191
|
+
|
192
|
+
##
|
193
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
194
|
+
class EsimProfileContext < InstanceContext
|
195
|
+
##
|
196
|
+
# Initialize the EsimProfileContext
|
197
|
+
# @param [Version] version Version that contains the resource
|
198
|
+
# @param [String] sid The SID of the eSIM Profile resource to fetch.
|
199
|
+
# @return [EsimProfileContext] EsimProfileContext
|
200
|
+
def initialize(version, sid)
|
201
|
+
super(version)
|
202
|
+
|
203
|
+
# Path Solution
|
204
|
+
@solution = {sid: sid, }
|
205
|
+
@uri = "/ESimProfiles/#{@solution[:sid]}"
|
206
|
+
end
|
207
|
+
|
208
|
+
##
|
209
|
+
# Fetch the EsimProfileInstance
|
210
|
+
# @return [EsimProfileInstance] Fetched EsimProfileInstance
|
211
|
+
def fetch
|
212
|
+
payload = @version.fetch('GET', @uri)
|
213
|
+
|
214
|
+
EsimProfileInstance.new(@version, payload, sid: @solution[:sid], )
|
215
|
+
end
|
216
|
+
|
217
|
+
##
|
218
|
+
# Provide a user friendly representation
|
219
|
+
def to_s
|
220
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
221
|
+
"#<Twilio.Supersim.V1.EsimProfileContext #{context}>"
|
222
|
+
end
|
223
|
+
|
224
|
+
##
|
225
|
+
# Provide a detailed, user friendly representation
|
226
|
+
def inspect
|
227
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
228
|
+
"#<Twilio.Supersim.V1.EsimProfileContext #{context}>"
|
229
|
+
end
|
230
|
+
end
|
231
|
+
|
232
|
+
##
|
233
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
234
|
+
class EsimProfileInstance < InstanceResource
|
235
|
+
##
|
236
|
+
# Initialize the EsimProfileInstance
|
237
|
+
# @param [Version] version Version that contains the resource
|
238
|
+
# @param [Hash] payload payload that contains response from Twilio
|
239
|
+
# @param [String] sid The SID of the eSIM Profile resource to fetch.
|
240
|
+
# @return [EsimProfileInstance] EsimProfileInstance
|
241
|
+
def initialize(version, payload, sid: nil)
|
242
|
+
super(version)
|
243
|
+
|
244
|
+
# Marshaled Properties
|
245
|
+
@properties = {
|
246
|
+
'sid' => payload['sid'],
|
247
|
+
'account_sid' => payload['account_sid'],
|
248
|
+
'iccid' => payload['iccid'],
|
249
|
+
'sim_sid' => payload['sim_sid'],
|
250
|
+
'status' => payload['status'],
|
251
|
+
'eid' => payload['eid'],
|
252
|
+
'smdp_plus_address' => payload['smdp_plus_address'],
|
253
|
+
'error_code' => payload['error_code'],
|
254
|
+
'error_message' => payload['error_message'],
|
255
|
+
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
256
|
+
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
257
|
+
'url' => payload['url'],
|
258
|
+
}
|
259
|
+
|
260
|
+
# Context
|
261
|
+
@instance_context = nil
|
262
|
+
@params = {'sid' => sid || @properties['sid'], }
|
263
|
+
end
|
264
|
+
|
265
|
+
##
|
266
|
+
# Generate an instance context for the instance, the context is capable of
|
267
|
+
# performing various actions. All instance actions are proxied to the context
|
268
|
+
# @return [EsimProfileContext] EsimProfileContext for this EsimProfileInstance
|
269
|
+
def context
|
270
|
+
unless @instance_context
|
271
|
+
@instance_context = EsimProfileContext.new(@version, @params['sid'], )
|
272
|
+
end
|
273
|
+
@instance_context
|
274
|
+
end
|
275
|
+
|
276
|
+
##
|
277
|
+
# @return [String] The unique string that identifies the resource
|
278
|
+
def sid
|
279
|
+
@properties['sid']
|
280
|
+
end
|
281
|
+
|
282
|
+
##
|
283
|
+
# @return [String] The SID of the Account to which the eSIM Profile resource belongs
|
284
|
+
def account_sid
|
285
|
+
@properties['account_sid']
|
286
|
+
end
|
287
|
+
|
288
|
+
##
|
289
|
+
# @return [String] The ICCID associated with the Sim resource
|
290
|
+
def iccid
|
291
|
+
@properties['iccid']
|
292
|
+
end
|
293
|
+
|
294
|
+
##
|
295
|
+
# @return [String] The SID of the Sim resource that this eSIM Profile controls
|
296
|
+
def sim_sid
|
297
|
+
@properties['sim_sid']
|
298
|
+
end
|
299
|
+
|
300
|
+
##
|
301
|
+
# @return [esim_profile.Status] The status of the eSIM Profile
|
302
|
+
def status
|
303
|
+
@properties['status']
|
304
|
+
end
|
305
|
+
|
306
|
+
##
|
307
|
+
# @return [String] Identifier of the eUICC that can claim the eSIM Profile
|
308
|
+
def eid
|
309
|
+
@properties['eid']
|
310
|
+
end
|
311
|
+
|
312
|
+
##
|
313
|
+
# @return [String] Address of the SM-DP+ server from which the Profile will be downloaded
|
314
|
+
def smdp_plus_address
|
315
|
+
@properties['smdp_plus_address']
|
316
|
+
end
|
317
|
+
|
318
|
+
##
|
319
|
+
# @return [String] Code indicating the failure if the download of the SIM Profile failed and the eSIM Profile is in `failed` state
|
320
|
+
def error_code
|
321
|
+
@properties['error_code']
|
322
|
+
end
|
323
|
+
|
324
|
+
##
|
325
|
+
# @return [String] Error message describing the failure if the download of the SIM Profile failed and the eSIM Profile is in `failed` state
|
326
|
+
def error_message
|
327
|
+
@properties['error_message']
|
328
|
+
end
|
329
|
+
|
330
|
+
##
|
331
|
+
# @return [Time] The ISO 8601 date and time in GMT when the resource was created
|
332
|
+
def date_created
|
333
|
+
@properties['date_created']
|
334
|
+
end
|
335
|
+
|
336
|
+
##
|
337
|
+
# @return [Time] The ISO 8601 date and time in GMT when the resource was last updated
|
338
|
+
def date_updated
|
339
|
+
@properties['date_updated']
|
340
|
+
end
|
341
|
+
|
342
|
+
##
|
343
|
+
# @return [String] The absolute URL of the eSIM Profile resource
|
344
|
+
def url
|
345
|
+
@properties['url']
|
346
|
+
end
|
347
|
+
|
348
|
+
##
|
349
|
+
# Fetch the EsimProfileInstance
|
350
|
+
# @return [EsimProfileInstance] Fetched EsimProfileInstance
|
351
|
+
def fetch
|
352
|
+
context.fetch
|
353
|
+
end
|
354
|
+
|
355
|
+
##
|
356
|
+
# Provide a user friendly representation
|
357
|
+
def to_s
|
358
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
359
|
+
"<Twilio.Supersim.V1.EsimProfileInstance #{values}>"
|
360
|
+
end
|
361
|
+
|
362
|
+
##
|
363
|
+
# Provide a detailed, user friendly representation
|
364
|
+
def inspect
|
365
|
+
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
366
|
+
"<Twilio.Supersim.V1.EsimProfileInstance #{values}>"
|
367
|
+
end
|
368
|
+
end
|
369
|
+
end
|
370
|
+
end
|
371
|
+
end
|
372
|
+
end
|
@@ -16,6 +16,7 @@ module Twilio
|
|
16
16
|
super
|
17
17
|
@version = 'v1'
|
18
18
|
@commands = nil
|
19
|
+
@esim_profiles = nil
|
19
20
|
@fleets = nil
|
20
21
|
@ip_commands = nil
|
21
22
|
@networks = nil
|
@@ -40,6 +41,21 @@ module Twilio
|
|
40
41
|
end
|
41
42
|
end
|
42
43
|
|
44
|
+
##
|
45
|
+
# @param [String] sid The SID of the eSIM Profile resource to fetch.
|
46
|
+
# @return [Twilio::REST::Supersim::V1::EsimProfileContext] if sid was passed.
|
47
|
+
# @return [Twilio::REST::Supersim::V1::EsimProfileList]
|
48
|
+
def esim_profiles(sid=:unset)
|
49
|
+
if sid.nil?
|
50
|
+
raise ArgumentError, 'sid cannot be nil'
|
51
|
+
end
|
52
|
+
if sid == :unset
|
53
|
+
@esim_profiles ||= EsimProfileList.new self
|
54
|
+
else
|
55
|
+
EsimProfileContext.new(self, sid)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
43
59
|
##
|
44
60
|
# @param [String] sid The SID of the Fleet resource to fetch.
|
45
61
|
# @return [Twilio::REST::Supersim::V1::FleetContext] if sid was passed.
|
@@ -37,6 +37,15 @@ module Twilio
|
|
37
37
|
self.v1.commands(sid)
|
38
38
|
end
|
39
39
|
|
40
|
+
##
|
41
|
+
# @param [String] sid The unique string that we created to identify the eSIM
|
42
|
+
# Profile resource.
|
43
|
+
# @return [Twilio::REST::Supersim::V1::EsimProfileInstance] if sid was passed.
|
44
|
+
# @return [Twilio::REST::Supersim::V1::EsimProfileList]
|
45
|
+
def esim_profiles(sid=:unset)
|
46
|
+
self.v1.esim_profiles(sid)
|
47
|
+
end
|
48
|
+
|
40
49
|
##
|
41
50
|
# @param [String] sid The unique string that we created to identify the Fleet
|
42
51
|
# resource.
|
@@ -17,8 +17,7 @@ module Twilio
|
|
17
17
|
##
|
18
18
|
# Initialize the AccessTokenList
|
19
19
|
# @param [Version] version Version that contains the resource
|
20
|
-
# @param [String] service_sid The unique
|
21
|
-
# Service resource.
|
20
|
+
# @param [String] service_sid The unique SID identifier of the Verify Service.
|
22
21
|
# @return [AccessTokenList] AccessTokenList
|
23
22
|
def initialize(version, service_sid: nil)
|
24
23
|
super(version)
|
@@ -88,6 +87,53 @@ module Twilio
|
|
88
87
|
end
|
89
88
|
end
|
90
89
|
|
90
|
+
##
|
91
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
92
|
+
class AccessTokenContext < InstanceContext
|
93
|
+
##
|
94
|
+
# Initialize the AccessTokenContext
|
95
|
+
# @param [Version] version Version that contains the resource
|
96
|
+
# @param [String] service_sid The unique SID identifier of the Service.
|
97
|
+
# @param [String] sid A 34 character string that uniquely identifies this Access
|
98
|
+
# Token.
|
99
|
+
# @return [AccessTokenContext] AccessTokenContext
|
100
|
+
def initialize(version, service_sid, sid)
|
101
|
+
super(version)
|
102
|
+
|
103
|
+
# Path Solution
|
104
|
+
@solution = {service_sid: service_sid, sid: sid, }
|
105
|
+
@uri = "/Services/#{@solution[:service_sid]}/AccessTokens/#{@solution[:sid]}"
|
106
|
+
end
|
107
|
+
|
108
|
+
##
|
109
|
+
# Fetch the AccessTokenInstance
|
110
|
+
# @return [AccessTokenInstance] Fetched AccessTokenInstance
|
111
|
+
def fetch
|
112
|
+
payload = @version.fetch('GET', @uri)
|
113
|
+
|
114
|
+
AccessTokenInstance.new(
|
115
|
+
@version,
|
116
|
+
payload,
|
117
|
+
service_sid: @solution[:service_sid],
|
118
|
+
sid: @solution[:sid],
|
119
|
+
)
|
120
|
+
end
|
121
|
+
|
122
|
+
##
|
123
|
+
# Provide a user friendly representation
|
124
|
+
def to_s
|
125
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
126
|
+
"#<Twilio.Verify.V2.AccessTokenContext #{context}>"
|
127
|
+
end
|
128
|
+
|
129
|
+
##
|
130
|
+
# Provide a detailed, user friendly representation
|
131
|
+
def inspect
|
132
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
133
|
+
"#<Twilio.Verify.V2.AccessTokenContext #{context}>"
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
91
137
|
##
|
92
138
|
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
93
139
|
class AccessTokenInstance < InstanceResource
|
@@ -95,14 +141,75 @@ module Twilio
|
|
95
141
|
# Initialize the AccessTokenInstance
|
96
142
|
# @param [Version] version Version that contains the resource
|
97
143
|
# @param [Hash] payload payload that contains response from Twilio
|
98
|
-
# @param [String] service_sid The unique
|
99
|
-
#
|
144
|
+
# @param [String] service_sid The unique SID identifier of the Verify Service.
|
145
|
+
# @param [String] sid A 34 character string that uniquely identifies this Access
|
146
|
+
# Token.
|
100
147
|
# @return [AccessTokenInstance] AccessTokenInstance
|
101
|
-
def initialize(version, payload, service_sid: nil)
|
148
|
+
def initialize(version, payload, service_sid: nil, sid: nil)
|
102
149
|
super(version)
|
103
150
|
|
104
151
|
# Marshaled Properties
|
105
|
-
@properties = {
|
152
|
+
@properties = {
|
153
|
+
'sid' => payload['sid'],
|
154
|
+
'account_sid' => payload['account_sid'],
|
155
|
+
'service_sid' => payload['service_sid'],
|
156
|
+
'entity_identity' => payload['entity_identity'],
|
157
|
+
'factor_type' => payload['factor_type'],
|
158
|
+
'factor_friendly_name' => payload['factor_friendly_name'],
|
159
|
+
'token' => payload['token'],
|
160
|
+
'url' => payload['url'],
|
161
|
+
}
|
162
|
+
|
163
|
+
# Context
|
164
|
+
@instance_context = nil
|
165
|
+
@params = {'service_sid' => service_sid, 'sid' => sid || @properties['sid'], }
|
166
|
+
end
|
167
|
+
|
168
|
+
##
|
169
|
+
# Generate an instance context for the instance, the context is capable of
|
170
|
+
# performing various actions. All instance actions are proxied to the context
|
171
|
+
# @return [AccessTokenContext] AccessTokenContext for this AccessTokenInstance
|
172
|
+
def context
|
173
|
+
unless @instance_context
|
174
|
+
@instance_context = AccessTokenContext.new(@version, @params['service_sid'], @params['sid'], )
|
175
|
+
end
|
176
|
+
@instance_context
|
177
|
+
end
|
178
|
+
|
179
|
+
##
|
180
|
+
# @return [String] A string that uniquely identifies this Access Token.
|
181
|
+
def sid
|
182
|
+
@properties['sid']
|
183
|
+
end
|
184
|
+
|
185
|
+
##
|
186
|
+
# @return [String] Account Sid.
|
187
|
+
def account_sid
|
188
|
+
@properties['account_sid']
|
189
|
+
end
|
190
|
+
|
191
|
+
##
|
192
|
+
# @return [String] Verify Service Sid.
|
193
|
+
def service_sid
|
194
|
+
@properties['service_sid']
|
195
|
+
end
|
196
|
+
|
197
|
+
##
|
198
|
+
# @return [String] Unique external identifier of the Entity
|
199
|
+
def entity_identity
|
200
|
+
@properties['entity_identity']
|
201
|
+
end
|
202
|
+
|
203
|
+
##
|
204
|
+
# @return [access_token.FactorTypes] The Type of the Factor
|
205
|
+
def factor_type
|
206
|
+
@properties['factor_type']
|
207
|
+
end
|
208
|
+
|
209
|
+
##
|
210
|
+
# @return [String] A human readable description of this factor.
|
211
|
+
def factor_friendly_name
|
212
|
+
@properties['factor_friendly_name']
|
106
213
|
end
|
107
214
|
|
108
215
|
##
|
@@ -111,16 +218,31 @@ module Twilio
|
|
111
218
|
@properties['token']
|
112
219
|
end
|
113
220
|
|
221
|
+
##
|
222
|
+
# @return [String] The URL of this resource.
|
223
|
+
def url
|
224
|
+
@properties['url']
|
225
|
+
end
|
226
|
+
|
227
|
+
##
|
228
|
+
# Fetch the AccessTokenInstance
|
229
|
+
# @return [AccessTokenInstance] Fetched AccessTokenInstance
|
230
|
+
def fetch
|
231
|
+
context.fetch
|
232
|
+
end
|
233
|
+
|
114
234
|
##
|
115
235
|
# Provide a user friendly representation
|
116
236
|
def to_s
|
117
|
-
"
|
237
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
238
|
+
"<Twilio.Verify.V2.AccessTokenInstance #{values}>"
|
118
239
|
end
|
119
240
|
|
120
241
|
##
|
121
242
|
# Provide a detailed, user friendly representation
|
122
243
|
def inspect
|
123
|
-
"
|
244
|
+
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
245
|
+
"<Twilio.Verify.V2.AccessTokenInstance #{values}>"
|
124
246
|
end
|
125
247
|
end
|
126
248
|
end
|
@@ -442,8 +442,14 @@ module Twilio
|
|
442
442
|
##
|
443
443
|
# Access the access_tokens
|
444
444
|
# @return [AccessTokenList]
|
445
|
-
# @return [AccessTokenContext]
|
446
|
-
def access_tokens
|
445
|
+
# @return [AccessTokenContext] if sid was passed.
|
446
|
+
def access_tokens(sid=:unset)
|
447
|
+
raise ArgumentError, 'sid cannot be nil' if sid.nil?
|
448
|
+
|
449
|
+
if sid != :unset
|
450
|
+
return AccessTokenContext.new(@version, @solution[:sid], sid, )
|
451
|
+
end
|
452
|
+
|
447
453
|
unless @access_tokens
|
448
454
|
@access_tokens = AccessTokenList.new(@version, service_sid: @solution[:sid], )
|
449
455
|
end
|
data/lib/twilio-ruby/version.rb
CHANGED
data/sonar-project.properties
CHANGED
data/twilio-ruby.gemspec
CHANGED
@@ -36,7 +36,6 @@ Gem::Specification.new do |spec|
|
|
36
36
|
spec.add_development_dependency 'rack', '~> 2.0'
|
37
37
|
spec.add_development_dependency 'rake', '~> 13.0'
|
38
38
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
39
|
-
spec.add_development_dependency 'rubocop', '~> 0.82.0'
|
40
39
|
spec.add_development_dependency 'yard', '~> 0.9.9'
|
41
40
|
spec.add_development_dependency 'logger', '~> 1.4.2'
|
42
41
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: twilio-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.63.
|
4
|
+
version: 5.63.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Twilio API Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-01-
|
11
|
+
date: 2022-01-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jwt
|
@@ -160,20 +160,6 @@ dependencies:
|
|
160
160
|
- - "~>"
|
161
161
|
- !ruby/object:Gem::Version
|
162
162
|
version: '3.0'
|
163
|
-
- !ruby/object:Gem::Dependency
|
164
|
-
name: rubocop
|
165
|
-
requirement: !ruby/object:Gem::Requirement
|
166
|
-
requirements:
|
167
|
-
- - "~>"
|
168
|
-
- !ruby/object:Gem::Version
|
169
|
-
version: 0.82.0
|
170
|
-
type: :development
|
171
|
-
prerelease: false
|
172
|
-
version_requirements: !ruby/object:Gem::Requirement
|
173
|
-
requirements:
|
174
|
-
- - "~>"
|
175
|
-
- !ruby/object:Gem::Version
|
176
|
-
version: 0.82.0
|
177
163
|
- !ruby/object:Gem::Dependency
|
178
164
|
name: yard
|
179
165
|
requirement: !ruby/object:Gem::Requirement
|
@@ -447,6 +433,8 @@ files:
|
|
447
433
|
- lib/twilio-ruby/rest/insights/v1/call/metric.rb
|
448
434
|
- lib/twilio-ruby/rest/insights/v1/call/summary.rb
|
449
435
|
- lib/twilio-ruby/rest/insights/v1/call_summaries.rb
|
436
|
+
- lib/twilio-ruby/rest/insights/v1/conference.rb
|
437
|
+
- lib/twilio-ruby/rest/insights/v1/conference/conference_participant.rb
|
450
438
|
- lib/twilio-ruby/rest/insights/v1/room.rb
|
451
439
|
- lib/twilio-ruby/rest/insights/v1/room/participant.rb
|
452
440
|
- lib/twilio-ruby/rest/insights/v1/setting.rb
|
@@ -637,6 +625,7 @@ files:
|
|
637
625
|
- lib/twilio-ruby/rest/supersim.rb
|
638
626
|
- lib/twilio-ruby/rest/supersim/v1.rb
|
639
627
|
- lib/twilio-ruby/rest/supersim/v1/command.rb
|
628
|
+
- lib/twilio-ruby/rest/supersim/v1/esim_profile.rb
|
640
629
|
- lib/twilio-ruby/rest/supersim/v1/fleet.rb
|
641
630
|
- lib/twilio-ruby/rest/supersim/v1/ip_command.rb
|
642
631
|
- lib/twilio-ruby/rest/supersim/v1/network.rb
|