twilio-ruby 7.8.0 → 7.8.2
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 +27 -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/conference/participant.rb +5 -2
- data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +1 -1
- data/lib/twilio-ruby/rest/client.rb +5 -0
- data/lib/twilio-ruby/rest/content/v1/content.rb +38 -1
- 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/knowledge/v1/knowledge/chunk.rb +232 -0
- data/lib/twilio-ruby/rest/knowledge/v1/knowledge/knowledge_status.rb +213 -0
- data/lib/twilio-ruby/rest/knowledge/v1/knowledge.rb +623 -0
- data/lib/twilio-ruby/rest/knowledge/v1.rb +49 -0
- data/lib/twilio-ruby/rest/knowledge.rb +6 -0
- data/lib/twilio-ruby/rest/knowledge_base.rb +38 -0
- data/lib/twilio-ruby/rest/messaging/v2/typing_indicator.rb +140 -0
- data/lib/twilio-ruby/rest/messaging/v2.rb +6 -0
- data/lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb +96 -8
- 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/service/approve_challenge.rb +312 -0
- data/lib/twilio-ruby/rest/verify/v2/service/new_challenge.rb +340 -0
- data/lib/twilio-ruby/rest/verify/v2/service/new_factor.rb +467 -0
- data/lib/twilio-ruby/rest/verify/v2/service.rb +75 -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 +20 -4
@@ -0,0 +1,312 @@
|
|
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 ApproveChallengeList < ListResource
|
23
|
+
|
24
|
+
class ApprovePasskeysChallengeRequest
|
25
|
+
# @param [id]: [String] A [base64url](https://base64.guru/standards/base64url) encoded representation of `rawId`.
|
26
|
+
# @param [raw_id]: [String] The globally unique identifier for this `PublicKeyCredential`.
|
27
|
+
# @param [authenticator_attachment]: [String] A string that indicates the mechanism by which the WebAuthn implementation is attached to the authenticator at the time the associated `navigator.credentials.create()` or `navigator.credentials.get()` call completes.
|
28
|
+
# @param [type]: [String] The valid credential types supported by the API. The values of this enumeration are used for versioning the `AuthenticatorAssertion` and `AuthenticatorAttestation` structures according to the type of the authenticator.
|
29
|
+
# @param [response]: [ApproveChallengeList.ApprovePasskeysChallengeRequestResponse]
|
30
|
+
attr_accessor :id, :raw_id, :authenticator_attachment, :type, :response
|
31
|
+
def initialize(payload)
|
32
|
+
@id = payload["id"]
|
33
|
+
@raw_id = payload["raw_id"]
|
34
|
+
@authenticator_attachment = payload["authenticator_attachment"]
|
35
|
+
@type = payload["type"]
|
36
|
+
@response = payload["response"]
|
37
|
+
end
|
38
|
+
def to_json(options = {})
|
39
|
+
{
|
40
|
+
"id": @id,
|
41
|
+
"rawId": @raw_id,
|
42
|
+
"authenticatorAttachment": @authenticator_attachment,
|
43
|
+
"type": @type,
|
44
|
+
"response": @response,
|
45
|
+
}.to_json(options)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
class ApprovePasskeysChallengeRequestResponse
|
50
|
+
# @param [authenticator_data]: [String] The [authenticator data](https://developer.mozilla.org/en-US/docs/Web/API/Web_Authentication_API/Authenticator_data) structure contains information from the authenticator about the processing of a credential creation or authentication request.
|
51
|
+
# @param [client_data_json]: [String] This property contains the JSON-compatible serialization of the data passed from the browser to the authenticator in order to generate this credential.
|
52
|
+
# @param [signature]: [String] An assertion signature over `authenticatorData` and `clientDataJSON`. The assertion signature is created with the private key of the key pair that was created during the originating `navigator.credentials.create()` call and verified using the public key of that same key pair.
|
53
|
+
# @param [user_handle]: [String] The user handle stored in the authenticator, specified as `user.id` in the options passed to the originating `navigator.credentials.create()` call. This property should contain a base64url-encoded entity SID.
|
54
|
+
attr_accessor :authenticator_data, :client_data_json, :signature, :user_handle
|
55
|
+
def initialize(payload)
|
56
|
+
@authenticator_data = payload["authenticator_data"]
|
57
|
+
@client_data_json = payload["client_data_json"]
|
58
|
+
@signature = payload["signature"]
|
59
|
+
@user_handle = payload["user_handle"]
|
60
|
+
end
|
61
|
+
def to_json(options = {})
|
62
|
+
{
|
63
|
+
"authenticatorData": @authenticator_data,
|
64
|
+
"clientDataJSON": @client_data_json,
|
65
|
+
"signature": @signature,
|
66
|
+
"userHandle": @user_handle,
|
67
|
+
}.to_json(options)
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
|
72
|
+
##
|
73
|
+
# Initialize the ApproveChallengeList
|
74
|
+
# @param [Version] version Version that contains the resource
|
75
|
+
# @return [ApproveChallengeList] ApproveChallengeList
|
76
|
+
def initialize(version, service_sid: nil)
|
77
|
+
super(version)
|
78
|
+
# Path Solution
|
79
|
+
@solution = { service_sid: service_sid }
|
80
|
+
@uri = "/Services/#{@solution[:service_sid]}/Passkeys/ApproveChallenge"
|
81
|
+
|
82
|
+
end
|
83
|
+
##
|
84
|
+
# Update the ApproveChallengeInstance
|
85
|
+
# @param [ApprovePasskeysChallengeRequest] approve_passkeys_challenge_request
|
86
|
+
# @return [ApproveChallengeInstance] Updated ApproveChallengeInstance
|
87
|
+
def update(approve_passkeys_challenge_request: nil
|
88
|
+
)
|
89
|
+
|
90
|
+
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
91
|
+
headers['Content-Type'] = 'application/json'
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
payload = @version.update('POST', @uri, headers: headers, data: approve_passkeys_challenge_request.to_json)
|
97
|
+
ApproveChallengeInstance.new(
|
98
|
+
@version,
|
99
|
+
payload,
|
100
|
+
service_sid: @solution[:service_sid],
|
101
|
+
)
|
102
|
+
end
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
# Provide a user friendly representation
|
108
|
+
def to_s
|
109
|
+
'#<Twilio.Verify.V2.ApproveChallengeList>'
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
class ApproveChallengePage < Page
|
114
|
+
##
|
115
|
+
# Initialize the ApproveChallengePage
|
116
|
+
# @param [Version] version Version that contains the resource
|
117
|
+
# @param [Response] response Response from the API
|
118
|
+
# @param [Hash] solution Path solution for the resource
|
119
|
+
# @return [ApproveChallengePage] ApproveChallengePage
|
120
|
+
def initialize(version, response, solution)
|
121
|
+
super(version, response)
|
122
|
+
|
123
|
+
# Path Solution
|
124
|
+
@solution = solution
|
125
|
+
end
|
126
|
+
|
127
|
+
##
|
128
|
+
# Build an instance of ApproveChallengeInstance
|
129
|
+
# @param [Hash] payload Payload response from the API
|
130
|
+
# @return [ApproveChallengeInstance] ApproveChallengeInstance
|
131
|
+
def get_instance(payload)
|
132
|
+
ApproveChallengeInstance.new(@version, payload, service_sid: @solution[:service_sid])
|
133
|
+
end
|
134
|
+
|
135
|
+
##
|
136
|
+
# Provide a user friendly representation
|
137
|
+
def to_s
|
138
|
+
'<Twilio.Verify.V2.ApproveChallengePage>'
|
139
|
+
end
|
140
|
+
end
|
141
|
+
class ApproveChallengeInstance < InstanceResource
|
142
|
+
##
|
143
|
+
# Initialize the ApproveChallengeInstance
|
144
|
+
# @param [Version] version Version that contains the resource
|
145
|
+
# @param [Hash] payload payload that contains response from Twilio
|
146
|
+
# @param [String] account_sid The SID of the
|
147
|
+
# {Account}[https://www.twilio.com/docs/iam/api/account] that created this ApproveChallenge
|
148
|
+
# resource.
|
149
|
+
# @param [String] sid The SID of the Call resource to fetch.
|
150
|
+
# @return [ApproveChallengeInstance] ApproveChallengeInstance
|
151
|
+
def initialize(version, payload , service_sid: nil)
|
152
|
+
super(version)
|
153
|
+
|
154
|
+
# Marshaled Properties
|
155
|
+
@properties = {
|
156
|
+
'options' => payload['options'],
|
157
|
+
'sid' => payload['sid'],
|
158
|
+
'account_sid' => payload['account_sid'],
|
159
|
+
'service_sid' => payload['service_sid'],
|
160
|
+
'entity_sid' => payload['entity_sid'],
|
161
|
+
'identity' => payload['identity'],
|
162
|
+
'factor_sid' => payload['factor_sid'],
|
163
|
+
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
164
|
+
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
165
|
+
'date_responded' => Twilio.deserialize_iso8601_datetime(payload['date_responded']),
|
166
|
+
'expiration_date' => Twilio.deserialize_iso8601_datetime(payload['expiration_date']),
|
167
|
+
'status' => payload['status'],
|
168
|
+
'responded_reason' => payload['responded_reason'],
|
169
|
+
'details' => payload['details'],
|
170
|
+
'hidden_details' => payload['hidden_details'],
|
171
|
+
'metadata' => payload['metadata'],
|
172
|
+
'factor_type' => payload['factor_type'],
|
173
|
+
'url' => payload['url'],
|
174
|
+
'links' => payload['links'],
|
175
|
+
}
|
176
|
+
end
|
177
|
+
|
178
|
+
|
179
|
+
##
|
180
|
+
# @return [Hash] An object that contains challenge options. Currently only used for `passkeys`.
|
181
|
+
def options
|
182
|
+
@properties['options']
|
183
|
+
end
|
184
|
+
|
185
|
+
##
|
186
|
+
# @return [String] A 34 character string that uniquely identifies this Challenge.
|
187
|
+
def sid
|
188
|
+
@properties['sid']
|
189
|
+
end
|
190
|
+
|
191
|
+
##
|
192
|
+
# @return [String] The unique SID identifier of the Account.
|
193
|
+
def account_sid
|
194
|
+
@properties['account_sid']
|
195
|
+
end
|
196
|
+
|
197
|
+
##
|
198
|
+
# @return [String] The unique SID identifier of the Service.
|
199
|
+
def service_sid
|
200
|
+
@properties['service_sid']
|
201
|
+
end
|
202
|
+
|
203
|
+
##
|
204
|
+
# @return [String] The unique SID identifier of the Entity.
|
205
|
+
def entity_sid
|
206
|
+
@properties['entity_sid']
|
207
|
+
end
|
208
|
+
|
209
|
+
##
|
210
|
+
# @return [String] Customer unique identity for the Entity owner of the Challenge.
|
211
|
+
def identity
|
212
|
+
@properties['identity']
|
213
|
+
end
|
214
|
+
|
215
|
+
##
|
216
|
+
# @return [String] The unique SID identifier of the Factor.
|
217
|
+
def factor_sid
|
218
|
+
@properties['factor_sid']
|
219
|
+
end
|
220
|
+
|
221
|
+
##
|
222
|
+
# @return [Time] The date that this Challenge was created, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
223
|
+
def date_created
|
224
|
+
@properties['date_created']
|
225
|
+
end
|
226
|
+
|
227
|
+
##
|
228
|
+
# @return [Time] The date that this Challenge was updated, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
229
|
+
def date_updated
|
230
|
+
@properties['date_updated']
|
231
|
+
end
|
232
|
+
|
233
|
+
##
|
234
|
+
# @return [Time] The date that this Challenge was responded, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
235
|
+
def date_responded
|
236
|
+
@properties['date_responded']
|
237
|
+
end
|
238
|
+
|
239
|
+
##
|
240
|
+
# @return [Time] The date-time when this Challenge expires, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
241
|
+
def expiration_date
|
242
|
+
@properties['expiration_date']
|
243
|
+
end
|
244
|
+
|
245
|
+
##
|
246
|
+
# @return [String] The Status of this Challenge. One of `pending`, `expired`, `approved` or `denied`.
|
247
|
+
def status
|
248
|
+
@properties['status']
|
249
|
+
end
|
250
|
+
|
251
|
+
##
|
252
|
+
# @return [String] Reason for the Challenge to be in certain `status`. One of `none`, `not_needed` or `not_requested`.
|
253
|
+
def responded_reason
|
254
|
+
@properties['responded_reason']
|
255
|
+
end
|
256
|
+
|
257
|
+
##
|
258
|
+
# @return [Hash] Details provided to give context about the Challenge.
|
259
|
+
def details
|
260
|
+
@properties['details']
|
261
|
+
end
|
262
|
+
|
263
|
+
##
|
264
|
+
# @return [Hash] Details provided to give context about the Challenge.
|
265
|
+
def hidden_details
|
266
|
+
@properties['hidden_details']
|
267
|
+
end
|
268
|
+
|
269
|
+
##
|
270
|
+
# @return [Hash] Custom metadata associated with the challenge.
|
271
|
+
def metadata
|
272
|
+
@properties['metadata']
|
273
|
+
end
|
274
|
+
|
275
|
+
##
|
276
|
+
# @return [String] The Factor Type of this Challenge. Currently `push` and `totp` are supported.
|
277
|
+
def factor_type
|
278
|
+
@properties['factor_type']
|
279
|
+
end
|
280
|
+
|
281
|
+
##
|
282
|
+
# @return [String] The URL of this resource.
|
283
|
+
def url
|
284
|
+
@properties['url']
|
285
|
+
end
|
286
|
+
|
287
|
+
##
|
288
|
+
# @return [Hash] Contains a dictionary of URL links to nested resources of this Challenge.
|
289
|
+
def links
|
290
|
+
@properties['links']
|
291
|
+
end
|
292
|
+
|
293
|
+
##
|
294
|
+
# Provide a user friendly representation
|
295
|
+
def to_s
|
296
|
+
"<Twilio.Verify.V2.ApproveChallengeInstance>"
|
297
|
+
end
|
298
|
+
|
299
|
+
##
|
300
|
+
# Provide a detailed, user friendly representation
|
301
|
+
def inspect
|
302
|
+
"<Twilio.Verify.V2.ApproveChallengeInstance>"
|
303
|
+
end
|
304
|
+
end
|
305
|
+
|
306
|
+
end
|
307
|
+
end
|
308
|
+
end
|
309
|
+
end
|
310
|
+
end
|
311
|
+
|
312
|
+
|
@@ -0,0 +1,340 @@
|
|
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 NewChallengeList < ListResource
|
23
|
+
|
24
|
+
class CreatePasskeysChallengeRequest
|
25
|
+
# @param [identity]: [String]
|
26
|
+
# @param [factor_sid]: [String]
|
27
|
+
attr_accessor :identity, :factor_sid
|
28
|
+
def initialize(payload)
|
29
|
+
@identity = payload["identity"]
|
30
|
+
@factor_sid = payload["factor_sid"]
|
31
|
+
end
|
32
|
+
def to_json(options = {})
|
33
|
+
{
|
34
|
+
"identity": @identity,
|
35
|
+
"factor_sid": @factor_sid,
|
36
|
+
}.to_json(options)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
|
41
|
+
##
|
42
|
+
# Initialize the NewChallengeList
|
43
|
+
# @param [Version] version Version that contains the resource
|
44
|
+
# @return [NewChallengeList] NewChallengeList
|
45
|
+
def initialize(version, service_sid: nil)
|
46
|
+
super(version)
|
47
|
+
# Path Solution
|
48
|
+
@solution = { service_sid: service_sid }
|
49
|
+
|
50
|
+
|
51
|
+
end
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
# Provide a user friendly representation
|
56
|
+
def to_s
|
57
|
+
'#<Twilio.Verify.V2.NewChallengeList>'
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
|
62
|
+
class NewChallengeContext < InstanceContext
|
63
|
+
##
|
64
|
+
# Initialize the NewChallengeContext
|
65
|
+
# @param [Version] version Version that contains the resource
|
66
|
+
# @param [String] service_sid The unique SID identifier of the Service.
|
67
|
+
# @return [NewChallengeContext] NewChallengeContext
|
68
|
+
def initialize(version, service_sid)
|
69
|
+
super(version)
|
70
|
+
|
71
|
+
# Path Solution
|
72
|
+
@solution = { service_sid: service_sid, }
|
73
|
+
@uri = "/Services/#{@solution[:service_sid]}/Passkeys/Challenges"
|
74
|
+
|
75
|
+
|
76
|
+
end
|
77
|
+
##
|
78
|
+
# Create the NewChallengeInstance
|
79
|
+
# @param [CreatePasskeysChallengeRequest] create_passkeys_challenge_request
|
80
|
+
# @return [NewChallengeInstance] Created NewChallengeInstance
|
81
|
+
def create(create_passkeys_challenge_request: nil
|
82
|
+
)
|
83
|
+
|
84
|
+
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
85
|
+
headers['Content-Type'] = 'application/json'
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
payload = @version.create('POST', @uri, headers: headers, data: create_passkeys_challenge_request.to_json)
|
91
|
+
NewChallengeInstance.new(
|
92
|
+
@version,
|
93
|
+
payload,
|
94
|
+
service_sid: @solution[:service_sid],
|
95
|
+
)
|
96
|
+
end
|
97
|
+
|
98
|
+
|
99
|
+
##
|
100
|
+
# Provide a user friendly representation
|
101
|
+
def to_s
|
102
|
+
context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
|
103
|
+
"#<Twilio.Verify.V2.NewChallengeContext #{context}>"
|
104
|
+
end
|
105
|
+
|
106
|
+
##
|
107
|
+
# Provide a detailed, user friendly representation
|
108
|
+
def inspect
|
109
|
+
context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
|
110
|
+
"#<Twilio.Verify.V2.NewChallengeContext #{context}>"
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
class NewChallengePage < Page
|
115
|
+
##
|
116
|
+
# Initialize the NewChallengePage
|
117
|
+
# @param [Version] version Version that contains the resource
|
118
|
+
# @param [Response] response Response from the API
|
119
|
+
# @param [Hash] solution Path solution for the resource
|
120
|
+
# @return [NewChallengePage] NewChallengePage
|
121
|
+
def initialize(version, response, solution)
|
122
|
+
super(version, response)
|
123
|
+
|
124
|
+
# Path Solution
|
125
|
+
@solution = solution
|
126
|
+
end
|
127
|
+
|
128
|
+
##
|
129
|
+
# Build an instance of NewChallengeInstance
|
130
|
+
# @param [Hash] payload Payload response from the API
|
131
|
+
# @return [NewChallengeInstance] NewChallengeInstance
|
132
|
+
def get_instance(payload)
|
133
|
+
NewChallengeInstance.new(@version, payload, service_sid: @solution[:service_sid])
|
134
|
+
end
|
135
|
+
|
136
|
+
##
|
137
|
+
# Provide a user friendly representation
|
138
|
+
def to_s
|
139
|
+
'<Twilio.Verify.V2.NewChallengePage>'
|
140
|
+
end
|
141
|
+
end
|
142
|
+
class NewChallengeInstance < InstanceResource
|
143
|
+
##
|
144
|
+
# Initialize the NewChallengeInstance
|
145
|
+
# @param [Version] version Version that contains the resource
|
146
|
+
# @param [Hash] payload payload that contains response from Twilio
|
147
|
+
# @param [String] account_sid The SID of the
|
148
|
+
# {Account}[https://www.twilio.com/docs/iam/api/account] that created this NewChallenge
|
149
|
+
# resource.
|
150
|
+
# @param [String] sid The SID of the Call resource to fetch.
|
151
|
+
# @return [NewChallengeInstance] NewChallengeInstance
|
152
|
+
def initialize(version, payload , service_sid: nil)
|
153
|
+
super(version)
|
154
|
+
|
155
|
+
# Marshaled Properties
|
156
|
+
@properties = {
|
157
|
+
'options' => payload['options'],
|
158
|
+
'sid' => payload['sid'],
|
159
|
+
'account_sid' => payload['account_sid'],
|
160
|
+
'service_sid' => payload['service_sid'],
|
161
|
+
'entity_sid' => payload['entity_sid'],
|
162
|
+
'identity' => payload['identity'],
|
163
|
+
'factor_sid' => payload['factor_sid'],
|
164
|
+
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
165
|
+
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
166
|
+
'date_responded' => Twilio.deserialize_iso8601_datetime(payload['date_responded']),
|
167
|
+
'expiration_date' => Twilio.deserialize_iso8601_datetime(payload['expiration_date']),
|
168
|
+
'status' => payload['status'],
|
169
|
+
'responded_reason' => payload['responded_reason'],
|
170
|
+
'details' => payload['details'],
|
171
|
+
'hidden_details' => payload['hidden_details'],
|
172
|
+
'metadata' => payload['metadata'],
|
173
|
+
'factor_type' => payload['factor_type'],
|
174
|
+
'url' => payload['url'],
|
175
|
+
'links' => payload['links'],
|
176
|
+
}
|
177
|
+
|
178
|
+
# Context
|
179
|
+
@instance_context = nil
|
180
|
+
@params = { 'service_sid' => service_sid || @properties['service_sid'] , }
|
181
|
+
end
|
182
|
+
|
183
|
+
##
|
184
|
+
# Generate an instance context for the instance, the context is capable of
|
185
|
+
# performing various actions. All instance actions are proxied to the context
|
186
|
+
# @return [NewChallengeContext] CallContext for this CallInstance
|
187
|
+
def context
|
188
|
+
unless @instance_context
|
189
|
+
@instance_context = NewChallengeContext.new(@version , @params['service_sid'])
|
190
|
+
end
|
191
|
+
@instance_context
|
192
|
+
end
|
193
|
+
|
194
|
+
##
|
195
|
+
# @return [Hash] An object that contains challenge options. Currently only used for `passkeys`.
|
196
|
+
def options
|
197
|
+
@properties['options']
|
198
|
+
end
|
199
|
+
|
200
|
+
##
|
201
|
+
# @return [String] A 34 character string that uniquely identifies this Challenge.
|
202
|
+
def sid
|
203
|
+
@properties['sid']
|
204
|
+
end
|
205
|
+
|
206
|
+
##
|
207
|
+
# @return [String] The unique SID identifier of the Account.
|
208
|
+
def account_sid
|
209
|
+
@properties['account_sid']
|
210
|
+
end
|
211
|
+
|
212
|
+
##
|
213
|
+
# @return [String] The unique SID identifier of the Service.
|
214
|
+
def service_sid
|
215
|
+
@properties['service_sid']
|
216
|
+
end
|
217
|
+
|
218
|
+
##
|
219
|
+
# @return [String] The unique SID identifier of the Entity.
|
220
|
+
def entity_sid
|
221
|
+
@properties['entity_sid']
|
222
|
+
end
|
223
|
+
|
224
|
+
##
|
225
|
+
# @return [String] Customer unique identity for the Entity owner of the Challenge.
|
226
|
+
def identity
|
227
|
+
@properties['identity']
|
228
|
+
end
|
229
|
+
|
230
|
+
##
|
231
|
+
# @return [String] The unique SID identifier of the Factor.
|
232
|
+
def factor_sid
|
233
|
+
@properties['factor_sid']
|
234
|
+
end
|
235
|
+
|
236
|
+
##
|
237
|
+
# @return [Time] The date that this Challenge was created, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
238
|
+
def date_created
|
239
|
+
@properties['date_created']
|
240
|
+
end
|
241
|
+
|
242
|
+
##
|
243
|
+
# @return [Time] The date that this Challenge was updated, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
244
|
+
def date_updated
|
245
|
+
@properties['date_updated']
|
246
|
+
end
|
247
|
+
|
248
|
+
##
|
249
|
+
# @return [Time] The date that this Challenge was responded, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
250
|
+
def date_responded
|
251
|
+
@properties['date_responded']
|
252
|
+
end
|
253
|
+
|
254
|
+
##
|
255
|
+
# @return [Time] The date-time when this Challenge expires, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
256
|
+
def expiration_date
|
257
|
+
@properties['expiration_date']
|
258
|
+
end
|
259
|
+
|
260
|
+
##
|
261
|
+
# @return [String] The Status of this Challenge. One of `pending`, `expired`, `approved` or `denied`.
|
262
|
+
def status
|
263
|
+
@properties['status']
|
264
|
+
end
|
265
|
+
|
266
|
+
##
|
267
|
+
# @return [String] Reason for the Challenge to be in certain `status`. One of `none`, `not_needed` or `not_requested`.
|
268
|
+
def responded_reason
|
269
|
+
@properties['responded_reason']
|
270
|
+
end
|
271
|
+
|
272
|
+
##
|
273
|
+
# @return [Hash] Details provided to give context about the Challenge.
|
274
|
+
def details
|
275
|
+
@properties['details']
|
276
|
+
end
|
277
|
+
|
278
|
+
##
|
279
|
+
# @return [Hash] Details provided to give context about the Challenge.
|
280
|
+
def hidden_details
|
281
|
+
@properties['hidden_details']
|
282
|
+
end
|
283
|
+
|
284
|
+
##
|
285
|
+
# @return [Hash] Custom metadata associated with the challenge.
|
286
|
+
def metadata
|
287
|
+
@properties['metadata']
|
288
|
+
end
|
289
|
+
|
290
|
+
##
|
291
|
+
# @return [String] The Factor Type of this Challenge. Currently `push` and `totp` are supported.
|
292
|
+
def factor_type
|
293
|
+
@properties['factor_type']
|
294
|
+
end
|
295
|
+
|
296
|
+
##
|
297
|
+
# @return [String] The URL of this resource.
|
298
|
+
def url
|
299
|
+
@properties['url']
|
300
|
+
end
|
301
|
+
|
302
|
+
##
|
303
|
+
# @return [Hash] Contains a dictionary of URL links to nested resources of this Challenge.
|
304
|
+
def links
|
305
|
+
@properties['links']
|
306
|
+
end
|
307
|
+
|
308
|
+
##
|
309
|
+
# Create the NewChallengeInstance
|
310
|
+
# @param [CreatePasskeysChallengeRequest] create_passkeys_challenge_request
|
311
|
+
# @return [NewChallengeInstance] Created NewChallengeInstance
|
312
|
+
def create(create_passkeys_challenge_request: nil
|
313
|
+
)
|
314
|
+
|
315
|
+
context.create(
|
316
|
+
)
|
317
|
+
end
|
318
|
+
|
319
|
+
##
|
320
|
+
# Provide a user friendly representation
|
321
|
+
def to_s
|
322
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
323
|
+
"<Twilio.Verify.V2.NewChallengeInstance #{values}>"
|
324
|
+
end
|
325
|
+
|
326
|
+
##
|
327
|
+
# Provide a detailed, user friendly representation
|
328
|
+
def inspect
|
329
|
+
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
330
|
+
"<Twilio.Verify.V2.NewChallengeInstance #{values}>"
|
331
|
+
end
|
332
|
+
end
|
333
|
+
|
334
|
+
end
|
335
|
+
end
|
336
|
+
end
|
337
|
+
end
|
338
|
+
end
|
339
|
+
|
340
|
+
|