twilio-ruby 7.7.2 → 7.8.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 +26 -0
- data/README.md +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country/local.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country/machine_to_machine.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country/mobile.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country/national.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country/shared_cost.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country/toll_free.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country/voip.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/all_time.rb +4 -4
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/daily.rb +4 -4
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/last_month.rb +4 -4
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb +4 -4
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/this_month.rb +4 -4
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/today.rb +4 -4
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yearly.rb +4 -4
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yesterday.rb +4 -4
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record.rb +4 -4
- data/lib/twilio-ruby/rest/api/v2010/account/usage/trigger.rb +5 -5
- data/lib/twilio-ruby/rest/content/v1/content.rb +42 -2
- data/lib/twilio-ruby/rest/intelligence/v2/service.rb +17 -1
- data/lib/twilio-ruby/rest/intelligence/v2/transcript/encrypted_operator_results.rb +217 -0
- data/lib/twilio-ruby/rest/intelligence/v2/transcript/encrypted_sentences.rb +217 -0
- data/lib/twilio-ruby/rest/intelligence/v2/transcript.rb +43 -0
- data/lib/twilio-ruby/rest/messaging/v2/channels_sender.rb +29 -29
- data/lib/twilio-ruby/rest/messaging/v2.rb +1 -1
- data/lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb +3 -3
- data/lib/twilio-ruby/rest/numbers/v3/hosted_number_order.rb +339 -0
- data/lib/twilio-ruby/rest/numbers/v3.rb +40 -0
- data/lib/twilio-ruby/rest/numbers_base.rb +5 -0
- data/lib/twilio-ruby/rest/oauth/v2/token.rb +186 -0
- data/lib/twilio-ruby/rest/oauth/v2.rb +40 -0
- data/lib/twilio-ruby/rest/oauth_base.rb +6 -1
- data/lib/twilio-ruby/rest/verify/v2/new_challenge.rb +335 -0
- data/lib/twilio-ruby/rest/verify/v2/service/new_factor.rb +297 -0
- data/lib/twilio-ruby/rest/verify/v2/service.rb +38 -0
- data/lib/twilio-ruby/rest/verify/v2.rb +15 -0
- data/lib/twilio-ruby/rest/voice_base.rb +6 -1
- data/lib/twilio-ruby/twiml/voice_response.rb +20 -0
- data/lib/twilio-ruby/version.rb +1 -1
- data/twilio-ruby.gemspec +1 -1
- metadata +12 -4
@@ -0,0 +1,335 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
4
|
+
# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
5
|
+
# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
6
|
+
#
|
7
|
+
# Twilio - Verify
|
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 Verify < VerifyBase
|
19
|
+
class V2 < Version
|
20
|
+
class NewChallengeList < ListResource
|
21
|
+
|
22
|
+
class CreatePasskeysChallengeRequest
|
23
|
+
# @param [identity]: [String]
|
24
|
+
# @param [factor_sid]: [String]
|
25
|
+
attr_accessor :identity, :factor_sid
|
26
|
+
def initialize(payload)
|
27
|
+
@identity = payload["identity"]
|
28
|
+
@factor_sid = payload["factor_sid"]
|
29
|
+
end
|
30
|
+
def to_json(options = {})
|
31
|
+
{
|
32
|
+
"identity": @identity,
|
33
|
+
"factor_sid": @factor_sid,
|
34
|
+
}.to_json(options)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
|
39
|
+
##
|
40
|
+
# Initialize the NewChallengeList
|
41
|
+
# @param [Version] version Version that contains the resource
|
42
|
+
# @return [NewChallengeList] NewChallengeList
|
43
|
+
def initialize(version)
|
44
|
+
super(version)
|
45
|
+
# Path Solution
|
46
|
+
@solution = { }
|
47
|
+
|
48
|
+
|
49
|
+
end
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
# Provide a user friendly representation
|
54
|
+
def to_s
|
55
|
+
'#<Twilio.Verify.V2.NewChallengeList>'
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
|
60
|
+
class NewChallengeContext < InstanceContext
|
61
|
+
##
|
62
|
+
# Initialize the NewChallengeContext
|
63
|
+
# @param [Version] version Version that contains the resource
|
64
|
+
# @param [String] service_sid The unique SID identifier of the Service.
|
65
|
+
# @return [NewChallengeContext] NewChallengeContext
|
66
|
+
def initialize(version, service_sid)
|
67
|
+
super(version)
|
68
|
+
|
69
|
+
# Path Solution
|
70
|
+
@solution = { service_sid: service_sid, }
|
71
|
+
@uri = "/Services/#{@solution[:service_sid]}/Passkeys/Challenges"
|
72
|
+
|
73
|
+
|
74
|
+
end
|
75
|
+
##
|
76
|
+
# Create the NewChallengeInstance
|
77
|
+
# @param [CreatePasskeysChallengeRequest] create_passkeys_challenge_request
|
78
|
+
# @return [NewChallengeInstance] Created NewChallengeInstance
|
79
|
+
def create(create_passkeys_challenge_request: nil
|
80
|
+
)
|
81
|
+
|
82
|
+
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
83
|
+
headers['Content-Type'] = 'application/json'
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
payload = @version.create('POST', @uri, headers: headers, data: create_passkeys_challenge_request.to_json)
|
89
|
+
NewChallengeInstance.new(
|
90
|
+
@version,
|
91
|
+
payload,
|
92
|
+
service_sid: @solution[:service_sid],
|
93
|
+
)
|
94
|
+
end
|
95
|
+
|
96
|
+
|
97
|
+
##
|
98
|
+
# Provide a user friendly representation
|
99
|
+
def to_s
|
100
|
+
context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
|
101
|
+
"#<Twilio.Verify.V2.NewChallengeContext #{context}>"
|
102
|
+
end
|
103
|
+
|
104
|
+
##
|
105
|
+
# Provide a detailed, user friendly representation
|
106
|
+
def inspect
|
107
|
+
context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
|
108
|
+
"#<Twilio.Verify.V2.NewChallengeContext #{context}>"
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
class NewChallengePage < Page
|
113
|
+
##
|
114
|
+
# Initialize the NewChallengePage
|
115
|
+
# @param [Version] version Version that contains the resource
|
116
|
+
# @param [Response] response Response from the API
|
117
|
+
# @param [Hash] solution Path solution for the resource
|
118
|
+
# @return [NewChallengePage] NewChallengePage
|
119
|
+
def initialize(version, response, solution)
|
120
|
+
super(version, response)
|
121
|
+
|
122
|
+
# Path Solution
|
123
|
+
@solution = solution
|
124
|
+
end
|
125
|
+
|
126
|
+
##
|
127
|
+
# Build an instance of NewChallengeInstance
|
128
|
+
# @param [Hash] payload Payload response from the API
|
129
|
+
# @return [NewChallengeInstance] NewChallengeInstance
|
130
|
+
def get_instance(payload)
|
131
|
+
NewChallengeInstance.new(@version, payload)
|
132
|
+
end
|
133
|
+
|
134
|
+
##
|
135
|
+
# Provide a user friendly representation
|
136
|
+
def to_s
|
137
|
+
'<Twilio.Verify.V2.NewChallengePage>'
|
138
|
+
end
|
139
|
+
end
|
140
|
+
class NewChallengeInstance < InstanceResource
|
141
|
+
##
|
142
|
+
# Initialize the NewChallengeInstance
|
143
|
+
# @param [Version] version Version that contains the resource
|
144
|
+
# @param [Hash] payload payload that contains response from Twilio
|
145
|
+
# @param [String] account_sid The SID of the
|
146
|
+
# {Account}[https://www.twilio.com/docs/iam/api/account] that created this NewChallenge
|
147
|
+
# resource.
|
148
|
+
# @param [String] sid The SID of the Call resource to fetch.
|
149
|
+
# @return [NewChallengeInstance] NewChallengeInstance
|
150
|
+
def initialize(version, payload , service_sid: nil)
|
151
|
+
super(version)
|
152
|
+
|
153
|
+
# Marshaled Properties
|
154
|
+
@properties = {
|
155
|
+
'options' => payload['options'],
|
156
|
+
'sid' => payload['sid'],
|
157
|
+
'account_sid' => payload['account_sid'],
|
158
|
+
'service_sid' => payload['service_sid'],
|
159
|
+
'entity_sid' => payload['entity_sid'],
|
160
|
+
'identity' => payload['identity'],
|
161
|
+
'factor_sid' => payload['factor_sid'],
|
162
|
+
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
163
|
+
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
164
|
+
'date_responded' => Twilio.deserialize_iso8601_datetime(payload['date_responded']),
|
165
|
+
'expiration_date' => Twilio.deserialize_iso8601_datetime(payload['expiration_date']),
|
166
|
+
'status' => payload['status'],
|
167
|
+
'responded_reason' => payload['responded_reason'],
|
168
|
+
'details' => payload['details'],
|
169
|
+
'hidden_details' => payload['hidden_details'],
|
170
|
+
'metadata' => payload['metadata'],
|
171
|
+
'factor_type' => payload['factor_type'],
|
172
|
+
'url' => payload['url'],
|
173
|
+
'links' => payload['links'],
|
174
|
+
}
|
175
|
+
|
176
|
+
# Context
|
177
|
+
@instance_context = nil
|
178
|
+
@params = { 'service_sid' => service_sid || @properties['service_sid'] , }
|
179
|
+
end
|
180
|
+
|
181
|
+
##
|
182
|
+
# Generate an instance context for the instance, the context is capable of
|
183
|
+
# performing various actions. All instance actions are proxied to the context
|
184
|
+
# @return [NewChallengeContext] CallContext for this CallInstance
|
185
|
+
def context
|
186
|
+
unless @instance_context
|
187
|
+
@instance_context = NewChallengeContext.new(@version , @params['service_sid'])
|
188
|
+
end
|
189
|
+
@instance_context
|
190
|
+
end
|
191
|
+
|
192
|
+
##
|
193
|
+
# @return [Hash] An object that contains challenge options. Currently only used for `passkeys`.
|
194
|
+
def options
|
195
|
+
@properties['options']
|
196
|
+
end
|
197
|
+
|
198
|
+
##
|
199
|
+
# @return [String] A 34 character string that uniquely identifies this Challenge.
|
200
|
+
def sid
|
201
|
+
@properties['sid']
|
202
|
+
end
|
203
|
+
|
204
|
+
##
|
205
|
+
# @return [String] The unique SID identifier of the Account.
|
206
|
+
def account_sid
|
207
|
+
@properties['account_sid']
|
208
|
+
end
|
209
|
+
|
210
|
+
##
|
211
|
+
# @return [String] The unique SID identifier of the Service.
|
212
|
+
def service_sid
|
213
|
+
@properties['service_sid']
|
214
|
+
end
|
215
|
+
|
216
|
+
##
|
217
|
+
# @return [String] The unique SID identifier of the Entity.
|
218
|
+
def entity_sid
|
219
|
+
@properties['entity_sid']
|
220
|
+
end
|
221
|
+
|
222
|
+
##
|
223
|
+
# @return [String] Customer unique identity for the Entity owner of the Challenge.
|
224
|
+
def identity
|
225
|
+
@properties['identity']
|
226
|
+
end
|
227
|
+
|
228
|
+
##
|
229
|
+
# @return [String] The unique SID identifier of the Factor.
|
230
|
+
def factor_sid
|
231
|
+
@properties['factor_sid']
|
232
|
+
end
|
233
|
+
|
234
|
+
##
|
235
|
+
# @return [Time] The date that this Challenge was created, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
236
|
+
def date_created
|
237
|
+
@properties['date_created']
|
238
|
+
end
|
239
|
+
|
240
|
+
##
|
241
|
+
# @return [Time] The date that this Challenge was updated, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
242
|
+
def date_updated
|
243
|
+
@properties['date_updated']
|
244
|
+
end
|
245
|
+
|
246
|
+
##
|
247
|
+
# @return [Time] The date that this Challenge was responded, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
248
|
+
def date_responded
|
249
|
+
@properties['date_responded']
|
250
|
+
end
|
251
|
+
|
252
|
+
##
|
253
|
+
# @return [Time] The date-time when this Challenge expires, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
254
|
+
def expiration_date
|
255
|
+
@properties['expiration_date']
|
256
|
+
end
|
257
|
+
|
258
|
+
##
|
259
|
+
# @return [String] The Status of this Challenge. One of `pending`, `expired`, `approved` or `denied`.
|
260
|
+
def status
|
261
|
+
@properties['status']
|
262
|
+
end
|
263
|
+
|
264
|
+
##
|
265
|
+
# @return [String] Reason for the Challenge to be in certain `status`. One of `none`, `not_needed` or `not_requested`.
|
266
|
+
def responded_reason
|
267
|
+
@properties['responded_reason']
|
268
|
+
end
|
269
|
+
|
270
|
+
##
|
271
|
+
# @return [Hash] Details provided to give context about the Challenge.
|
272
|
+
def details
|
273
|
+
@properties['details']
|
274
|
+
end
|
275
|
+
|
276
|
+
##
|
277
|
+
# @return [Hash] Details provided to give context about the Challenge.
|
278
|
+
def hidden_details
|
279
|
+
@properties['hidden_details']
|
280
|
+
end
|
281
|
+
|
282
|
+
##
|
283
|
+
# @return [Hash] Custom metadata associated with the challenge.
|
284
|
+
def metadata
|
285
|
+
@properties['metadata']
|
286
|
+
end
|
287
|
+
|
288
|
+
##
|
289
|
+
# @return [String] The Factor Type of this Challenge. Currently `push` and `totp` are supported.
|
290
|
+
def factor_type
|
291
|
+
@properties['factor_type']
|
292
|
+
end
|
293
|
+
|
294
|
+
##
|
295
|
+
# @return [String] The URL of this resource.
|
296
|
+
def url
|
297
|
+
@properties['url']
|
298
|
+
end
|
299
|
+
|
300
|
+
##
|
301
|
+
# @return [Hash] Contains a dictionary of URL links to nested resources of this Challenge.
|
302
|
+
def links
|
303
|
+
@properties['links']
|
304
|
+
end
|
305
|
+
|
306
|
+
##
|
307
|
+
# Create the NewChallengeInstance
|
308
|
+
# @param [CreatePasskeysChallengeRequest] create_passkeys_challenge_request
|
309
|
+
# @return [NewChallengeInstance] Created NewChallengeInstance
|
310
|
+
def create(create_passkeys_challenge_request: nil
|
311
|
+
)
|
312
|
+
|
313
|
+
context.create(
|
314
|
+
)
|
315
|
+
end
|
316
|
+
|
317
|
+
##
|
318
|
+
# Provide a user friendly representation
|
319
|
+
def to_s
|
320
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
321
|
+
"<Twilio.Verify.V2.NewChallengeInstance #{values}>"
|
322
|
+
end
|
323
|
+
|
324
|
+
##
|
325
|
+
# Provide a detailed, user friendly representation
|
326
|
+
def inspect
|
327
|
+
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
328
|
+
"<Twilio.Verify.V2.NewChallengeInstance #{values}>"
|
329
|
+
end
|
330
|
+
end
|
331
|
+
|
332
|
+
end
|
333
|
+
end
|
334
|
+
end
|
335
|
+
end
|
@@ -0,0 +1,297 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
4
|
+
# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
5
|
+
# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
6
|
+
#
|
7
|
+
# Twilio - Verify
|
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 Verify < VerifyBase
|
19
|
+
class V2 < Version
|
20
|
+
class ServiceContext < InstanceContext
|
21
|
+
|
22
|
+
class NewFactorList < ListResource
|
23
|
+
|
24
|
+
class CreateNewPasskeysFactorRequest
|
25
|
+
# @param [friendly_name]: [String]
|
26
|
+
# @param [identity]: [String]
|
27
|
+
# @param [config]: [NewFactorList.CreateNewPasskeysFactorRequestConfig]
|
28
|
+
attr_accessor :friendly_name, :identity, :config
|
29
|
+
def initialize(payload)
|
30
|
+
@friendly_name = payload["friendly_name"]
|
31
|
+
@identity = payload["identity"]
|
32
|
+
@config = payload["config"]
|
33
|
+
end
|
34
|
+
def to_json(options = {})
|
35
|
+
{
|
36
|
+
"friendly_name": @friendly_name,
|
37
|
+
"identity": @identity,
|
38
|
+
"config": @config,
|
39
|
+
}.to_json(options)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
class CreateNewPasskeysFactorRequestConfig
|
44
|
+
# @param [relying_party]: [NewFactorList.CreateNewPasskeysFactorRequestConfigRelyingParty]
|
45
|
+
# @param [authenticator_attachment]: [String]
|
46
|
+
# @param [discoverable_credentials]: [String]
|
47
|
+
# @param [user_verification]: [String]
|
48
|
+
attr_accessor :relying_party, :authenticator_attachment, :discoverable_credentials, :user_verification
|
49
|
+
def initialize(payload)
|
50
|
+
@relying_party = payload["relying_party"]
|
51
|
+
@authenticator_attachment = payload["authenticator_attachment"]
|
52
|
+
@discoverable_credentials = payload["discoverable_credentials"]
|
53
|
+
@user_verification = payload["user_verification"]
|
54
|
+
end
|
55
|
+
def to_json(options = {})
|
56
|
+
{
|
57
|
+
"relying_party": @relying_party,
|
58
|
+
"authenticator_attachment": @authenticator_attachment,
|
59
|
+
"discoverable_credentials": @discoverable_credentials,
|
60
|
+
"user_verification": @user_verification,
|
61
|
+
}.to_json(options)
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
class CreateNewPasskeysFactorRequestConfigRelyingParty
|
66
|
+
# @param [id]: [String]
|
67
|
+
# @param [name]: [String]
|
68
|
+
# @param [origins]: [Array<String>]
|
69
|
+
attr_accessor :id, :name, :origins
|
70
|
+
def initialize(payload)
|
71
|
+
@id = payload["id"]
|
72
|
+
@name = payload["name"]
|
73
|
+
@origins = payload["origins"]
|
74
|
+
end
|
75
|
+
def to_json(options = {})
|
76
|
+
{
|
77
|
+
"id": @id,
|
78
|
+
"name": @name,
|
79
|
+
"origins": @origins,
|
80
|
+
}.to_json(options)
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
|
85
|
+
##
|
86
|
+
# Initialize the NewFactorList
|
87
|
+
# @param [Version] version Version that contains the resource
|
88
|
+
# @return [NewFactorList] NewFactorList
|
89
|
+
def initialize(version, service_sid: nil)
|
90
|
+
super(version)
|
91
|
+
# Path Solution
|
92
|
+
@solution = { service_sid: service_sid }
|
93
|
+
@uri = "/Services/#{@solution[:service_sid]}/Passkeys/Factors"
|
94
|
+
|
95
|
+
end
|
96
|
+
##
|
97
|
+
# Create the NewFactorInstance
|
98
|
+
# @param [CreateNewPasskeysFactorRequest] create_new_passkeys_factor_request
|
99
|
+
# @return [NewFactorInstance] Created NewFactorInstance
|
100
|
+
def create(create_new_passkeys_factor_request: nil
|
101
|
+
)
|
102
|
+
|
103
|
+
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
104
|
+
headers['Content-Type'] = 'application/json'
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
payload = @version.create('POST', @uri, headers: headers, data: create_new_passkeys_factor_request.to_json)
|
110
|
+
NewFactorInstance.new(
|
111
|
+
@version,
|
112
|
+
payload,
|
113
|
+
service_sid: @solution[:service_sid],
|
114
|
+
)
|
115
|
+
end
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
# Provide a user friendly representation
|
121
|
+
def to_s
|
122
|
+
'#<Twilio.Verify.V2.NewFactorList>'
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
class NewFactorPage < Page
|
127
|
+
##
|
128
|
+
# Initialize the NewFactorPage
|
129
|
+
# @param [Version] version Version that contains the resource
|
130
|
+
# @param [Response] response Response from the API
|
131
|
+
# @param [Hash] solution Path solution for the resource
|
132
|
+
# @return [NewFactorPage] NewFactorPage
|
133
|
+
def initialize(version, response, solution)
|
134
|
+
super(version, response)
|
135
|
+
|
136
|
+
# Path Solution
|
137
|
+
@solution = solution
|
138
|
+
end
|
139
|
+
|
140
|
+
##
|
141
|
+
# Build an instance of NewFactorInstance
|
142
|
+
# @param [Hash] payload Payload response from the API
|
143
|
+
# @return [NewFactorInstance] NewFactorInstance
|
144
|
+
def get_instance(payload)
|
145
|
+
NewFactorInstance.new(@version, payload, service_sid: @solution[:service_sid])
|
146
|
+
end
|
147
|
+
|
148
|
+
##
|
149
|
+
# Provide a user friendly representation
|
150
|
+
def to_s
|
151
|
+
'<Twilio.Verify.V2.NewFactorPage>'
|
152
|
+
end
|
153
|
+
end
|
154
|
+
class NewFactorInstance < InstanceResource
|
155
|
+
##
|
156
|
+
# Initialize the NewFactorInstance
|
157
|
+
# @param [Version] version Version that contains the resource
|
158
|
+
# @param [Hash] payload payload that contains response from Twilio
|
159
|
+
# @param [String] account_sid The SID of the
|
160
|
+
# {Account}[https://www.twilio.com/docs/iam/api/account] that created this NewFactor
|
161
|
+
# resource.
|
162
|
+
# @param [String] sid The SID of the Call resource to fetch.
|
163
|
+
# @return [NewFactorInstance] NewFactorInstance
|
164
|
+
def initialize(version, payload , service_sid: nil)
|
165
|
+
super(version)
|
166
|
+
|
167
|
+
# Marshaled Properties
|
168
|
+
@properties = {
|
169
|
+
'sid' => payload['sid'],
|
170
|
+
'account_sid' => payload['account_sid'],
|
171
|
+
'service_sid' => payload['service_sid'],
|
172
|
+
'entity_sid' => payload['entity_sid'],
|
173
|
+
'identity' => payload['identity'],
|
174
|
+
'binding' => payload['binding'],
|
175
|
+
'options' => payload['options'],
|
176
|
+
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
177
|
+
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
178
|
+
'friendly_name' => payload['friendly_name'],
|
179
|
+
'status' => payload['status'],
|
180
|
+
'factor_type' => payload['factor_type'],
|
181
|
+
'config' => payload['config'],
|
182
|
+
'metadata' => payload['metadata'],
|
183
|
+
'url' => payload['url'],
|
184
|
+
}
|
185
|
+
end
|
186
|
+
|
187
|
+
|
188
|
+
##
|
189
|
+
# @return [String] A 34 character string that uniquely identifies this Factor.
|
190
|
+
def sid
|
191
|
+
@properties['sid']
|
192
|
+
end
|
193
|
+
|
194
|
+
##
|
195
|
+
# @return [String] The unique SID identifier of the Account.
|
196
|
+
def account_sid
|
197
|
+
@properties['account_sid']
|
198
|
+
end
|
199
|
+
|
200
|
+
##
|
201
|
+
# @return [String] The unique SID identifier of the Service.
|
202
|
+
def service_sid
|
203
|
+
@properties['service_sid']
|
204
|
+
end
|
205
|
+
|
206
|
+
##
|
207
|
+
# @return [String] The unique SID identifier of the Entity.
|
208
|
+
def entity_sid
|
209
|
+
@properties['entity_sid']
|
210
|
+
end
|
211
|
+
|
212
|
+
##
|
213
|
+
# @return [String] Customer unique identity for the Entity owner of the Factor.
|
214
|
+
def identity
|
215
|
+
@properties['identity']
|
216
|
+
end
|
217
|
+
|
218
|
+
##
|
219
|
+
# @return [Hash] Contains the `factor_type` specific secret and metadata. The Binding property is ONLY returned upon Factor creation.
|
220
|
+
def binding
|
221
|
+
@properties['binding']
|
222
|
+
end
|
223
|
+
|
224
|
+
##
|
225
|
+
# @return [Hash]
|
226
|
+
def options
|
227
|
+
@properties['options']
|
228
|
+
end
|
229
|
+
|
230
|
+
##
|
231
|
+
# @return [Time] The date that this Factor was created, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
232
|
+
def date_created
|
233
|
+
@properties['date_created']
|
234
|
+
end
|
235
|
+
|
236
|
+
##
|
237
|
+
# @return [Time] The date that this Factor was updated, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
238
|
+
def date_updated
|
239
|
+
@properties['date_updated']
|
240
|
+
end
|
241
|
+
|
242
|
+
##
|
243
|
+
# @return [String] The friendly name of this Factor. This can be any string up to 64 characters, meant for humans to distinguish between Factors.
|
244
|
+
def friendly_name
|
245
|
+
@properties['friendly_name']
|
246
|
+
end
|
247
|
+
|
248
|
+
##
|
249
|
+
# @return [String] The Status of this Factor. One of `unverified` or `verified`.
|
250
|
+
def status
|
251
|
+
@properties['status']
|
252
|
+
end
|
253
|
+
|
254
|
+
##
|
255
|
+
# @return [String] The Type of this Factor. Currently `push` and `totp` are supported.
|
256
|
+
def factor_type
|
257
|
+
@properties['factor_type']
|
258
|
+
end
|
259
|
+
|
260
|
+
##
|
261
|
+
# @return [Hash] An object that contains configurations specific to a `factor_type`.
|
262
|
+
def config
|
263
|
+
@properties['config']
|
264
|
+
end
|
265
|
+
|
266
|
+
##
|
267
|
+
# @return [Hash] Custom metadata associated with the factor.
|
268
|
+
def metadata
|
269
|
+
@properties['metadata']
|
270
|
+
end
|
271
|
+
|
272
|
+
##
|
273
|
+
# @return [String] The URL of this resource.
|
274
|
+
def url
|
275
|
+
@properties['url']
|
276
|
+
end
|
277
|
+
|
278
|
+
##
|
279
|
+
# Provide a user friendly representation
|
280
|
+
def to_s
|
281
|
+
"<Twilio.Verify.V2.NewFactorInstance>"
|
282
|
+
end
|
283
|
+
|
284
|
+
##
|
285
|
+
# Provide a detailed, user friendly representation
|
286
|
+
def inspect
|
287
|
+
"<Twilio.Verify.V2.NewFactorInstance>"
|
288
|
+
end
|
289
|
+
end
|
290
|
+
|
291
|
+
end
|
292
|
+
end
|
293
|
+
end
|
294
|
+
end
|
295
|
+
end
|
296
|
+
|
297
|
+
|
@@ -242,6 +242,8 @@ module Twilio
|
|
242
242
|
|
243
243
|
# Dependents
|
244
244
|
@verification_checks = nil
|
245
|
+
@new_factors = nil
|
246
|
+
@verify_factor = nil
|
245
247
|
@verifications = nil
|
246
248
|
@access_tokens = nil
|
247
249
|
@webhooks = nil
|
@@ -393,6 +395,28 @@ module Twilio
|
|
393
395
|
@verification_checks
|
394
396
|
end
|
395
397
|
##
|
398
|
+
# Access the new_factors
|
399
|
+
# @return [NewFactorList]
|
400
|
+
# @return [NewFactorContext]
|
401
|
+
def new_factors
|
402
|
+
unless @new_factors
|
403
|
+
@new_factors = NewFactorList.new(
|
404
|
+
@version, )
|
405
|
+
end
|
406
|
+
@new_factors
|
407
|
+
end
|
408
|
+
##
|
409
|
+
# Access the verify_factor
|
410
|
+
# @return [VerifyFactorList]
|
411
|
+
# @return [VerifyFactorContext]
|
412
|
+
def verify_factor
|
413
|
+
unless @verify_factor
|
414
|
+
@verify_factor = VerifyFactorList.new(
|
415
|
+
@version, )
|
416
|
+
end
|
417
|
+
@verify_factor
|
418
|
+
end
|
419
|
+
##
|
396
420
|
# Access the verifications
|
397
421
|
# @return [VerificationList]
|
398
422
|
# @return [VerificationContext] if sid was passed.
|
@@ -841,6 +865,20 @@ module Twilio
|
|
841
865
|
context.verification_checks
|
842
866
|
end
|
843
867
|
|
868
|
+
##
|
869
|
+
# Access the new_factors
|
870
|
+
# @return [new_factors] new_factors
|
871
|
+
def new_factors
|
872
|
+
context.new_factors
|
873
|
+
end
|
874
|
+
|
875
|
+
##
|
876
|
+
# Access the verify_factor
|
877
|
+
# @return [verify_factor] verify_factor
|
878
|
+
def verify_factor
|
879
|
+
context.verify_factor
|
880
|
+
end
|
881
|
+
|
844
882
|
##
|
845
883
|
# Access the verifications
|
846
884
|
# @return [verifications] verifications
|