twilio-ruby 7.10.6 → 7.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/test-and-deploy.yml +43 -67
- data/.gitignore +0 -1
- data/CHANGES.md +57 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +154 -0
- data/README.md +3 -3
- data/Rakefile +1 -1
- data/lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb +25 -6
- data/lib/twilio-ruby/rest/accounts/v1/secondary_auth_token.rb +48 -12
- data/lib/twilio-ruby/rest/api/v2010/account/call.rb +6 -0
- data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +56 -2
- data/lib/twilio-ruby/rest/client.rb +0 -5
- data/lib/twilio-ruby/rest/content/v1/content/approval_create.rb +11 -1
- data/lib/twilio-ruby/rest/conversations/v1/conversation/message.rb +10 -10
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message.rb +10 -10
- data/lib/twilio-ruby/rest/conversations/v2/action.rb +507 -0
- data/lib/twilio-ruby/rest/conversations/v2/communication.rb +43 -21
- data/lib/twilio-ruby/rest/conversations/v2/configuration.rb +59 -21
- data/lib/twilio-ruby/rest/conversations/v2/conversation.rb +28 -28
- data/lib/twilio-ruby/rest/conversations/v2/operation.rb +10 -10
- data/lib/twilio-ruby/rest/conversations/v2/participant.rb +58 -58
- data/lib/twilio-ruby/rest/conversations/v2.rb +61 -45
- data/lib/twilio-ruby/rest/iam/v1/new_api_key.rb +2 -2
- data/lib/twilio-ruby/rest/iam/v1/o_auth_app.rb +15 -2
- data/lib/twilio-ruby/rest/iam_base.rb +6 -1
- data/lib/twilio-ruby/rest/insights/v1/call/call_summary.rb +7 -0
- data/lib/twilio-ruby/rest/insights/v1/call/event.rb +7 -0
- data/lib/twilio-ruby/rest/insights/v1/call_summaries.rb +7 -0
- data/lib/twilio-ruby/rest/insights/v3/metadata.rb +1 -1
- data/lib/twilio-ruby/rest/insights/v3/query.rb +1 -1
- data/lib/twilio-ruby/rest/insights/v3.rb +1 -1
- data/lib/twilio-ruby/rest/intelligence/v3/conversation.rb +8 -8
- data/lib/twilio-ruby/rest/intelligence/v3/rule_execution.rb +502 -0
- data/lib/twilio-ruby/rest/intelligence/v3.rb +6 -0
- data/lib/twilio-ruby/rest/knowledge/v2/chunk.rb +28 -0
- data/lib/twilio-ruby/rest/knowledge/v2/knowledge.rb +38 -0
- data/lib/twilio-ruby/rest/knowledge/v2/search.rb +8 -117
- data/lib/twilio-ruby/rest/knowledge/v2.rb +1 -2
- data/lib/twilio-ruby/rest/memory/v1/bulk.rb +9 -118
- data/lib/twilio-ruby/rest/memory/v1/conversation_summary.rb +13 -5
- data/lib/twilio-ruby/rest/memory/v1/data_mapping.rb +6 -12
- data/lib/twilio-ruby/rest/memory/v1/identifier.rb +1 -1
- data/lib/twilio-ruby/rest/memory/v1/identity_resolution_setting.rb +11 -132
- data/lib/twilio-ruby/rest/memory/v1/import.rb +28 -5
- data/lib/twilio-ruby/rest/memory/v1/lookup.rb +1 -1
- data/lib/twilio-ruby/rest/memory/v1/observation.rb +70 -18
- data/lib/twilio-ruby/rest/memory/v1/operation.rb +1 -1
- data/lib/twilio-ruby/rest/memory/v1/profile.rb +87 -2
- data/lib/twilio-ruby/rest/memory/v1/recall.rb +1 -1
- data/lib/twilio-ruby/rest/memory/v1/revision.rb +1 -1
- data/lib/twilio-ruby/rest/memory/v1/store.rb +46 -1
- data/lib/twilio-ruby/rest/memory/v1/trait.rb +1 -1
- data/lib/twilio-ruby/rest/memory/v1/trait_group.rb +56 -6
- data/lib/twilio-ruby/rest/memory/v1.rb +3 -46
- data/lib/twilio-ruby/rest/messaging/v1/brand_registration.rb +0 -18
- data/lib/twilio-ruby/rest/messaging/v2/channels_sender.rb +23 -4
- data/lib/twilio-ruby/rest/messaging/v3/typing_indicator.rb +4 -4
- data/lib/twilio-ruby/rest/numbers/v1/sms_verification.rb +231 -0
- data/lib/twilio-ruby/rest/numbers/v1/sms_verification_check.rb +238 -0
- data/lib/twilio-ruby/rest/numbers/v1/voice_verification.rb +245 -0
- data/lib/twilio-ruby/rest/numbers/v1/voice_verification_check.rb +224 -0
- data/lib/twilio-ruby/rest/numbers/v1.rb +24 -0
- data/lib/twilio-ruby/rest/{assistants/v1/session.rb → numbers/v2/caller_id.rb} +141 -127
- data/lib/twilio-ruby/rest/numbers/v2.rb +16 -0
- data/lib/twilio-ruby/rest/oauth/v2/authorize.rb +14 -2
- data/lib/twilio-ruby/rest/oauth/v2/oauth_authorization_server.rb +259 -0
- data/lib/twilio-ruby/rest/oauth/v2/token.rb +8 -2
- data/lib/twilio-ruby/rest/preview_iam/versionless/organization.rb +0 -19
- data/lib/twilio-ruby/rest/routes/v3/phone_number.rb +465 -0
- data/lib/twilio-ruby/rest/routes/v3.rb +50 -0
- data/lib/twilio-ruby/rest/routes_base.rb +6 -1
- data/lib/twilio-ruby/rest/trusthub/v1/a2p_brand_registration.rb +330 -0
- data/lib/twilio-ruby/rest/trusthub/v1/a2p_brand_registration_embedded_session.rb +233 -0
- data/lib/twilio-ruby/rest/trusthub/v1/a2p_campaign_registration.rb +321 -0
- data/lib/twilio-ruby/rest/trusthub/v1/a2p_campaign_registration_embedded_session.rb +233 -0
- data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles_provisional_copy.rb +445 -0
- data/lib/twilio-ruby/rest/trusthub/v1/trust_products_provisional_copy.rb +445 -0
- data/lib/twilio-ruby/rest/trusthub/v1.rb +74 -0
- data/lib/twilio-ruby/rest/voice/v2/account_default_configuration.rb +556 -0
- data/lib/twilio-ruby/rest/voice/v2/configuration/default.rb +356 -0
- data/lib/twilio-ruby/rest/voice/v2/configuration.rb +412 -0
- data/lib/twilio-ruby/rest/voice/v2/recording.rb +616 -0
- data/lib/twilio-ruby/rest/voice/v2/transcription.rb +591 -0
- data/lib/twilio-ruby/rest/voice/v2/type.rb +518 -0
- data/lib/twilio-ruby/rest/voice/v2.rb +141 -0
- data/lib/twilio-ruby/rest/voice_base.rb +5 -0
- data/lib/twilio-ruby/twiml/voice_response.rb +6 -68
- data/lib/twilio-ruby/version.rb +1 -1
- data/twilio-ruby.gemspec +1 -1
- metadata +34 -21
- data/lib/twilio-ruby/rest/assistants/v1/assistant/assistants_knowledge.rb +0 -558
- data/lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb +0 -558
- data/lib/twilio-ruby/rest/assistants/v1/assistant/feedback.rb +0 -431
- data/lib/twilio-ruby/rest/assistants/v1/assistant/message.rb +0 -296
- data/lib/twilio-ruby/rest/assistants/v1/assistant.rb +0 -927
- data/lib/twilio-ruby/rest/assistants/v1/knowledge/chunk.rb +0 -325
- data/lib/twilio-ruby/rest/assistants/v1/knowledge/knowledge_status.rb +0 -349
- data/lib/twilio-ruby/rest/assistants/v1/knowledge.rb +0 -871
- data/lib/twilio-ruby/rest/assistants/v1/policy.rb +0 -364
- data/lib/twilio-ruby/rest/assistants/v1/session/message.rb +0 -360
- data/lib/twilio-ruby/rest/assistants/v1/tool.rb +0 -847
- data/lib/twilio-ruby/rest/assistants/v1.rb +0 -104
- data/lib/twilio-ruby/rest/assistants.rb +0 -6
- data/lib/twilio-ruby/rest/assistants_base.rb +0 -38
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
##
|
|
2
|
+
# This code was generated by
|
|
3
|
+
# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
|
4
|
+
# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
|
5
|
+
# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
|
6
|
+
#
|
|
7
|
+
# Twilio - Numbers
|
|
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 Numbers < NumbersBase
|
|
19
|
+
class V1 < Version
|
|
20
|
+
class SmsVerificationList < ListResource
|
|
21
|
+
|
|
22
|
+
##
|
|
23
|
+
# Initialize the SmsVerificationList
|
|
24
|
+
# @param [Version] version Version that contains the resource
|
|
25
|
+
# @return [SmsVerificationList] SmsVerificationList
|
|
26
|
+
def initialize(version)
|
|
27
|
+
super(version)
|
|
28
|
+
|
|
29
|
+
# Path Solution
|
|
30
|
+
@solution = { }
|
|
31
|
+
@uri = "/CallerIds/SmsVerifications"
|
|
32
|
+
|
|
33
|
+
end
|
|
34
|
+
##
|
|
35
|
+
# Create the SmsVerificationInstance
|
|
36
|
+
# @return [SmsVerificationInstance] Created SmsVerificationInstance
|
|
37
|
+
def create
|
|
38
|
+
|
|
39
|
+
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
payload = @version.create('POST', @uri, headers: headers)
|
|
46
|
+
SmsVerificationInstance.new(
|
|
47
|
+
@version,
|
|
48
|
+
payload,
|
|
49
|
+
)
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
##
|
|
53
|
+
# Create the SmsVerificationInstanceMetadata
|
|
54
|
+
# @return [SmsVerificationInstance] Created SmsVerificationInstance
|
|
55
|
+
def create_with_metadata
|
|
56
|
+
|
|
57
|
+
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
response = @version.create_with_metadata('POST', @uri, headers: headers)
|
|
64
|
+
sms_verification_instance = SmsVerificationInstance.new(
|
|
65
|
+
@version,
|
|
66
|
+
response.body,
|
|
67
|
+
)
|
|
68
|
+
SmsVerificationInstanceMetadata.new(
|
|
69
|
+
@version,
|
|
70
|
+
sms_verification_instance,
|
|
71
|
+
response.headers,
|
|
72
|
+
response.status_code
|
|
73
|
+
)
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
# Provide a user friendly representation
|
|
80
|
+
def to_s
|
|
81
|
+
'#<Twilio.Numbers.V1.SmsVerificationList>'
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
class SmsVerificationPage < Page
|
|
86
|
+
##
|
|
87
|
+
# Initialize the SmsVerificationPage
|
|
88
|
+
# @param [Version] version Version that contains the resource
|
|
89
|
+
# @param [Response] response Response from the API
|
|
90
|
+
# @param [Hash] solution Path solution for the resource
|
|
91
|
+
# @return [SmsVerificationPage] SmsVerificationPage
|
|
92
|
+
def initialize(version, response, solution)
|
|
93
|
+
super(version, response)
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
# Path Solution
|
|
97
|
+
@solution = solution
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
##
|
|
101
|
+
# Build an instance of SmsVerificationInstance
|
|
102
|
+
# @param [Hash] payload Payload response from the API
|
|
103
|
+
# @return [SmsVerificationInstance] SmsVerificationInstance
|
|
104
|
+
def get_instance(payload)
|
|
105
|
+
SmsVerificationInstance.new(@version, payload)
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
##
|
|
109
|
+
# Provide a user friendly representation
|
|
110
|
+
def to_s
|
|
111
|
+
'<Twilio.Numbers.V1.SmsVerificationPage>'
|
|
112
|
+
end
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
class SmsVerificationPageMetadata < PageMetadata
|
|
116
|
+
attr_reader :sms_verification_page
|
|
117
|
+
|
|
118
|
+
def initialize(version, response, solution, limit)
|
|
119
|
+
super(version, response)
|
|
120
|
+
@sms_verification_page = []
|
|
121
|
+
@limit = limit
|
|
122
|
+
key = get_key(response.body)
|
|
123
|
+
records = 0
|
|
124
|
+
while( limit != :unset && records < limit )
|
|
125
|
+
@sms_verification_page << SmsVerificationListResponse.new(version, @payload, key, limit - records)
|
|
126
|
+
@payload = self.next_page
|
|
127
|
+
break unless @payload
|
|
128
|
+
records += (@payload.body[key] || []).size
|
|
129
|
+
end
|
|
130
|
+
# Path Solution
|
|
131
|
+
@solution = solution
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
def each
|
|
135
|
+
@sms_verification_page.each do |record|
|
|
136
|
+
yield record
|
|
137
|
+
end
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
def to_s
|
|
141
|
+
'<Twilio::REST::Numbers::V1PageMetadata>';
|
|
142
|
+
end
|
|
143
|
+
end
|
|
144
|
+
class SmsVerificationListResponse < InstanceListResource
|
|
145
|
+
|
|
146
|
+
# @param [Array<SmsVerificationInstance>] instance
|
|
147
|
+
# @param [Hash{String => Object}] headers
|
|
148
|
+
# @param [Integer] status_code
|
|
149
|
+
def initialize(version, payload, key, limit = :unset)
|
|
150
|
+
data_list = payload.body[key] || []
|
|
151
|
+
if limit != :unset
|
|
152
|
+
data_list = data_list[0, limit]
|
|
153
|
+
end
|
|
154
|
+
@sms_verification = data_list.map do |data|
|
|
155
|
+
SmsVerificationInstance.new(version, data)
|
|
156
|
+
end
|
|
157
|
+
@headers = payload.headers
|
|
158
|
+
@status_code = payload.status_code
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
def sms_verification
|
|
162
|
+
@sms_verification
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
def headers
|
|
166
|
+
@headers
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
def status_code
|
|
170
|
+
@status_code
|
|
171
|
+
end
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
class SmsVerificationInstance < InstanceResource
|
|
175
|
+
##
|
|
176
|
+
# Initialize the SmsVerificationInstance
|
|
177
|
+
# @param [Version] version Version that contains the resource
|
|
178
|
+
# @param [Hash] payload payload that contains response from Twilio
|
|
179
|
+
# @param [String] account_sid The SID of the
|
|
180
|
+
# {Account}[https://www.twilio.com/docs/iam/api/account] that created this SmsVerification
|
|
181
|
+
# resource.
|
|
182
|
+
# @param [String] sid The SID of the Call resource to fetch.
|
|
183
|
+
# @return [SmsVerificationInstance] SmsVerificationInstance
|
|
184
|
+
def initialize(version, payload )
|
|
185
|
+
super(version)
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
# Marshaled Properties
|
|
189
|
+
@properties = {
|
|
190
|
+
'to' => payload['to'],
|
|
191
|
+
'verification_sid' => payload['verification_sid'],
|
|
192
|
+
'send_code_attempts' => payload['send_code_attempts'],
|
|
193
|
+
}
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
##
|
|
198
|
+
# @return [String] The phone number being verified in E.164 format.
|
|
199
|
+
def to
|
|
200
|
+
@properties['to']
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
##
|
|
204
|
+
# @return [String] The unique SID of this verification resource.
|
|
205
|
+
def verification_sid
|
|
206
|
+
@properties['verification_sid']
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
##
|
|
210
|
+
# @return [Array<NumbersV1SmsVerificationSendCodeAttempts>] An array of verification attempt objects.
|
|
211
|
+
def send_code_attempts
|
|
212
|
+
@properties['send_code_attempts']
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
##
|
|
216
|
+
# Provide a user friendly representation
|
|
217
|
+
def to_s
|
|
218
|
+
"<Twilio.Numbers.V1.SmsVerificationInstance>"
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
##
|
|
222
|
+
# Provide a detailed, user friendly representation
|
|
223
|
+
def inspect
|
|
224
|
+
"<Twilio.Numbers.V1.SmsVerificationInstance>"
|
|
225
|
+
end
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
end
|
|
229
|
+
end
|
|
230
|
+
end
|
|
231
|
+
end
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
##
|
|
2
|
+
# This code was generated by
|
|
3
|
+
# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
|
4
|
+
# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
|
5
|
+
# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
|
6
|
+
#
|
|
7
|
+
# Twilio - Numbers
|
|
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 Numbers < NumbersBase
|
|
19
|
+
class V1 < Version
|
|
20
|
+
class SmsVerificationCheckList < ListResource
|
|
21
|
+
|
|
22
|
+
##
|
|
23
|
+
# Initialize the SmsVerificationCheckList
|
|
24
|
+
# @param [Version] version Version that contains the resource
|
|
25
|
+
# @return [SmsVerificationCheckList] SmsVerificationCheckList
|
|
26
|
+
def initialize(version)
|
|
27
|
+
super(version)
|
|
28
|
+
|
|
29
|
+
# Path Solution
|
|
30
|
+
@solution = { }
|
|
31
|
+
@uri = "/CallerIds/SmsVerificationChecks"
|
|
32
|
+
|
|
33
|
+
end
|
|
34
|
+
##
|
|
35
|
+
# Create the SmsVerificationCheckInstance
|
|
36
|
+
# @return [SmsVerificationCheckInstance] Created SmsVerificationCheckInstance
|
|
37
|
+
def create
|
|
38
|
+
|
|
39
|
+
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
payload = @version.create('POST', @uri, headers: headers)
|
|
46
|
+
SmsVerificationCheckInstance.new(
|
|
47
|
+
@version,
|
|
48
|
+
payload,
|
|
49
|
+
)
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
##
|
|
53
|
+
# Create the SmsVerificationCheckInstanceMetadata
|
|
54
|
+
# @return [SmsVerificationCheckInstance] Created SmsVerificationCheckInstance
|
|
55
|
+
def create_with_metadata
|
|
56
|
+
|
|
57
|
+
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
response = @version.create_with_metadata('POST', @uri, headers: headers)
|
|
64
|
+
sms_verification_check_instance = SmsVerificationCheckInstance.new(
|
|
65
|
+
@version,
|
|
66
|
+
response.body,
|
|
67
|
+
)
|
|
68
|
+
SmsVerificationCheckInstanceMetadata.new(
|
|
69
|
+
@version,
|
|
70
|
+
sms_verification_check_instance,
|
|
71
|
+
response.headers,
|
|
72
|
+
response.status_code
|
|
73
|
+
)
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
# Provide a user friendly representation
|
|
80
|
+
def to_s
|
|
81
|
+
'#<Twilio.Numbers.V1.SmsVerificationCheckList>'
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
class SmsVerificationCheckPage < Page
|
|
86
|
+
##
|
|
87
|
+
# Initialize the SmsVerificationCheckPage
|
|
88
|
+
# @param [Version] version Version that contains the resource
|
|
89
|
+
# @param [Response] response Response from the API
|
|
90
|
+
# @param [Hash] solution Path solution for the resource
|
|
91
|
+
# @return [SmsVerificationCheckPage] SmsVerificationCheckPage
|
|
92
|
+
def initialize(version, response, solution)
|
|
93
|
+
super(version, response)
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
# Path Solution
|
|
97
|
+
@solution = solution
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
##
|
|
101
|
+
# Build an instance of SmsVerificationCheckInstance
|
|
102
|
+
# @param [Hash] payload Payload response from the API
|
|
103
|
+
# @return [SmsVerificationCheckInstance] SmsVerificationCheckInstance
|
|
104
|
+
def get_instance(payload)
|
|
105
|
+
SmsVerificationCheckInstance.new(@version, payload)
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
##
|
|
109
|
+
# Provide a user friendly representation
|
|
110
|
+
def to_s
|
|
111
|
+
'<Twilio.Numbers.V1.SmsVerificationCheckPage>'
|
|
112
|
+
end
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
class SmsVerificationCheckPageMetadata < PageMetadata
|
|
116
|
+
attr_reader :sms_verification_check_page
|
|
117
|
+
|
|
118
|
+
def initialize(version, response, solution, limit)
|
|
119
|
+
super(version, response)
|
|
120
|
+
@sms_verification_check_page = []
|
|
121
|
+
@limit = limit
|
|
122
|
+
key = get_key(response.body)
|
|
123
|
+
records = 0
|
|
124
|
+
while( limit != :unset && records < limit )
|
|
125
|
+
@sms_verification_check_page << SmsVerificationCheckListResponse.new(version, @payload, key, limit - records)
|
|
126
|
+
@payload = self.next_page
|
|
127
|
+
break unless @payload
|
|
128
|
+
records += (@payload.body[key] || []).size
|
|
129
|
+
end
|
|
130
|
+
# Path Solution
|
|
131
|
+
@solution = solution
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
def each
|
|
135
|
+
@sms_verification_check_page.each do |record|
|
|
136
|
+
yield record
|
|
137
|
+
end
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
def to_s
|
|
141
|
+
'<Twilio::REST::Numbers::V1PageMetadata>';
|
|
142
|
+
end
|
|
143
|
+
end
|
|
144
|
+
class SmsVerificationCheckListResponse < InstanceListResource
|
|
145
|
+
|
|
146
|
+
# @param [Array<SmsVerificationCheckInstance>] instance
|
|
147
|
+
# @param [Hash{String => Object}] headers
|
|
148
|
+
# @param [Integer] status_code
|
|
149
|
+
def initialize(version, payload, key, limit = :unset)
|
|
150
|
+
data_list = payload.body[key] || []
|
|
151
|
+
if limit != :unset
|
|
152
|
+
data_list = data_list[0, limit]
|
|
153
|
+
end
|
|
154
|
+
@sms_verification_check = data_list.map do |data|
|
|
155
|
+
SmsVerificationCheckInstance.new(version, data)
|
|
156
|
+
end
|
|
157
|
+
@headers = payload.headers
|
|
158
|
+
@status_code = payload.status_code
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
def sms_verification_check
|
|
162
|
+
@sms_verification_check
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
def headers
|
|
166
|
+
@headers
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
def status_code
|
|
170
|
+
@status_code
|
|
171
|
+
end
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
class SmsVerificationCheckInstance < InstanceResource
|
|
175
|
+
##
|
|
176
|
+
# Initialize the SmsVerificationCheckInstance
|
|
177
|
+
# @param [Version] version Version that contains the resource
|
|
178
|
+
# @param [Hash] payload payload that contains response from Twilio
|
|
179
|
+
# @param [String] account_sid The SID of the
|
|
180
|
+
# {Account}[https://www.twilio.com/docs/iam/api/account] that created this SmsVerificationCheck
|
|
181
|
+
# resource.
|
|
182
|
+
# @param [String] sid The SID of the Call resource to fetch.
|
|
183
|
+
# @return [SmsVerificationCheckInstance] SmsVerificationCheckInstance
|
|
184
|
+
def initialize(version, payload )
|
|
185
|
+
super(version)
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
# Marshaled Properties
|
|
189
|
+
@properties = {
|
|
190
|
+
'to' => payload['to'],
|
|
191
|
+
'verification_sid' => payload['verification_sid'],
|
|
192
|
+
'status' => payload['status'],
|
|
193
|
+
'caller_id_sid' => payload['caller_id_sid'],
|
|
194
|
+
}
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
##
|
|
199
|
+
# @return [String] The phone number that was verified in E.164 format.
|
|
200
|
+
def to
|
|
201
|
+
@properties['to']
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
##
|
|
205
|
+
# @return [String] The unique SID of this verification resource.
|
|
206
|
+
def verification_sid
|
|
207
|
+
@properties['verification_sid']
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
##
|
|
211
|
+
# @return [String] The status of the verification (pending, approved, canceled).
|
|
212
|
+
def status
|
|
213
|
+
@properties['status']
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
##
|
|
217
|
+
# @return [String] The Caller ID SID created upon successful verification.
|
|
218
|
+
def caller_id_sid
|
|
219
|
+
@properties['caller_id_sid']
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
##
|
|
223
|
+
# Provide a user friendly representation
|
|
224
|
+
def to_s
|
|
225
|
+
"<Twilio.Numbers.V1.SmsVerificationCheckInstance>"
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
##
|
|
229
|
+
# Provide a detailed, user friendly representation
|
|
230
|
+
def inspect
|
|
231
|
+
"<Twilio.Numbers.V1.SmsVerificationCheckInstance>"
|
|
232
|
+
end
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
end
|
|
236
|
+
end
|
|
237
|
+
end
|
|
238
|
+
end
|