twilio-ruby 5.22.0 → 5.22.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 +15 -0
- data/README.md +2 -2
- data/lib/twilio-ruby/rest/client.rb +7 -0
- data/lib/twilio-ruby/rest/flex_api/v1/configuration.rb +14 -0
- data/lib/twilio-ruby/rest/messaging/v1/session.rb +1 -7
- data/lib/twilio-ruby/rest/proxy/v1/service/phone_number.rb +34 -32
- data/lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb +37 -35
- data/lib/twilio-ruby/rest/proxy/v1/service/session/participant/message_interaction.rb +45 -38
- data/lib/twilio-ruby/rest/proxy/v1/service/session/participant.rb +38 -34
- data/lib/twilio-ruby/rest/proxy/v1/service/session.rb +67 -52
- data/lib/twilio-ruby/rest/proxy/v1/service/short_code.rb +32 -23
- data/lib/twilio-ruby/rest/proxy/v1/service.rb +123 -79
- data/lib/twilio-ruby/rest/proxy/v1.rb +2 -1
- data/lib/twilio-ruby/rest/proxy.rb +2 -1
- data/lib/twilio-ruby/rest/serverless/v1/service/asset/asset_version.rb +366 -0
- data/lib/twilio-ruby/rest/serverless/v1/service/asset.rb +384 -0
- data/lib/twilio-ruby/rest/serverless/v1/service/build.rb +348 -0
- data/lib/twilio-ruby/rest/serverless/v1/service/environment/deployment.rb +358 -0
- data/lib/twilio-ruby/rest/serverless/v1/service/environment/variable.rb +398 -0
- data/lib/twilio-ruby/rest/serverless/v1/service/environment.rb +417 -0
- data/lib/twilio-ruby/rest/serverless/v1/service/function/function_version.rb +366 -0
- data/lib/twilio-ruby/rest/serverless/v1/service/function.rb +384 -0
- data/lib/twilio-ruby/rest/{verify → serverless}/v1/service.rb +139 -175
- data/lib/twilio-ruby/rest/{verify → serverless}/v1.rb +6 -6
- data/lib/twilio-ruby/rest/serverless.rb +46 -0
- data/lib/twilio-ruby/rest/trunking/v1/trunk/terminating_sip_domain.rb +419 -0
- data/lib/twilio-ruby/rest/trunking/v1/trunk.rb +26 -0
- data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +46 -38
- data/lib/twilio-ruby/rest/verify/v2/service/verification_check.rb +24 -20
- data/lib/twilio-ruby/rest/verify/v2/service.rb +59 -57
- data/lib/twilio-ruby/rest/verify/v2.rb +2 -1
- data/lib/twilio-ruby/rest/verify.rb +2 -8
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/integration/flex_api/v1/configuration_spec.rb +15 -0
- data/spec/integration/messaging/v1/session/participant_spec.rb +10 -10
- data/spec/integration/serverless/v1/service/asset/asset_version_spec.rb +144 -0
- data/spec/integration/serverless/v1/service/asset_spec.rb +177 -0
- data/spec/integration/serverless/v1/service/build_spec.rb +184 -0
- data/spec/integration/serverless/v1/service/environment/deployment_spec.rb +137 -0
- data/spec/integration/serverless/v1/service/environment/variable_spec.rb +181 -0
- data/spec/integration/serverless/v1/service/environment_spec.rb +143 -0
- data/spec/integration/serverless/v1/service/function/function_version_spec.rb +144 -0
- data/spec/integration/serverless/v1/service/function_spec.rb +177 -0
- data/spec/integration/serverless/v1/service_spec.rb +180 -0
- data/spec/integration/trunking/v1/trunk/terminating_sip_domain_spec.rb +231 -0
- data/spec/integration/trunking/v1/trunk_spec.rb +12 -6
- metadata +34 -12
- data/lib/twilio-ruby/rest/verify/v1/service/verification.rb +0 -340
- data/lib/twilio-ruby/rest/verify/v1/service/verification_check.rb +0 -209
- data/spec/integration/verify/v1/service/verification_check_spec.rb +0 -54
- data/spec/integration/verify/v1/service/verification_spec.rb +0 -169
- data/spec/integration/verify/v1/service_spec.rb +0 -231
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.22.
|
4
|
+
version: 5.22.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: 2019-
|
11
|
+
date: 2019-04-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jwt
|
@@ -423,6 +423,17 @@ files:
|
|
423
423
|
- lib/twilio-ruby/rest/proxy/v1/service/session/participant.rb
|
424
424
|
- lib/twilio-ruby/rest/proxy/v1/service/session/participant/message_interaction.rb
|
425
425
|
- lib/twilio-ruby/rest/proxy/v1/service/short_code.rb
|
426
|
+
- lib/twilio-ruby/rest/serverless.rb
|
427
|
+
- lib/twilio-ruby/rest/serverless/v1.rb
|
428
|
+
- lib/twilio-ruby/rest/serverless/v1/service.rb
|
429
|
+
- lib/twilio-ruby/rest/serverless/v1/service/asset.rb
|
430
|
+
- lib/twilio-ruby/rest/serverless/v1/service/asset/asset_version.rb
|
431
|
+
- lib/twilio-ruby/rest/serverless/v1/service/build.rb
|
432
|
+
- lib/twilio-ruby/rest/serverless/v1/service/environment.rb
|
433
|
+
- lib/twilio-ruby/rest/serverless/v1/service/environment/deployment.rb
|
434
|
+
- lib/twilio-ruby/rest/serverless/v1/service/environment/variable.rb
|
435
|
+
- lib/twilio-ruby/rest/serverless/v1/service/function.rb
|
436
|
+
- lib/twilio-ruby/rest/serverless/v1/service/function/function_version.rb
|
426
437
|
- lib/twilio-ruby/rest/studio.rb
|
427
438
|
- lib/twilio-ruby/rest/studio/v1.rb
|
428
439
|
- lib/twilio-ruby/rest/studio/v1/flow.rb
|
@@ -481,11 +492,8 @@ files:
|
|
481
492
|
- lib/twilio-ruby/rest/trunking/v1/trunk/ip_access_control_list.rb
|
482
493
|
- lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb
|
483
494
|
- lib/twilio-ruby/rest/trunking/v1/trunk/phone_number.rb
|
495
|
+
- lib/twilio-ruby/rest/trunking/v1/trunk/terminating_sip_domain.rb
|
484
496
|
- lib/twilio-ruby/rest/verify.rb
|
485
|
-
- lib/twilio-ruby/rest/verify/v1.rb
|
486
|
-
- lib/twilio-ruby/rest/verify/v1/service.rb
|
487
|
-
- lib/twilio-ruby/rest/verify/v1/service/verification.rb
|
488
|
-
- lib/twilio-ruby/rest/verify/v1/service/verification_check.rb
|
489
497
|
- lib/twilio-ruby/rest/verify/v2.rb
|
490
498
|
- lib/twilio-ruby/rest/verify/v2/service.rb
|
491
499
|
- lib/twilio-ruby/rest/verify/v2/service/verification.rb
|
@@ -748,6 +756,15 @@ files:
|
|
748
756
|
- spec/integration/proxy/v1/service/session_spec.rb
|
749
757
|
- spec/integration/proxy/v1/service/short_code_spec.rb
|
750
758
|
- spec/integration/proxy/v1/service_spec.rb
|
759
|
+
- spec/integration/serverless/v1/service/asset/asset_version_spec.rb
|
760
|
+
- spec/integration/serverless/v1/service/asset_spec.rb
|
761
|
+
- spec/integration/serverless/v1/service/build_spec.rb
|
762
|
+
- spec/integration/serverless/v1/service/environment/deployment_spec.rb
|
763
|
+
- spec/integration/serverless/v1/service/environment/variable_spec.rb
|
764
|
+
- spec/integration/serverless/v1/service/environment_spec.rb
|
765
|
+
- spec/integration/serverless/v1/service/function/function_version_spec.rb
|
766
|
+
- spec/integration/serverless/v1/service/function_spec.rb
|
767
|
+
- spec/integration/serverless/v1/service_spec.rb
|
751
768
|
- spec/integration/studio/v1/flow/engagement/engagement_context_spec.rb
|
752
769
|
- spec/integration/studio/v1/flow/engagement/step/step_context_spec.rb
|
753
770
|
- spec/integration/studio/v1/flow/engagement/step_spec.rb
|
@@ -797,10 +814,8 @@ files:
|
|
797
814
|
- spec/integration/trunking/v1/trunk/ip_access_control_list_spec.rb
|
798
815
|
- spec/integration/trunking/v1/trunk/origination_url_spec.rb
|
799
816
|
- spec/integration/trunking/v1/trunk/phone_number_spec.rb
|
817
|
+
- spec/integration/trunking/v1/trunk/terminating_sip_domain_spec.rb
|
800
818
|
- spec/integration/trunking/v1/trunk_spec.rb
|
801
|
-
- spec/integration/verify/v1/service/verification_check_spec.rb
|
802
|
-
- spec/integration/verify/v1/service/verification_spec.rb
|
803
|
-
- spec/integration/verify/v1/service_spec.rb
|
804
819
|
- spec/integration/verify/v2/service/verification_check_spec.rb
|
805
820
|
- spec/integration/verify/v2/service/verification_spec.rb
|
806
821
|
- spec/integration/verify/v2/service_spec.rb
|
@@ -1094,6 +1109,15 @@ test_files:
|
|
1094
1109
|
- spec/integration/proxy/v1/service/session_spec.rb
|
1095
1110
|
- spec/integration/proxy/v1/service/short_code_spec.rb
|
1096
1111
|
- spec/integration/proxy/v1/service_spec.rb
|
1112
|
+
- spec/integration/serverless/v1/service/asset/asset_version_spec.rb
|
1113
|
+
- spec/integration/serverless/v1/service/asset_spec.rb
|
1114
|
+
- spec/integration/serverless/v1/service/build_spec.rb
|
1115
|
+
- spec/integration/serverless/v1/service/environment/deployment_spec.rb
|
1116
|
+
- spec/integration/serverless/v1/service/environment/variable_spec.rb
|
1117
|
+
- spec/integration/serverless/v1/service/environment_spec.rb
|
1118
|
+
- spec/integration/serverless/v1/service/function/function_version_spec.rb
|
1119
|
+
- spec/integration/serverless/v1/service/function_spec.rb
|
1120
|
+
- spec/integration/serverless/v1/service_spec.rb
|
1097
1121
|
- spec/integration/studio/v1/flow/engagement/engagement_context_spec.rb
|
1098
1122
|
- spec/integration/studio/v1/flow/engagement/step/step_context_spec.rb
|
1099
1123
|
- spec/integration/studio/v1/flow/engagement/step_spec.rb
|
@@ -1143,10 +1167,8 @@ test_files:
|
|
1143
1167
|
- spec/integration/trunking/v1/trunk/ip_access_control_list_spec.rb
|
1144
1168
|
- spec/integration/trunking/v1/trunk/origination_url_spec.rb
|
1145
1169
|
- spec/integration/trunking/v1/trunk/phone_number_spec.rb
|
1170
|
+
- spec/integration/trunking/v1/trunk/terminating_sip_domain_spec.rb
|
1146
1171
|
- spec/integration/trunking/v1/trunk_spec.rb
|
1147
|
-
- spec/integration/verify/v1/service/verification_check_spec.rb
|
1148
|
-
- spec/integration/verify/v1/service/verification_spec.rb
|
1149
|
-
- spec/integration/verify/v1/service_spec.rb
|
1150
1172
|
- spec/integration/verify/v2/service/verification_check_spec.rb
|
1151
1173
|
- spec/integration/verify/v2/service/verification_spec.rb
|
1152
1174
|
- spec/integration/verify/v2/service_spec.rb
|
@@ -1,340 +0,0 @@
|
|
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 Verify < Domain
|
12
|
-
class V1 < Version
|
13
|
-
class ServiceContext < InstanceContext
|
14
|
-
##
|
15
|
-
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
16
|
-
class VerificationList < ListResource
|
17
|
-
##
|
18
|
-
# Initialize the VerificationList
|
19
|
-
# @param [Version] version Version that contains the resource
|
20
|
-
# @param [String] service_sid The unique SID identifier of the Service.
|
21
|
-
# @return [VerificationList] VerificationList
|
22
|
-
def initialize(version, service_sid: nil)
|
23
|
-
super(version)
|
24
|
-
|
25
|
-
# Path Solution
|
26
|
-
@solution = {service_sid: service_sid}
|
27
|
-
@uri = "/Services/#{@solution[:service_sid]}/Verifications"
|
28
|
-
end
|
29
|
-
|
30
|
-
##
|
31
|
-
# Retrieve a single page of VerificationInstance records from the API.
|
32
|
-
# Request is executed immediately.
|
33
|
-
# @param [String] to The To phonenumber of the phone being verified
|
34
|
-
# @param [String] channel The method in which the phone will be verified. Either
|
35
|
-
# sms or call
|
36
|
-
# @param [String] send_digits Digits to send when a phone call is started, same
|
37
|
-
# parameters as in Programmable Voice are supported
|
38
|
-
# @param [String] locale Supported values are af, ar, ca, cs, da, de, el, en, es,
|
39
|
-
# fi, fr, he, hi, hr, hu, id, it, ja, ko, ms, nb, nl, pl, pt, pr-BR, ro, ru, sv,
|
40
|
-
# th, tl, tr, vi, zh, zh-CN, zh-HK
|
41
|
-
# @param [String] custom_code Pass in a pre-generated code. Code length can be
|
42
|
-
# between 4-10 characters.
|
43
|
-
# @param [String] amount Amount of the associated PSD2 compliant transaction.
|
44
|
-
# Requires the PSD2 Service flag enabled.
|
45
|
-
# @param [String] payee Payee of the associated PSD2 compliant transaction.
|
46
|
-
# Requires the PSD2 Service flag enabled.
|
47
|
-
# @return [VerificationInstance] Newly created VerificationInstance
|
48
|
-
def create(to: nil, channel: nil, send_digits: :unset, locale: :unset, custom_code: :unset, amount: :unset, payee: :unset)
|
49
|
-
data = Twilio::Values.of({
|
50
|
-
'To' => to,
|
51
|
-
'Channel' => channel,
|
52
|
-
'SendDigits' => send_digits,
|
53
|
-
'Locale' => locale,
|
54
|
-
'CustomCode' => custom_code,
|
55
|
-
'Amount' => amount,
|
56
|
-
'Payee' => payee,
|
57
|
-
})
|
58
|
-
|
59
|
-
payload = @version.create(
|
60
|
-
'POST',
|
61
|
-
@uri,
|
62
|
-
data: data
|
63
|
-
)
|
64
|
-
|
65
|
-
VerificationInstance.new(@version, payload, service_sid: @solution[:service_sid], )
|
66
|
-
end
|
67
|
-
|
68
|
-
##
|
69
|
-
# Provide a user friendly representation
|
70
|
-
def to_s
|
71
|
-
'#<Twilio.Verify.V1.VerificationList>'
|
72
|
-
end
|
73
|
-
end
|
74
|
-
|
75
|
-
##
|
76
|
-
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
77
|
-
class VerificationPage < Page
|
78
|
-
##
|
79
|
-
# Initialize the VerificationPage
|
80
|
-
# @param [Version] version Version that contains the resource
|
81
|
-
# @param [Response] response Response from the API
|
82
|
-
# @param [Hash] solution Path solution for the resource
|
83
|
-
# @return [VerificationPage] VerificationPage
|
84
|
-
def initialize(version, response, solution)
|
85
|
-
super(version, response)
|
86
|
-
|
87
|
-
# Path Solution
|
88
|
-
@solution = solution
|
89
|
-
end
|
90
|
-
|
91
|
-
##
|
92
|
-
# Build an instance of VerificationInstance
|
93
|
-
# @param [Hash] payload Payload response from the API
|
94
|
-
# @return [VerificationInstance] VerificationInstance
|
95
|
-
def get_instance(payload)
|
96
|
-
VerificationInstance.new(@version, payload, service_sid: @solution[:service_sid], )
|
97
|
-
end
|
98
|
-
|
99
|
-
##
|
100
|
-
# Provide a user friendly representation
|
101
|
-
def to_s
|
102
|
-
'<Twilio.Verify.V1.VerificationPage>'
|
103
|
-
end
|
104
|
-
end
|
105
|
-
|
106
|
-
##
|
107
|
-
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
108
|
-
class VerificationContext < InstanceContext
|
109
|
-
##
|
110
|
-
# Initialize the VerificationContext
|
111
|
-
# @param [Version] version Version that contains the resource
|
112
|
-
# @param [String] service_sid The unique SID identifier of the Service.
|
113
|
-
# @param [String] sid A 34 character string that uniquely identifies this
|
114
|
-
# Verification or the associated phone number.
|
115
|
-
# @return [VerificationContext] VerificationContext
|
116
|
-
def initialize(version, service_sid, sid)
|
117
|
-
super(version)
|
118
|
-
|
119
|
-
# Path Solution
|
120
|
-
@solution = {service_sid: service_sid, sid: sid, }
|
121
|
-
@uri = "/Services/#{@solution[:service_sid]}/Verifications/#{@solution[:sid]}"
|
122
|
-
end
|
123
|
-
|
124
|
-
##
|
125
|
-
# Update the VerificationInstance
|
126
|
-
# @param [verification.Status] status New status to set for the Verification, only
|
127
|
-
# canceled is allowed at the moment.
|
128
|
-
# @return [VerificationInstance] Updated VerificationInstance
|
129
|
-
def update(status: nil)
|
130
|
-
data = Twilio::Values.of({'Status' => status, })
|
131
|
-
|
132
|
-
payload = @version.update(
|
133
|
-
'POST',
|
134
|
-
@uri,
|
135
|
-
data: data,
|
136
|
-
)
|
137
|
-
|
138
|
-
VerificationInstance.new(
|
139
|
-
@version,
|
140
|
-
payload,
|
141
|
-
service_sid: @solution[:service_sid],
|
142
|
-
sid: @solution[:sid],
|
143
|
-
)
|
144
|
-
end
|
145
|
-
|
146
|
-
##
|
147
|
-
# Fetch a VerificationInstance
|
148
|
-
# @return [VerificationInstance] Fetched VerificationInstance
|
149
|
-
def fetch
|
150
|
-
params = Twilio::Values.of({})
|
151
|
-
|
152
|
-
payload = @version.fetch(
|
153
|
-
'GET',
|
154
|
-
@uri,
|
155
|
-
params,
|
156
|
-
)
|
157
|
-
|
158
|
-
VerificationInstance.new(
|
159
|
-
@version,
|
160
|
-
payload,
|
161
|
-
service_sid: @solution[:service_sid],
|
162
|
-
sid: @solution[:sid],
|
163
|
-
)
|
164
|
-
end
|
165
|
-
|
166
|
-
##
|
167
|
-
# Provide a user friendly representation
|
168
|
-
def to_s
|
169
|
-
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
170
|
-
"#<Twilio.Verify.V1.VerificationContext #{context}>"
|
171
|
-
end
|
172
|
-
|
173
|
-
##
|
174
|
-
# Provide a detailed, user friendly representation
|
175
|
-
def inspect
|
176
|
-
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
177
|
-
"#<Twilio.Verify.V1.VerificationContext #{context}>"
|
178
|
-
end
|
179
|
-
end
|
180
|
-
|
181
|
-
##
|
182
|
-
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
183
|
-
class VerificationInstance < InstanceResource
|
184
|
-
##
|
185
|
-
# Initialize the VerificationInstance
|
186
|
-
# @param [Version] version Version that contains the resource
|
187
|
-
# @param [Hash] payload payload that contains response from Twilio
|
188
|
-
# @param [String] service_sid The unique SID identifier of the Service.
|
189
|
-
# @param [String] sid A 34 character string that uniquely identifies this
|
190
|
-
# Verification or the associated phone number.
|
191
|
-
# @return [VerificationInstance] VerificationInstance
|
192
|
-
def initialize(version, payload, service_sid: nil, sid: nil)
|
193
|
-
super(version)
|
194
|
-
|
195
|
-
# Marshaled Properties
|
196
|
-
@properties = {
|
197
|
-
'sid' => payload['sid'],
|
198
|
-
'service_sid' => payload['service_sid'],
|
199
|
-
'account_sid' => payload['account_sid'],
|
200
|
-
'to' => payload['to'],
|
201
|
-
'channel' => payload['channel'],
|
202
|
-
'status' => payload['status'],
|
203
|
-
'valid' => payload['valid'],
|
204
|
-
'lookup' => payload['lookup'],
|
205
|
-
'amount' => payload['amount'],
|
206
|
-
'payee' => payload['payee'],
|
207
|
-
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
208
|
-
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
209
|
-
'url' => payload['url'],
|
210
|
-
}
|
211
|
-
|
212
|
-
# Context
|
213
|
-
@instance_context = nil
|
214
|
-
@params = {'service_sid' => service_sid, 'sid' => sid || @properties['sid'], }
|
215
|
-
end
|
216
|
-
|
217
|
-
##
|
218
|
-
# Generate an instance context for the instance, the context is capable of
|
219
|
-
# performing various actions. All instance actions are proxied to the context
|
220
|
-
# @return [VerificationContext] VerificationContext for this VerificationInstance
|
221
|
-
def context
|
222
|
-
unless @instance_context
|
223
|
-
@instance_context = VerificationContext.new(@version, @params['service_sid'], @params['sid'], )
|
224
|
-
end
|
225
|
-
@instance_context
|
226
|
-
end
|
227
|
-
|
228
|
-
##
|
229
|
-
# @return [String] A string that uniquely identifies this Verification.
|
230
|
-
def sid
|
231
|
-
@properties['sid']
|
232
|
-
end
|
233
|
-
|
234
|
-
##
|
235
|
-
# @return [String] Service Sid.
|
236
|
-
def service_sid
|
237
|
-
@properties['service_sid']
|
238
|
-
end
|
239
|
-
|
240
|
-
##
|
241
|
-
# @return [String] Account Sid.
|
242
|
-
def account_sid
|
243
|
-
@properties['account_sid']
|
244
|
-
end
|
245
|
-
|
246
|
-
##
|
247
|
-
# @return [String] To phonenumber
|
248
|
-
def to
|
249
|
-
@properties['to']
|
250
|
-
end
|
251
|
-
|
252
|
-
##
|
253
|
-
# @return [verification.Channel] sms or call
|
254
|
-
def channel
|
255
|
-
@properties['channel']
|
256
|
-
end
|
257
|
-
|
258
|
-
##
|
259
|
-
# @return [String] pending, approved, denied or expired
|
260
|
-
def status
|
261
|
-
@properties['status']
|
262
|
-
end
|
263
|
-
|
264
|
-
##
|
265
|
-
# @return [Boolean] successful verification
|
266
|
-
def valid
|
267
|
-
@properties['valid']
|
268
|
-
end
|
269
|
-
|
270
|
-
##
|
271
|
-
# @return [Hash] Info about the phone number
|
272
|
-
def lookup
|
273
|
-
@properties['lookup']
|
274
|
-
end
|
275
|
-
|
276
|
-
##
|
277
|
-
# @return [String] Amount of the associated PSD2 compliant transaction.
|
278
|
-
def amount
|
279
|
-
@properties['amount']
|
280
|
-
end
|
281
|
-
|
282
|
-
##
|
283
|
-
# @return [String] Payee of the associated PSD2 compliant transaction.
|
284
|
-
def payee
|
285
|
-
@properties['payee']
|
286
|
-
end
|
287
|
-
|
288
|
-
##
|
289
|
-
# @return [Time] The date this Verification was created
|
290
|
-
def date_created
|
291
|
-
@properties['date_created']
|
292
|
-
end
|
293
|
-
|
294
|
-
##
|
295
|
-
# @return [Time] The date this Verification was updated
|
296
|
-
def date_updated
|
297
|
-
@properties['date_updated']
|
298
|
-
end
|
299
|
-
|
300
|
-
##
|
301
|
-
# @return [String] The URL of this resource.
|
302
|
-
def url
|
303
|
-
@properties['url']
|
304
|
-
end
|
305
|
-
|
306
|
-
##
|
307
|
-
# Update the VerificationInstance
|
308
|
-
# @param [verification.Status] status New status to set for the Verification, only
|
309
|
-
# canceled is allowed at the moment.
|
310
|
-
# @return [VerificationInstance] Updated VerificationInstance
|
311
|
-
def update(status: nil)
|
312
|
-
context.update(status: status, )
|
313
|
-
end
|
314
|
-
|
315
|
-
##
|
316
|
-
# Fetch a VerificationInstance
|
317
|
-
# @return [VerificationInstance] Fetched VerificationInstance
|
318
|
-
def fetch
|
319
|
-
context.fetch
|
320
|
-
end
|
321
|
-
|
322
|
-
##
|
323
|
-
# Provide a user friendly representation
|
324
|
-
def to_s
|
325
|
-
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
326
|
-
"<Twilio.Verify.V1.VerificationInstance #{values}>"
|
327
|
-
end
|
328
|
-
|
329
|
-
##
|
330
|
-
# Provide a detailed, user friendly representation
|
331
|
-
def inspect
|
332
|
-
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
333
|
-
"<Twilio.Verify.V1.VerificationInstance #{values}>"
|
334
|
-
end
|
335
|
-
end
|
336
|
-
end
|
337
|
-
end
|
338
|
-
end
|
339
|
-
end
|
340
|
-
end
|
@@ -1,209 +0,0 @@
|
|
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 Verify < Domain
|
12
|
-
class V1 < Version
|
13
|
-
class ServiceContext < InstanceContext
|
14
|
-
##
|
15
|
-
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
16
|
-
class VerificationCheckList < ListResource
|
17
|
-
##
|
18
|
-
# Initialize the VerificationCheckList
|
19
|
-
# @param [Version] version Version that contains the resource
|
20
|
-
# @param [String] service_sid The unique SID identifier of the Service.
|
21
|
-
# @return [VerificationCheckList] VerificationCheckList
|
22
|
-
def initialize(version, service_sid: nil)
|
23
|
-
super(version)
|
24
|
-
|
25
|
-
# Path Solution
|
26
|
-
@solution = {service_sid: service_sid}
|
27
|
-
@uri = "/Services/#{@solution[:service_sid]}/VerificationCheck"
|
28
|
-
end
|
29
|
-
|
30
|
-
##
|
31
|
-
# Retrieve a single page of VerificationCheckInstance records from the API.
|
32
|
-
# Request is executed immediately.
|
33
|
-
# @param [String] code The 4-10 character string being verified
|
34
|
-
# @param [String] to The To phone number of the phone being verified
|
35
|
-
# @param [String] verification_sid A SID that uniquely identifies this
|
36
|
-
# Verification Check, either this parameter or the To phone number must be
|
37
|
-
# specified
|
38
|
-
# @param [String] amount Amount of the associated PSD2 compliant transaction.
|
39
|
-
# Requires the PSD2 Service flag enabled.
|
40
|
-
# @param [String] payee Payee of the associated PSD2 compliant transaction.
|
41
|
-
# Requires the PSD2 Service flag enabled.
|
42
|
-
# @return [VerificationCheckInstance] Newly created VerificationCheckInstance
|
43
|
-
def create(code: nil, to: :unset, verification_sid: :unset, amount: :unset, payee: :unset)
|
44
|
-
data = Twilio::Values.of({
|
45
|
-
'Code' => code,
|
46
|
-
'To' => to,
|
47
|
-
'VerificationSid' => verification_sid,
|
48
|
-
'Amount' => amount,
|
49
|
-
'Payee' => payee,
|
50
|
-
})
|
51
|
-
|
52
|
-
payload = @version.create(
|
53
|
-
'POST',
|
54
|
-
@uri,
|
55
|
-
data: data
|
56
|
-
)
|
57
|
-
|
58
|
-
VerificationCheckInstance.new(@version, payload, service_sid: @solution[:service_sid], )
|
59
|
-
end
|
60
|
-
|
61
|
-
##
|
62
|
-
# Provide a user friendly representation
|
63
|
-
def to_s
|
64
|
-
'#<Twilio.Verify.V1.VerificationCheckList>'
|
65
|
-
end
|
66
|
-
end
|
67
|
-
|
68
|
-
##
|
69
|
-
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
70
|
-
class VerificationCheckPage < Page
|
71
|
-
##
|
72
|
-
# Initialize the VerificationCheckPage
|
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 [VerificationCheckPage] VerificationCheckPage
|
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 VerificationCheckInstance
|
86
|
-
# @param [Hash] payload Payload response from the API
|
87
|
-
# @return [VerificationCheckInstance] VerificationCheckInstance
|
88
|
-
def get_instance(payload)
|
89
|
-
VerificationCheckInstance.new(@version, payload, service_sid: @solution[:service_sid], )
|
90
|
-
end
|
91
|
-
|
92
|
-
##
|
93
|
-
# Provide a user friendly representation
|
94
|
-
def to_s
|
95
|
-
'<Twilio.Verify.V1.VerificationCheckPage>'
|
96
|
-
end
|
97
|
-
end
|
98
|
-
|
99
|
-
##
|
100
|
-
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
101
|
-
class VerificationCheckInstance < InstanceResource
|
102
|
-
##
|
103
|
-
# Initialize the VerificationCheckInstance
|
104
|
-
# @param [Version] version Version that contains the resource
|
105
|
-
# @param [Hash] payload payload that contains response from Twilio
|
106
|
-
# @param [String] service_sid The unique SID identifier of the Service.
|
107
|
-
# @return [VerificationCheckInstance] VerificationCheckInstance
|
108
|
-
def initialize(version, payload, service_sid: nil)
|
109
|
-
super(version)
|
110
|
-
|
111
|
-
# Marshaled Properties
|
112
|
-
@properties = {
|
113
|
-
'sid' => payload['sid'],
|
114
|
-
'service_sid' => payload['service_sid'],
|
115
|
-
'account_sid' => payload['account_sid'],
|
116
|
-
'to' => payload['to'],
|
117
|
-
'channel' => payload['channel'],
|
118
|
-
'status' => payload['status'],
|
119
|
-
'valid' => payload['valid'],
|
120
|
-
'amount' => payload['amount'],
|
121
|
-
'payee' => payload['payee'],
|
122
|
-
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
123
|
-
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
124
|
-
}
|
125
|
-
end
|
126
|
-
|
127
|
-
##
|
128
|
-
# @return [String] A string that uniquely identifies this Verification Check.
|
129
|
-
def sid
|
130
|
-
@properties['sid']
|
131
|
-
end
|
132
|
-
|
133
|
-
##
|
134
|
-
# @return [String] Service Sid.
|
135
|
-
def service_sid
|
136
|
-
@properties['service_sid']
|
137
|
-
end
|
138
|
-
|
139
|
-
##
|
140
|
-
# @return [String] Account Sid.
|
141
|
-
def account_sid
|
142
|
-
@properties['account_sid']
|
143
|
-
end
|
144
|
-
|
145
|
-
##
|
146
|
-
# @return [String] To phone number
|
147
|
-
def to
|
148
|
-
@properties['to']
|
149
|
-
end
|
150
|
-
|
151
|
-
##
|
152
|
-
# @return [verification_check.Channel] sms or call
|
153
|
-
def channel
|
154
|
-
@properties['channel']
|
155
|
-
end
|
156
|
-
|
157
|
-
##
|
158
|
-
# @return [String] pending, approved, denied or expired
|
159
|
-
def status
|
160
|
-
@properties['status']
|
161
|
-
end
|
162
|
-
|
163
|
-
##
|
164
|
-
# @return [Boolean] successful verification
|
165
|
-
def valid
|
166
|
-
@properties['valid']
|
167
|
-
end
|
168
|
-
|
169
|
-
##
|
170
|
-
# @return [String] Amount of the associated PSD2 compliant transaction.
|
171
|
-
def amount
|
172
|
-
@properties['amount']
|
173
|
-
end
|
174
|
-
|
175
|
-
##
|
176
|
-
# @return [String] Payee of the associated PSD2 compliant transaction.
|
177
|
-
def payee
|
178
|
-
@properties['payee']
|
179
|
-
end
|
180
|
-
|
181
|
-
##
|
182
|
-
# @return [Time] The date this Verification Check was created
|
183
|
-
def date_created
|
184
|
-
@properties['date_created']
|
185
|
-
end
|
186
|
-
|
187
|
-
##
|
188
|
-
# @return [Time] The date this Verification Check was updated
|
189
|
-
def date_updated
|
190
|
-
@properties['date_updated']
|
191
|
-
end
|
192
|
-
|
193
|
-
##
|
194
|
-
# Provide a user friendly representation
|
195
|
-
def to_s
|
196
|
-
"<Twilio.Verify.V1.VerificationCheckInstance>"
|
197
|
-
end
|
198
|
-
|
199
|
-
##
|
200
|
-
# Provide a detailed, user friendly representation
|
201
|
-
def inspect
|
202
|
-
"<Twilio.Verify.V1.VerificationCheckInstance>"
|
203
|
-
end
|
204
|
-
end
|
205
|
-
end
|
206
|
-
end
|
207
|
-
end
|
208
|
-
end
|
209
|
-
end
|