twilio-ruby 7.8.1 → 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 +7 -0
- data/README.md +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +5 -2
- data/lib/twilio-ruby/rest/client.rb +5 -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 +93 -5
- data/lib/twilio-ruby/rest/oauth/v2/token.rb +2 -2
- data/lib/twilio-ruby/rest/verify/v2/service/approve_challenge.rb +312 -0
- data/lib/twilio-ruby/rest/verify/v2/{new_challenge.rb → service/new_challenge.rb} +9 -4
- data/lib/twilio-ruby/rest/verify/v2/service/new_factor.rb +171 -1
- data/lib/twilio-ruby/rest/verify/v2/service.rb +49 -12
- data/lib/twilio-ruby/rest/verify/v2.rb +0 -15
- data/lib/twilio-ruby/version.rb +1 -1
- metadata +11 -3
@@ -0,0 +1,38 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
4
|
+
# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
5
|
+
# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
6
|
+
#
|
7
|
+
# NOTE: This class is auto generated by OpenAPI Generator.
|
8
|
+
# https://openapi-generator.tech
|
9
|
+
# Do not edit the class manually.
|
10
|
+
# frozen_string_literal: true
|
11
|
+
module Twilio
|
12
|
+
module REST
|
13
|
+
class KnowledgeBase < Domain
|
14
|
+
##
|
15
|
+
# Initialize knowledge domain
|
16
|
+
#
|
17
|
+
# @param twilio - The twilio client
|
18
|
+
#
|
19
|
+
def initialize(twilio)
|
20
|
+
super(twilio)
|
21
|
+
@base_url = "https://knowledge.twilio.com"
|
22
|
+
@host = "knowledge.twilio.com"
|
23
|
+
@port = 443
|
24
|
+
@v1 = nil
|
25
|
+
end
|
26
|
+
|
27
|
+
def v1
|
28
|
+
@v1 ||= Knowledge::V1.new self
|
29
|
+
end
|
30
|
+
|
31
|
+
##
|
32
|
+
# Provide a user friendly representation
|
33
|
+
def to_s
|
34
|
+
'<Twilio::REST::Knowledge::V1>';
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,140 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
4
|
+
# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
5
|
+
# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
6
|
+
#
|
7
|
+
# Twilio - Messaging
|
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 Messaging < MessagingBase
|
19
|
+
class V2 < Version
|
20
|
+
class TypingIndicatorList < ListResource
|
21
|
+
|
22
|
+
##
|
23
|
+
# Initialize the TypingIndicatorList
|
24
|
+
# @param [Version] version Version that contains the resource
|
25
|
+
# @return [TypingIndicatorList] TypingIndicatorList
|
26
|
+
def initialize(version)
|
27
|
+
super(version)
|
28
|
+
# Path Solution
|
29
|
+
@solution = { }
|
30
|
+
@uri = "/Indicators/Typing.json"
|
31
|
+
|
32
|
+
end
|
33
|
+
##
|
34
|
+
# Create the TypingIndicatorInstance
|
35
|
+
# @param [String] channel Shared channel identifier
|
36
|
+
# @param [String] message_id Message SID that identifies the conversation thread for the typing indicator. Must be a valid Twilio Message SID (SM*) or Media SID (MM*) from an existing WhatsApp conversation.
|
37
|
+
# @return [TypingIndicatorInstance] Created TypingIndicatorInstance
|
38
|
+
def create(
|
39
|
+
channel: nil,
|
40
|
+
message_id: nil
|
41
|
+
)
|
42
|
+
|
43
|
+
data = Twilio::Values.of({
|
44
|
+
'channel' => channel,
|
45
|
+
'messageId' => message_id,
|
46
|
+
})
|
47
|
+
|
48
|
+
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
49
|
+
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
|
54
|
+
payload = @version.create('POST', @uri, data: data, headers: headers)
|
55
|
+
TypingIndicatorInstance.new(
|
56
|
+
@version,
|
57
|
+
payload,
|
58
|
+
)
|
59
|
+
end
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
|
64
|
+
# Provide a user friendly representation
|
65
|
+
def to_s
|
66
|
+
'#<Twilio.Messaging.V2.TypingIndicatorList>'
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
class TypingIndicatorPage < Page
|
71
|
+
##
|
72
|
+
# Initialize the TypingIndicatorPage
|
73
|
+
# @param [Version] version Version that contains the resource
|
74
|
+
# @param [Response] response Response from the API
|
75
|
+
# @param [Hash] solution Path solution for the resource
|
76
|
+
# @return [TypingIndicatorPage] TypingIndicatorPage
|
77
|
+
def initialize(version, response, solution)
|
78
|
+
super(version, response)
|
79
|
+
|
80
|
+
# Path Solution
|
81
|
+
@solution = solution
|
82
|
+
end
|
83
|
+
|
84
|
+
##
|
85
|
+
# Build an instance of TypingIndicatorInstance
|
86
|
+
# @param [Hash] payload Payload response from the API
|
87
|
+
# @return [TypingIndicatorInstance] TypingIndicatorInstance
|
88
|
+
def get_instance(payload)
|
89
|
+
TypingIndicatorInstance.new(@version, payload)
|
90
|
+
end
|
91
|
+
|
92
|
+
##
|
93
|
+
# Provide a user friendly representation
|
94
|
+
def to_s
|
95
|
+
'<Twilio.Messaging.V2.TypingIndicatorPage>'
|
96
|
+
end
|
97
|
+
end
|
98
|
+
class TypingIndicatorInstance < InstanceResource
|
99
|
+
##
|
100
|
+
# Initialize the TypingIndicatorInstance
|
101
|
+
# @param [Version] version Version that contains the resource
|
102
|
+
# @param [Hash] payload payload that contains response from Twilio
|
103
|
+
# @param [String] account_sid The SID of the
|
104
|
+
# {Account}[https://www.twilio.com/docs/iam/api/account] that created this TypingIndicator
|
105
|
+
# resource.
|
106
|
+
# @param [String] sid The SID of the Call resource to fetch.
|
107
|
+
# @return [TypingIndicatorInstance] TypingIndicatorInstance
|
108
|
+
def initialize(version, payload )
|
109
|
+
super(version)
|
110
|
+
|
111
|
+
# Marshaled Properties
|
112
|
+
@properties = {
|
113
|
+
'success' => payload['success'],
|
114
|
+
}
|
115
|
+
end
|
116
|
+
|
117
|
+
|
118
|
+
##
|
119
|
+
# @return [Boolean] Indicates if the typing indicator was sent successfully.
|
120
|
+
def success
|
121
|
+
@properties['success']
|
122
|
+
end
|
123
|
+
|
124
|
+
##
|
125
|
+
# Provide a user friendly representation
|
126
|
+
def to_s
|
127
|
+
"<Twilio.Messaging.V2.TypingIndicatorInstance>"
|
128
|
+
end
|
129
|
+
|
130
|
+
##
|
131
|
+
# Provide a detailed, user friendly representation
|
132
|
+
def inspect
|
133
|
+
"<Twilio.Messaging.V2.TypingIndicatorInstance>"
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
end
|
138
|
+
end
|
139
|
+
end
|
140
|
+
end
|
@@ -22,6 +22,7 @@ module Twilio
|
|
22
22
|
super
|
23
23
|
@version = 'v2'
|
24
24
|
@channels_senders = nil
|
25
|
+
@typing_indicator = nil
|
25
26
|
end
|
26
27
|
|
27
28
|
##
|
@@ -39,6 +40,11 @@ module Twilio
|
|
39
40
|
end
|
40
41
|
end
|
41
42
|
##
|
43
|
+
# @return [Twilio::REST::Messaging::V2::TypingIndicatorList]
|
44
|
+
def typing_indicator
|
45
|
+
@typing_indicator ||= TypingIndicatorList.new self
|
46
|
+
end
|
47
|
+
##
|
42
48
|
# Provide a user friendly representation
|
43
49
|
def to_s
|
44
50
|
'<Twilio::REST::Messaging::V2>';
|
@@ -19,6 +19,94 @@ module Twilio
|
|
19
19
|
class V1 < Version
|
20
20
|
class PortingPortInList < ListResource
|
21
21
|
|
22
|
+
class NumbersV1PortingAddress
|
23
|
+
# @param [street]: [String] The street address, ex: 101 Spear St
|
24
|
+
# @param [street_2]: [String] The building information, ex : 5th floor.
|
25
|
+
# @param [city]: [String] The city name, ex: San Francisco.
|
26
|
+
# @param [state]: [String] The state name, ex: CA or California. Note this should match the losing carrier’s information exactly. So if they spell out the entire state’s name instead of abbreviating it, please do so.
|
27
|
+
# @param [zip]: [String] The zip code, ex: 94105.
|
28
|
+
# @param [country]: [String] The country, ex: USA.
|
29
|
+
attr_accessor :street, :street_2, :city, :state, :zip, :country
|
30
|
+
def initialize(payload)
|
31
|
+
@street = payload["street"]
|
32
|
+
@street_2 = payload["street_2"]
|
33
|
+
@city = payload["city"]
|
34
|
+
@state = payload["state"]
|
35
|
+
@zip = payload["zip"]
|
36
|
+
@country = payload["country"]
|
37
|
+
end
|
38
|
+
def to_json(options = {})
|
39
|
+
{
|
40
|
+
"street": @street,
|
41
|
+
"street_2": @street_2,
|
42
|
+
"city": @city,
|
43
|
+
"state": @state,
|
44
|
+
"zip": @zip,
|
45
|
+
"country": @country,
|
46
|
+
}.to_json(options)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
class NumbersV1PortingPortInCreate
|
51
|
+
# @param [account_sid]: [String] Account Sid or subaccount where the phone number(s) will be Ported
|
52
|
+
# @param [documents]: [Array<String>] List of document SIDs for all phone numbers included in the port in request. At least one document SID referring to a document of the type Utility Bill is required.
|
53
|
+
# @param [phone_numbers]: [Array<PortingPortInList.NumbersV1PortingPortInCreatePhoneNumbers>] List of phone numbers to be ported. Maximum of 1,000 phone numbers per request.
|
54
|
+
# @param [losing_carrier_information]: [PortingPortInList.NumbersV1PortingLosingCarrierInformation]
|
55
|
+
# @param [notification_emails]: [Array<String>] Additional emails to send a copy of the signed LOA to.
|
56
|
+
# @param [target_port_in_date]: [Date] Target date to port the number. We cannot guarantee that this date will be honored by the other carriers, please work with Ops to get a confirmation of the firm order commitment (FOC) date. Expected format is ISO Local Date, example: ‘2011-12-03`. This date must be at least 7 days in the future for US ports and 10 days in the future for Japanese ports. We can't guarantee the exact date and time, as this depends on the losing carrier
|
57
|
+
# @param [target_port_in_time_range_start]: [String] The earliest time that the port should occur on the target port in date. Expected format is ISO Offset Time, example: ‘10:15:00-08:00'. We can't guarantee the exact date and time, as this depends on the losing carrier
|
58
|
+
# @param [target_port_in_time_range_end]: [String] The latest time that the port should occur on the target port in date. Expected format is ISO Offset Time, example: ‘10:15:00-08:00'. We can't guarantee the exact date and time, as this depends on the losing carrier
|
59
|
+
# @param [bundle_sid]: [String] The bundle sid is an optional identifier to reference a group of regulatory documents for a port request.
|
60
|
+
# @param [portability_advance_carrier]: [String] A field only required for Japan port in requests. It is a unique identifier for the donor carrier service the line is being ported from.
|
61
|
+
# @param [auto_cancel_approval_numbers]: [String] Japan specific field, indicates the number of phone numbers to automatically approve for cancellation.
|
62
|
+
attr_accessor :account_sid, :documents, :phone_numbers, :losing_carrier_information, :notification_emails, :target_port_in_date, :target_port_in_time_range_start, :target_port_in_time_range_end, :bundle_sid, :portability_advance_carrier, :auto_cancel_approval_numbers
|
63
|
+
def initialize(payload)
|
64
|
+
@account_sid = payload["account_sid"]
|
65
|
+
@documents = payload["documents"]
|
66
|
+
@phone_numbers = payload["phone_numbers"]
|
67
|
+
@losing_carrier_information = payload["losing_carrier_information"]
|
68
|
+
@notification_emails = payload["notification_emails"]
|
69
|
+
@target_port_in_date = payload["target_port_in_date"]
|
70
|
+
@target_port_in_time_range_start = payload["target_port_in_time_range_start"]
|
71
|
+
@target_port_in_time_range_end = payload["target_port_in_time_range_end"]
|
72
|
+
@bundle_sid = payload["bundle_sid"]
|
73
|
+
@portability_advance_carrier = payload["portability_advance_carrier"]
|
74
|
+
@auto_cancel_approval_numbers = payload["auto_cancel_approval_numbers"]
|
75
|
+
end
|
76
|
+
def to_json(options = {})
|
77
|
+
{
|
78
|
+
"account_sid": @account_sid,
|
79
|
+
"documents": @documents,
|
80
|
+
"phone_numbers": @phone_numbers,
|
81
|
+
"losing_carrier_information": @losing_carrier_information,
|
82
|
+
"notification_emails": @notification_emails,
|
83
|
+
"target_port_in_date": @target_port_in_date,
|
84
|
+
"target_port_in_time_range_start": @target_port_in_time_range_start,
|
85
|
+
"target_port_in_time_range_end": @target_port_in_time_range_end,
|
86
|
+
"bundle_sid": @bundle_sid,
|
87
|
+
"portability_advance_carrier": @portability_advance_carrier,
|
88
|
+
"auto_cancel_approval_numbers": @auto_cancel_approval_numbers,
|
89
|
+
}.to_json(options)
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
class NumbersV1PortingPortInCreatePhoneNumbers
|
94
|
+
# @param [phone_number]: [String] Phone number to be ported. This must be in the E164 Format.
|
95
|
+
# @param [pin]: [String] Some losing carriers require a PIN to authorize the port of a phone number. If the phone number is a US mobile phone number, the PIN is mandatory to process a porting request. Other carriers and number types may also require a PIN, you'll need to contact the losing carrier to determine what your phone number's PIN is.
|
96
|
+
attr_accessor :phone_number, :pin
|
97
|
+
def initialize(payload)
|
98
|
+
@phone_number = payload["phone_number"]
|
99
|
+
@pin = payload["pin"]
|
100
|
+
end
|
101
|
+
def to_json(options = {})
|
102
|
+
{
|
103
|
+
"phone_number": @phone_number,
|
104
|
+
"pin": @pin,
|
105
|
+
}.to_json(options)
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
|
22
110
|
##
|
23
111
|
# Initialize the PortingPortInList
|
24
112
|
# @param [Version] version Version that contains the resource
|
@@ -32,9 +120,9 @@ module Twilio
|
|
32
120
|
end
|
33
121
|
##
|
34
122
|
# Create the PortingPortInInstance
|
35
|
-
# @param [
|
123
|
+
# @param [NumbersV1PortingPortInCreate] numbers_v1_porting_port_in_create
|
36
124
|
# @return [PortingPortInInstance] Created PortingPortInInstance
|
37
|
-
def create(
|
125
|
+
def create(numbers_v1_porting_port_in_create: nil
|
38
126
|
)
|
39
127
|
|
40
128
|
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
@@ -43,7 +131,7 @@ module Twilio
|
|
43
131
|
|
44
132
|
|
45
133
|
|
46
|
-
payload = @version.create('POST', @uri, headers: headers, data:
|
134
|
+
payload = @version.create('POST', @uri, headers: headers, data: numbers_v1_porting_port_in_create.to_json)
|
47
135
|
PortingPortInInstance.new(
|
48
136
|
@version,
|
49
137
|
payload,
|
@@ -247,13 +335,13 @@ module Twilio
|
|
247
335
|
end
|
248
336
|
|
249
337
|
##
|
250
|
-
# @return [
|
338
|
+
# @return [NumbersV1PortingLosingCarrierInformation]
|
251
339
|
def losing_carrier_information
|
252
340
|
@properties['losing_carrier_information']
|
253
341
|
end
|
254
342
|
|
255
343
|
##
|
256
|
-
# @return [Array<
|
344
|
+
# @return [Array<NumbersV1PortingPortInPhoneNumberResult>]
|
257
345
|
def phone_numbers
|
258
346
|
@properties['phone_numbers']
|
259
347
|
end
|
@@ -42,8 +42,8 @@ module Twilio
|
|
42
42
|
# @param [String] scope The scope of token
|
43
43
|
# @return [TokenInstance] Created TokenInstance
|
44
44
|
def create(
|
45
|
-
grant_type:
|
46
|
-
client_id:
|
45
|
+
grant_type: :unset,
|
46
|
+
client_id: :unset,
|
47
47
|
client_secret: :unset,
|
48
48
|
code: :unset,
|
49
49
|
redirect_uri: :unset,
|
@@ -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
|
+
|