twilio-ruby 5.52.0 → 5.67.3
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 +5 -5
- data/.github/workflows/pr-lint.yml +15 -0
- data/.github/workflows/test-and-deploy.yml +129 -0
- data/.gitignore +5 -1
- data/.rubocop.yml +1 -1
- data/.rubocop_todo.yml +91 -28
- data/CHANGES.md +563 -0
- data/Gemfile +1 -0
- data/Makefile +8 -11
- data/README.md +13 -6
- data/examples/examples.rb +1 -1
- data/lib/rack/twilio_webhook_authentication.rb +25 -1
- data/lib/twilio-ruby/http/http_client.rb +20 -4
- data/lib/twilio-ruby/http.rb +5 -0
- data/lib/twilio-ruby/jwt/access_token.rb +13 -0
- data/lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb +23 -23
- data/lib/twilio-ruby/rest/api/v2010/account/call/feedback_summary.rb +5 -5
- data/lib/twilio-ruby/rest/api/v2010/account/call/payment.rb +8 -8
- data/lib/twilio-ruby/rest/api/v2010/account/call/siprec.rb +674 -0
- data/lib/twilio-ruby/rest/api/v2010/account/call/stream.rb +674 -0
- data/lib/twilio-ruby/rest/api/v2010/account/call.rb +68 -14
- data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +12 -8
- data/lib/twilio-ruby/rest/api/v2010/account/conference/recording.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/local.rb +11 -4
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/mobile.rb +11 -4
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/toll_free.rb +11 -4
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb +17 -10
- data/lib/twilio-ruby/rest/api/v2010/account/message.rb +18 -5
- data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +34 -7
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/credential_list_mapping.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.rb +11 -11
- data/lib/twilio-ruby/rest/bulkexports/v1/export/day.rb +0 -8
- data/lib/twilio-ruby/rest/bulkexports/v1/export/export_custom_job.rb +0 -6
- data/lib/twilio-ruby/rest/bulkexports/v1/export/job.rb +0 -8
- data/lib/twilio-ruby/rest/bulkexports/v1/export.rb +0 -8
- data/lib/twilio-ruby/rest/bulkexports/v1/export_configuration.rb +0 -8
- data/lib/twilio-ruby/rest/chat/v2/service/user/user_channel.rb +10 -4
- data/lib/twilio-ruby/rest/chat/v3/channel.rb +275 -0
- data/lib/twilio-ruby/rest/chat/v3.rb +48 -0
- data/lib/twilio-ruby/rest/chat.rb +16 -0
- data/lib/twilio-ruby/rest/client.rb +21 -12
- data/lib/twilio-ruby/rest/conversations/v1/address_configuration.rb +454 -0
- data/lib/twilio-ruby/rest/conversations/v1/conversation/message.rb +12 -5
- data/lib/twilio-ruby/rest/conversations/v1/conversation.rb +7 -0
- data/lib/twilio-ruby/rest/conversations/v1/participant_conversation.rb +312 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/configuration/notification.rb +18 -2
- data/lib/twilio-ruby/rest/conversations/v1/service/configuration/webhook.rb +269 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/configuration.rb +8 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message.rb +12 -5
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation.rb +7 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/participant_conversation.rb +324 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/user/user_conversation.rb +466 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/user.rb +44 -0
- data/lib/twilio-ruby/rest/conversations/v1/service.rb +23 -0
- data/lib/twilio-ruby/rest/conversations/v1/user/user_conversation.rb +442 -0
- data/lib/twilio-ruby/rest/conversations/v1/user.rb +35 -0
- data/lib/twilio-ruby/rest/conversations/v1.rb +24 -0
- data/lib/twilio-ruby/rest/conversations.rb +15 -0
- data/lib/twilio-ruby/rest/events/v1/event_type.rb +12 -5
- data/lib/twilio-ruby/rest/events/v1/sink.rb +41 -5
- data/lib/twilio-ruby/rest/flex_api/v1/configuration.rb +28 -0
- data/lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb +55 -34
- data/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_invite.rb +236 -0
- data/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.rb +330 -0
- data/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb +384 -0
- data/lib/twilio-ruby/rest/flex_api/v1/interaction.rb +233 -0
- data/lib/twilio-ruby/rest/flex_api/v1.rb +16 -0
- data/lib/twilio-ruby/rest/flex_api.rb +9 -0
- data/lib/twilio-ruby/rest/frontline_api/v1/user.rb +258 -0
- data/lib/twilio-ruby/rest/{fax → frontline_api}/v1.rb +11 -11
- data/lib/twilio-ruby/rest/{fax.rb → frontline_api.rb} +11 -11
- data/lib/twilio-ruby/rest/insights/v1/annotation.rb +271 -0
- data/lib/twilio-ruby/rest/insights/v1/call_summaries.rb +434 -0
- data/lib/twilio-ruby/rest/insights/v1/conference/conference_participant.rb +474 -0
- data/lib/twilio-ruby/rest/insights/v1/conference.rb +512 -0
- data/lib/twilio-ruby/rest/insights/v1/setting.rb +215 -0
- data/lib/twilio-ruby/rest/insights/v1.rb +46 -0
- data/lib/twilio-ruby/rest/insights.rb +28 -0
- data/lib/twilio-ruby/rest/lookups/v2/phone_number.rb +268 -0
- data/lib/twilio-ruby/rest/lookups/v2.rb +45 -0
- data/lib/twilio-ruby/rest/lookups.rb +7 -0
- data/lib/twilio-ruby/rest/media/v1/media_processor.rb +397 -0
- data/lib/twilio-ruby/rest/media/v1/media_recording.rb +406 -0
- data/lib/twilio-ruby/rest/media/v1/player_streamer/playback_grant.rb +221 -0
- data/lib/twilio-ruby/rest/media/v1/player_streamer.rb +403 -0
- data/lib/twilio-ruby/rest/media/v1.rb +76 -0
- data/lib/twilio-ruby/rest/media.rb +65 -0
- data/lib/twilio-ruby/rest/{fax/v1/fax/fax_media.rb → messaging/v1/brand_registration/brand_vetting.rb} +134 -95
- data/lib/twilio-ruby/rest/messaging/v1/brand_registration.rb +127 -2
- data/lib/twilio-ruby/rest/messaging/v1/external_campaign.rb +7 -0
- data/lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb +187 -20
- data/lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person_usecase.rb +6 -2
- data/lib/twilio-ruby/rest/messaging/v1/service.rb +37 -5
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/bundle_copy.rb +268 -0
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/replace_items.rb +188 -0
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb +128 -26
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/supporting_document.rb +7 -0
- data/lib/twilio-ruby/rest/pricing/v2/country.rb +280 -0
- data/lib/twilio-ruby/rest/pricing/v2/number.rb +225 -0
- data/lib/twilio-ruby/rest/pricing/v2.rb +37 -0
- data/lib/twilio-ruby/rest/pricing.rb +19 -0
- data/lib/twilio-ruby/rest/serverless/v1/service/environment.rb +1 -1
- data/lib/twilio-ruby/rest/serverless/v1/service.rb +7 -0
- data/lib/twilio-ruby/rest/studio/v1/flow/execution.rb +1 -1
- data/lib/twilio-ruby/rest/studio/v2/flow/execution.rb +1 -1
- data/lib/twilio-ruby/rest/supersim/v1/esim_profile.rb +372 -0
- data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +44 -55
- data/lib/twilio-ruby/rest/supersim/v1/{command.rb → ip_command.rb} +132 -84
- data/lib/twilio-ruby/rest/supersim/v1/sim/billing_period.rb +231 -0
- data/lib/twilio-ruby/rest/supersim/v1/sim.rb +30 -1
- data/lib/twilio-ruby/rest/supersim/v1/sms_command.rb +1 -1
- data/lib/twilio-ruby/rest/supersim/v1/usage_record.rb +23 -9
- data/lib/twilio-ruby/rest/supersim/v1.rb +23 -7
- data/lib/twilio-ruby/rest/supersim.rb +15 -6
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb +7 -0
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +7 -3
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.rb +6 -2
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb +7 -3
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb +23 -11
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.rb +4 -2
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_cumulative_statistics.rb +4 -2
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace.rb +38 -22
- data/lib/twilio-ruby/rest/trunking/v1/trunk.rb +19 -3
- data/lib/twilio-ruby/rest/verify/v2/service/access_token.rb +155 -10
- data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge/notification.rb +12 -9
- data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb +74 -22
- data/lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb +34 -15
- data/lib/twilio-ruby/rest/verify/v2/service/entity/new_factor.rb +66 -31
- data/lib/twilio-ruby/rest/verify/v2/service/entity.rb +7 -3
- data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +25 -7
- data/lib/twilio-ruby/rest/verify/v2/service/webhook.rb +24 -5
- data/lib/twilio-ruby/rest/verify/v2/service.rb +40 -11
- data/lib/twilio-ruby/rest/verify/v2/template.rb +206 -0
- data/lib/twilio-ruby/rest/verify/v2/verification_attempt.rb +89 -21
- data/lib/twilio-ruby/rest/verify/v2/verification_attempts_summary.rb +234 -0
- data/lib/twilio-ruby/rest/verify/v2.rb +14 -0
- data/lib/twilio-ruby/rest/verify.rb +14 -2
- data/lib/twilio-ruby/rest/video/v1/composition.rb +21 -8
- data/lib/twilio-ruby/rest/video/v1/composition_hook.rb +0 -8
- data/lib/twilio-ruby/rest/video/v1/recording.rb +21 -0
- data/lib/twilio-ruby/rest/video/v1/room/recording.rb +7 -0
- data/lib/twilio-ruby/rest/video/v1/room.rb +62 -5
- data/lib/twilio-ruby/rest/voice/v1/archived_call.rb +184 -0
- data/lib/twilio-ruby/rest/voice/v1.rb +21 -0
- data/lib/twilio-ruby/rest/voice.rb +8 -0
- data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +3 -3
- data/lib/twilio-ruby/rest/wireless/v1/sim.rb +16 -26
- data/lib/twilio-ruby/rest.rb +13 -0
- data/lib/twilio-ruby/twiml/voice_response.rb +727 -87
- data/lib/twilio-ruby/version.rb +1 -1
- data/lib/twilio-ruby.rb +6 -16
- data/sonar-project.properties +13 -0
- data/twilio-ruby.gemspec +1 -2
- metadata +59 -32
- data/.travis.yml +0 -45
- data/lib/twilio-ruby/rest/fax/v1/fax.rb +0 -536
- /data/lib/twilio-ruby/framework/{domain.rb → rest/domain.rb} +0 -0
- /data/lib/twilio-ruby/framework/{error.rb → rest/error.rb} +0 -0
- /data/lib/twilio-ruby/framework/{helper.rb → rest/helper.rb} +0 -0
- /data/lib/twilio-ruby/framework/{obsolete_client.rb → rest/obsolete_client.rb} +0 -0
- /data/lib/twilio-ruby/framework/{page.rb → rest/page.rb} +0 -0
- /data/lib/twilio-ruby/framework/{resource.rb → rest/resource.rb} +0 -0
- /data/lib/twilio-ruby/framework/{version.rb → rest/version.rb} +0 -0
@@ -20,7 +20,9 @@ module Twilio
|
|
20
20
|
# @param [Version] version Version that contains the resource
|
21
21
|
# @param [String] service_sid The unique SID identifier of the Service.
|
22
22
|
# @param [String] identity Customer unique identity for the Entity owner of the
|
23
|
-
# Challenge. This
|
23
|
+
# Challenge. This identifier should be immutable, not PII, length between 8 and 64
|
24
|
+
# characters, and generated by your external system, such as your user's UUID,
|
25
|
+
# GUID, or SID. It can only contain dash (-) separated alphanumeric characters.
|
24
26
|
# @return [ChallengeList] ChallengeList
|
25
27
|
def initialize(version, service_sid: nil, identity: nil)
|
26
28
|
super(version)
|
@@ -38,16 +40,21 @@ module Twilio
|
|
38
40
|
# is five (5) minutes after Challenge creation. The max value is sixty (60)
|
39
41
|
# minutes after creation.
|
40
42
|
# @param [String] details_message Shown to the user when the push notification
|
41
|
-
# arrives. Required when `factor_type` is `push
|
43
|
+
# arrives. Required when `factor_type` is `push`. Can be up to 256 characters in
|
44
|
+
# length
|
42
45
|
# @param [Array[Hash]] details_fields A list of objects that describe the Fields
|
43
46
|
# included in the Challenge. Each object contains the label and value of the
|
44
|
-
# field
|
47
|
+
# field, the label can be up to 36 characters in length and the value can be up to
|
48
|
+
# 128 characters in length. Used when `factor_type` is `push`. There can be up to
|
49
|
+
# 20 details fields.
|
45
50
|
# @param [Hash] hidden_details Details provided to give context about the
|
46
51
|
# Challenge. Not shown to the end user. It must be a stringified JSON with only
|
47
|
-
# strings values eg. `{"ip": "172.168.1.234"}
|
52
|
+
# strings values eg. `{"ip": "172.168.1.234"}`. Can be up to 1024 characters in
|
53
|
+
# length
|
48
54
|
# @param [String] auth_payload Optional payload used to verify the Challenge upon
|
49
|
-
# creation. Only used with a Factor of type `totp` to carry
|
50
|
-
#
|
55
|
+
# creation. Only used with a Factor of type `totp` to carry the TOTP code that
|
56
|
+
# needs to be verified. For `TOTP` this value must be between 3 and 8 characters
|
57
|
+
# long.
|
51
58
|
# @return [ChallengeInstance] Created ChallengeInstance
|
52
59
|
def create(factor_sid: nil, expiration_date: :unset, details_message: :unset, details_fields: :unset, hidden_details: :unset, auth_payload: :unset)
|
53
60
|
data = Twilio::Values.of({
|
@@ -76,6 +83,9 @@ module Twilio
|
|
76
83
|
# @param [String] factor_sid The unique SID identifier of the Factor.
|
77
84
|
# @param [challenge.ChallengeStatuses] status The Status of the Challenges to
|
78
85
|
# fetch. One of `pending`, `expired`, `approved` or `denied`.
|
86
|
+
# @param [challenge.ListOrders] order The desired sort order of the Challenges
|
87
|
+
# list. One of `asc` or `desc` for ascending and descending respectively. Defaults
|
88
|
+
# to `asc`.
|
79
89
|
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
80
90
|
# guarantees to never return more than limit. Default is no limit
|
81
91
|
# @param [Integer] page_size Number of records to fetch per request, when
|
@@ -83,8 +93,14 @@ module Twilio
|
|
83
93
|
# but a limit is defined, stream() will attempt to read the limit with the most
|
84
94
|
# efficient page size, i.e. min(limit, 1000)
|
85
95
|
# @return [Array] Array of up to limit results
|
86
|
-
def list(factor_sid: :unset, status: :unset, limit: nil, page_size: nil)
|
87
|
-
self.stream(
|
96
|
+
def list(factor_sid: :unset, status: :unset, order: :unset, limit: nil, page_size: nil)
|
97
|
+
self.stream(
|
98
|
+
factor_sid: factor_sid,
|
99
|
+
status: status,
|
100
|
+
order: order,
|
101
|
+
limit: limit,
|
102
|
+
page_size: page_size
|
103
|
+
).entries
|
88
104
|
end
|
89
105
|
|
90
106
|
##
|
@@ -94,6 +110,9 @@ module Twilio
|
|
94
110
|
# @param [String] factor_sid The unique SID identifier of the Factor.
|
95
111
|
# @param [challenge.ChallengeStatuses] status The Status of the Challenges to
|
96
112
|
# fetch. One of `pending`, `expired`, `approved` or `denied`.
|
113
|
+
# @param [challenge.ListOrders] order The desired sort order of the Challenges
|
114
|
+
# list. One of `asc` or `desc` for ascending and descending respectively. Defaults
|
115
|
+
# to `asc`.
|
97
116
|
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
98
117
|
# guarantees to never return more than limit. Default is no limit.
|
99
118
|
# @param [Integer] page_size Number of records to fetch per request, when
|
@@ -101,10 +120,15 @@ module Twilio
|
|
101
120
|
# but a limit is defined, stream() will attempt to read the limit with the most
|
102
121
|
# efficient page size, i.e. min(limit, 1000)
|
103
122
|
# @return [Enumerable] Enumerable that will yield up to limit results
|
104
|
-
def stream(factor_sid: :unset, status: :unset, limit: nil, page_size: nil)
|
123
|
+
def stream(factor_sid: :unset, status: :unset, order: :unset, limit: nil, page_size: nil)
|
105
124
|
limits = @version.read_limits(limit, page_size)
|
106
125
|
|
107
|
-
page = self.page(
|
126
|
+
page = self.page(
|
127
|
+
factor_sid: factor_sid,
|
128
|
+
status: status,
|
129
|
+
order: order,
|
130
|
+
page_size: limits[:page_size],
|
131
|
+
)
|
108
132
|
|
109
133
|
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
110
134
|
end
|
@@ -129,14 +153,18 @@ module Twilio
|
|
129
153
|
# @param [String] factor_sid The unique SID identifier of the Factor.
|
130
154
|
# @param [challenge.ChallengeStatuses] status The Status of the Challenges to
|
131
155
|
# fetch. One of `pending`, `expired`, `approved` or `denied`.
|
156
|
+
# @param [challenge.ListOrders] order The desired sort order of the Challenges
|
157
|
+
# list. One of `asc` or `desc` for ascending and descending respectively. Defaults
|
158
|
+
# to `asc`.
|
132
159
|
# @param [String] page_token PageToken provided by the API
|
133
160
|
# @param [Integer] page_number Page Number, this value is simply for client state
|
134
161
|
# @param [Integer] page_size Number of records to return, defaults to 50
|
135
162
|
# @return [Page] Page of ChallengeInstance
|
136
|
-
def page(factor_sid: :unset, status: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
|
163
|
+
def page(factor_sid: :unset, status: :unset, order: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
|
137
164
|
params = Twilio::Values.of({
|
138
165
|
'FactorSid' => factor_sid,
|
139
166
|
'Status' => status,
|
167
|
+
'Order' => order,
|
140
168
|
'PageToken' => page_token,
|
141
169
|
'Page' => page_number,
|
142
170
|
'PageSize' => page_size,
|
@@ -210,10 +238,10 @@ module Twilio
|
|
210
238
|
# Initialize the ChallengeContext
|
211
239
|
# @param [Version] version Version that contains the resource
|
212
240
|
# @param [String] service_sid The unique SID identifier of the Service.
|
213
|
-
# @param [String] identity
|
214
|
-
#
|
215
|
-
# external system, such as your user's UUID,
|
216
|
-
#
|
241
|
+
# @param [String] identity Customer unique identity for the Entity owner of the
|
242
|
+
# Challenges. This identifier should be immutable, not PII, length between 8 and
|
243
|
+
# 64 characters, and generated by your external system, such as your user's UUID,
|
244
|
+
# GUID, or SID. It can only contain dash (-) separated alphanumeric characters.
|
217
245
|
# @param [String] sid A 34 character string that uniquely identifies this
|
218
246
|
# Challenge.
|
219
247
|
# @return [ChallengeContext] ChallengeContext
|
@@ -246,10 +274,19 @@ module Twilio
|
|
246
274
|
##
|
247
275
|
# Update the ChallengeInstance
|
248
276
|
# @param [String] auth_payload The optional payload needed to verify the
|
249
|
-
# Challenge. E.g., a TOTP would use the numeric code.
|
277
|
+
# Challenge. E.g., a TOTP would use the numeric code. For `TOTP` this value must
|
278
|
+
# be between 3 and 8 characters long. For `Push` this value can be up to 5456
|
279
|
+
# characters in length
|
280
|
+
# @param [Hash] metadata Custom metadata associated with the challenge. This is
|
281
|
+
# added by the Device/SDK directly to allow for the inclusion of device
|
282
|
+
# information. It must be a stringified JSON with only strings values eg. `{"os":
|
283
|
+
# "Android"}`. Can be up to 1024 characters in length.
|
250
284
|
# @return [ChallengeInstance] Updated ChallengeInstance
|
251
|
-
def update(auth_payload: :unset)
|
252
|
-
data = Twilio::Values.of({
|
285
|
+
def update(auth_payload: :unset, metadata: :unset)
|
286
|
+
data = Twilio::Values.of({
|
287
|
+
'AuthPayload' => auth_payload,
|
288
|
+
'Metadata' => Twilio.serialize_object(metadata),
|
289
|
+
})
|
253
290
|
|
254
291
|
payload = @version.update('POST', @uri, data: data)
|
255
292
|
|
@@ -303,7 +340,9 @@ module Twilio
|
|
303
340
|
# @param [Hash] payload payload that contains response from Twilio
|
304
341
|
# @param [String] service_sid The unique SID identifier of the Service.
|
305
342
|
# @param [String] identity Customer unique identity for the Entity owner of the
|
306
|
-
# Challenge. This
|
343
|
+
# Challenge. This identifier should be immutable, not PII, length between 8 and 64
|
344
|
+
# characters, and generated by your external system, such as your user's UUID,
|
345
|
+
# GUID, or SID. It can only contain dash (-) separated alphanumeric characters.
|
307
346
|
# @param [String] sid A 34 character string that uniquely identifies this
|
308
347
|
# Challenge.
|
309
348
|
# @return [ChallengeInstance] ChallengeInstance
|
@@ -326,6 +365,7 @@ module Twilio
|
|
326
365
|
'responded_reason' => payload['responded_reason'],
|
327
366
|
'details' => payload['details'],
|
328
367
|
'hidden_details' => payload['hidden_details'],
|
368
|
+
'metadata' => payload['metadata'],
|
329
369
|
'factor_type' => payload['factor_type'],
|
330
370
|
'url' => payload['url'],
|
331
371
|
'links' => payload['links'],
|
@@ -436,6 +476,12 @@ module Twilio
|
|
436
476
|
@properties['hidden_details']
|
437
477
|
end
|
438
478
|
|
479
|
+
##
|
480
|
+
# @return [Hash] Metadata of the challenge.
|
481
|
+
def metadata
|
482
|
+
@properties['metadata']
|
483
|
+
end
|
484
|
+
|
439
485
|
##
|
440
486
|
# @return [challenge.FactorTypes] The Factor Type of this Challenge
|
441
487
|
def factor_type
|
@@ -464,10 +510,16 @@ module Twilio
|
|
464
510
|
##
|
465
511
|
# Update the ChallengeInstance
|
466
512
|
# @param [String] auth_payload The optional payload needed to verify the
|
467
|
-
# Challenge. E.g., a TOTP would use the numeric code.
|
513
|
+
# Challenge. E.g., a TOTP would use the numeric code. For `TOTP` this value must
|
514
|
+
# be between 3 and 8 characters long. For `Push` this value can be up to 5456
|
515
|
+
# characters in length
|
516
|
+
# @param [Hash] metadata Custom metadata associated with the challenge. This is
|
517
|
+
# added by the Device/SDK directly to allow for the inclusion of device
|
518
|
+
# information. It must be a stringified JSON with only strings values eg. `{"os":
|
519
|
+
# "Android"}`. Can be up to 1024 characters in length.
|
468
520
|
# @return [ChallengeInstance] Updated ChallengeInstance
|
469
|
-
def update(auth_payload: :unset)
|
470
|
-
context.update(auth_payload: auth_payload, )
|
521
|
+
def update(auth_payload: :unset, metadata: :unset)
|
522
|
+
context.update(auth_payload: auth_payload, metadata: metadata, )
|
471
523
|
end
|
472
524
|
|
473
525
|
##
|
@@ -19,10 +19,10 @@ module Twilio
|
|
19
19
|
# Initialize the FactorList
|
20
20
|
# @param [Version] version Version that contains the resource
|
21
21
|
# @param [String] service_sid The unique SID identifier of the Service.
|
22
|
-
# @param [String] identity
|
23
|
-
#
|
24
|
-
# external system, such as your user's UUID,
|
25
|
-
#
|
22
|
+
# @param [String] identity Customer unique identity for the Entity owner of the
|
23
|
+
# Factor. This identifier should be immutable, not PII, length between 8 and 64
|
24
|
+
# characters, and generated by your external system, such as your user's UUID,
|
25
|
+
# GUID, or SID. It can only contain dash (-) separated alphanumeric characters.
|
26
26
|
# @return [FactorList] FactorList
|
27
27
|
def initialize(version, service_sid: nil, identity: nil)
|
28
28
|
super(version)
|
@@ -163,7 +163,9 @@ module Twilio
|
|
163
163
|
# @param [Version] version Version that contains the resource
|
164
164
|
# @param [String] service_sid The unique SID identifier of the Service.
|
165
165
|
# @param [String] identity Customer unique identity for the Entity owner of the
|
166
|
-
# Factor. This
|
166
|
+
# Factor. This identifier should be immutable, not PII, length between 8 and 64
|
167
|
+
# characters, and generated by your external system, such as your user's UUID,
|
168
|
+
# GUID, or SID. It can only contain dash (-) separated alphanumeric characters.
|
167
169
|
# @param [String] sid A 34 character string that uniquely identifies this Factor.
|
168
170
|
# @return [FactorContext] FactorContext
|
169
171
|
def initialize(version, service_sid, identity, sid)
|
@@ -202,8 +204,8 @@ module Twilio
|
|
202
204
|
# for the first time. E.g. for a TOTP, the numeric code.
|
203
205
|
# @param [String] friendly_name The new friendly name of this Factor. It can be up
|
204
206
|
# to 64 characters.
|
205
|
-
# @param [String] config_notification_token For APN, the device token. For FCM
|
206
|
-
# registration token. It used to send the push notifications. Required when
|
207
|
+
# @param [String] config_notification_token For APN, the device token. For FCM,
|
208
|
+
# the registration token. It is used to send the push notifications. Required when
|
207
209
|
# `factor_type` is `push`. If specified, this value must be between 32 and 255
|
208
210
|
# characters long.
|
209
211
|
# @param [String] config_sdk_version The Verify Push SDK version used to configure
|
@@ -217,8 +219,12 @@ module Twilio
|
|
217
219
|
# Must be between 3 and 8, inclusive
|
218
220
|
# @param [factor.TotpAlgorithms] config_alg The algorithm used to derive the TOTP
|
219
221
|
# codes. Can be `sha1`, `sha256` or `sha512`
|
222
|
+
# @param [String] config_notification_platform The transport technology used to
|
223
|
+
# generate the Notification Token. Can be `apn`, `fcm` or `none`.
|
224
|
+
#
|
225
|
+
# Required when `factor_type` is `push`.
|
220
226
|
# @return [FactorInstance] Updated FactorInstance
|
221
|
-
def update(auth_payload: :unset, friendly_name: :unset, config_notification_token: :unset, config_sdk_version: :unset, config_time_step: :unset, config_skew: :unset, config_code_length: :unset, config_alg: :unset)
|
227
|
+
def update(auth_payload: :unset, friendly_name: :unset, config_notification_token: :unset, config_sdk_version: :unset, config_time_step: :unset, config_skew: :unset, config_code_length: :unset, config_alg: :unset, config_notification_platform: :unset)
|
222
228
|
data = Twilio::Values.of({
|
223
229
|
'AuthPayload' => auth_payload,
|
224
230
|
'FriendlyName' => friendly_name,
|
@@ -228,6 +234,7 @@ module Twilio
|
|
228
234
|
'Config.Skew' => config_skew,
|
229
235
|
'Config.CodeLength' => config_code_length,
|
230
236
|
'Config.Alg' => config_alg,
|
237
|
+
'Config.NotificationPlatform' => config_notification_platform,
|
231
238
|
})
|
232
239
|
|
233
240
|
payload = @version.update('POST', @uri, data: data)
|
@@ -264,10 +271,10 @@ module Twilio
|
|
264
271
|
# @param [Version] version Version that contains the resource
|
265
272
|
# @param [Hash] payload payload that contains response from Twilio
|
266
273
|
# @param [String] service_sid The unique SID identifier of the Service.
|
267
|
-
# @param [String] identity
|
268
|
-
#
|
269
|
-
# external system, such as your user's UUID,
|
270
|
-
#
|
274
|
+
# @param [String] identity Customer unique identity for the Entity owner of the
|
275
|
+
# Factor. This identifier should be immutable, not PII, length between 8 and 64
|
276
|
+
# characters, and generated by your external system, such as your user's UUID,
|
277
|
+
# GUID, or SID. It can only contain dash (-) separated alphanumeric characters.
|
271
278
|
# @param [String] sid A 34 character string that uniquely identifies this Factor.
|
272
279
|
# @return [FactorInstance] FactorInstance
|
273
280
|
def initialize(version, payload, service_sid: nil, identity: nil, sid: nil)
|
@@ -286,6 +293,7 @@ module Twilio
|
|
286
293
|
'status' => payload['status'],
|
287
294
|
'factor_type' => payload['factor_type'],
|
288
295
|
'config' => payload['config'],
|
296
|
+
'metadata' => payload['metadata'],
|
289
297
|
'url' => payload['url'],
|
290
298
|
}
|
291
299
|
|
@@ -376,6 +384,12 @@ module Twilio
|
|
376
384
|
@properties['config']
|
377
385
|
end
|
378
386
|
|
387
|
+
##
|
388
|
+
# @return [Hash] Metadata of the factor.
|
389
|
+
def metadata
|
390
|
+
@properties['metadata']
|
391
|
+
end
|
392
|
+
|
379
393
|
##
|
380
394
|
# @return [String] The URL of this resource.
|
381
395
|
def url
|
@@ -402,8 +416,8 @@ module Twilio
|
|
402
416
|
# for the first time. E.g. for a TOTP, the numeric code.
|
403
417
|
# @param [String] friendly_name The new friendly name of this Factor. It can be up
|
404
418
|
# to 64 characters.
|
405
|
-
# @param [String] config_notification_token For APN, the device token. For FCM
|
406
|
-
# registration token. It used to send the push notifications. Required when
|
419
|
+
# @param [String] config_notification_token For APN, the device token. For FCM,
|
420
|
+
# the registration token. It is used to send the push notifications. Required when
|
407
421
|
# `factor_type` is `push`. If specified, this value must be between 32 and 255
|
408
422
|
# characters long.
|
409
423
|
# @param [String] config_sdk_version The Verify Push SDK version used to configure
|
@@ -417,8 +431,12 @@ module Twilio
|
|
417
431
|
# Must be between 3 and 8, inclusive
|
418
432
|
# @param [factor.TotpAlgorithms] config_alg The algorithm used to derive the TOTP
|
419
433
|
# codes. Can be `sha1`, `sha256` or `sha512`
|
434
|
+
# @param [String] config_notification_platform The transport technology used to
|
435
|
+
# generate the Notification Token. Can be `apn`, `fcm` or `none`.
|
436
|
+
#
|
437
|
+
# Required when `factor_type` is `push`.
|
420
438
|
# @return [FactorInstance] Updated FactorInstance
|
421
|
-
def update(auth_payload: :unset, friendly_name: :unset, config_notification_token: :unset, config_sdk_version: :unset, config_time_step: :unset, config_skew: :unset, config_code_length: :unset, config_alg: :unset)
|
439
|
+
def update(auth_payload: :unset, friendly_name: :unset, config_notification_token: :unset, config_sdk_version: :unset, config_time_step: :unset, config_skew: :unset, config_code_length: :unset, config_alg: :unset, config_notification_platform: :unset)
|
422
440
|
context.update(
|
423
441
|
auth_payload: auth_payload,
|
424
442
|
friendly_name: friendly_name,
|
@@ -428,6 +446,7 @@ module Twilio
|
|
428
446
|
config_skew: config_skew,
|
429
447
|
config_code_length: config_code_length,
|
430
448
|
config_alg: config_alg,
|
449
|
+
config_notification_platform: config_notification_platform,
|
431
450
|
)
|
432
451
|
end
|
433
452
|
|
@@ -19,10 +19,10 @@ module Twilio
|
|
19
19
|
# Initialize the NewFactorList
|
20
20
|
# @param [Version] version Version that contains the resource
|
21
21
|
# @param [String] service_sid The unique SID identifier of the Service.
|
22
|
-
# @param [String] identity
|
23
|
-
#
|
24
|
-
# external system, such as your user's UUID,
|
25
|
-
#
|
22
|
+
# @param [String] identity Customer unique identity for the Entity owner of the
|
23
|
+
# Factor. This identifier should be immutable, not PII, length between 8 and 64
|
24
|
+
# characters, and generated by your external system, such as your user's UUID,
|
25
|
+
# GUID, or SID. It can only contain dash (-) separated alphanumeric characters.
|
26
26
|
# @return [NewFactorList] NewFactorList
|
27
27
|
def initialize(version, service_sid: nil, identity: nil)
|
28
28
|
super(version)
|
@@ -34,45 +34,72 @@ module Twilio
|
|
34
34
|
|
35
35
|
##
|
36
36
|
# Create the NewFactorInstance
|
37
|
-
# @param [String] friendly_name The friendly name of this Factor.
|
38
|
-
# 64 characters.
|
37
|
+
# @param [String] friendly_name The friendly name of this Factor. This can be any
|
38
|
+
# string up to 64 characters, meant for humans to distinguish between Factors.
|
39
|
+
# For `factor_type` `push`, this could be a device name.
|
40
|
+
# For `factor_type` `totp`, this value is used as the “account name” in
|
41
|
+
# constructing the `binding.uri` property.
|
42
|
+
# At the same time, we recommend avoiding providing PII.
|
39
43
|
# @param [new_factor.FactorTypes] factor_type The Type of this Factor. Currently
|
40
|
-
# `push` and `totp` are supported.
|
41
|
-
# sales first to have the Verify TOTP feature enabled for your Twilio account.
|
44
|
+
# `push` and `totp` are supported.
|
42
45
|
# @param [String] binding_alg The algorithm used when `factor_type` is `push`.
|
43
46
|
# Algorithm supported: `ES256`
|
44
47
|
# @param [String] binding_public_key The Ecdsa public key in PKIX, ASN.1 DER
|
45
|
-
# format encoded in Base64
|
48
|
+
# format encoded in Base64.
|
49
|
+
#
|
50
|
+
# Required when `factor_type` is `push`
|
46
51
|
# @param [String] config_app_id The ID that uniquely identifies your app in the
|
47
|
-
# Google or Apple store, such as `com.example.myapp`.
|
48
|
-
# is `push`. If specified, it can be up to 100 characters long.
|
49
|
-
# @param [new_factor.NotificationPlatforms] config_notification_platform The
|
50
|
-
# transport technology used to generate the Notification Token. Can be `apn` or
|
51
|
-
# `fcm`. Required when `factor_type` is `push`
|
52
|
-
# @param [String] config_notification_token For APN, the device token. For FCM the
|
53
|
-
# registration token. It used to send the push notifications. Required when
|
54
|
-
# `factor_type` is `push`. If specified, this value must be between 32 and 255
|
52
|
+
# Google or Apple store, such as `com.example.myapp`. It can be up to 100
|
55
53
|
# characters long.
|
54
|
+
#
|
55
|
+
# Required when `factor_type` is `push`.
|
56
|
+
# @param [new_factor.NotificationPlatforms] config_notification_platform The
|
57
|
+
# transport technology used to generate the Notification Token. Can be `apn`,
|
58
|
+
# `fcm` or `none`.
|
59
|
+
#
|
60
|
+
# Required when `factor_type` is `push`.
|
61
|
+
# @param [String] config_notification_token For APN, the device token. For FCM,
|
62
|
+
# the registration token. It is used to send the push notifications. Must be
|
63
|
+
# between 32 and 255 characters long.
|
64
|
+
#
|
65
|
+
# Required when `factor_type` is `push`.
|
56
66
|
# @param [String] config_sdk_version The Verify Push SDK version used to configure
|
57
67
|
# the factor
|
68
|
+
#
|
69
|
+
# Required when `factor_type` is `push`
|
58
70
|
# @param [String] binding_secret The shared secret for TOTP factors encoded in
|
59
|
-
# Base32
|
71
|
+
# Base32. This can be provided when creating the Factor, otherwise it will be
|
72
|
+
# generated.
|
73
|
+
#
|
74
|
+
# Used when `factor_type` is `totp`
|
60
75
|
# @param [String] config_time_step Defines how often, in seconds, are TOTP codes
|
61
76
|
# generated. i.e, a new TOTP code is generated every time_step seconds. Must be
|
62
77
|
# between 20 and 60 seconds, inclusive. The default value is defined at the
|
63
|
-
# service level in the property totp.time_step
|
64
|
-
#
|
78
|
+
# service level in the property `totp.time_step`. Defaults to 30 seconds if not
|
79
|
+
# configured.
|
80
|
+
#
|
81
|
+
# Used when `factor_type` is `totp`
|
65
82
|
# @param [String] config_skew The number of time-steps, past and future, that are
|
66
83
|
# valid for validation of TOTP codes. Must be between 0 and 2, inclusive. The
|
67
|
-
# default value is defined at the service level in the property totp.skew
|
68
|
-
# configured defaults to 1
|
84
|
+
# default value is defined at the service level in the property `totp.skew`. If
|
85
|
+
# not configured defaults to 1.
|
86
|
+
#
|
87
|
+
# Used when `factor_type` is `totp`
|
69
88
|
# @param [String] config_code_length Number of digits for generated TOTP codes.
|
70
89
|
# Must be between 3 and 8, inclusive. The default value is defined at the service
|
71
|
-
# level in the property totp.code_length
|
90
|
+
# level in the property `totp.code_length`. If not configured defaults to 6.
|
91
|
+
#
|
92
|
+
# Used when `factor_type` is `totp`
|
72
93
|
# @param [new_factor.TotpAlgorithms] config_alg The algorithm used to derive the
|
73
|
-
# TOTP codes. Can be `sha1`, `sha256` or `sha512`. Defaults to `sha1
|
94
|
+
# TOTP codes. Can be `sha1`, `sha256` or `sha512`. Defaults to `sha1`.
|
95
|
+
#
|
96
|
+
# Used when `factor_type` is `totp`
|
97
|
+
# @param [Hash] metadata Custom metadata associated with the factor. This is added
|
98
|
+
# by the Device/SDK directly to allow for the inclusion of device information. It
|
99
|
+
# must be a stringified JSON with only strings values eg. `{"os": "Android"}`. Can
|
100
|
+
# be up to 1024 characters in length.
|
74
101
|
# @return [NewFactorInstance] Created NewFactorInstance
|
75
|
-
def create(friendly_name: nil, factor_type: nil, binding_alg: :unset, binding_public_key: :unset, config_app_id: :unset, config_notification_platform: :unset, config_notification_token: :unset, config_sdk_version: :unset, binding_secret: :unset, config_time_step: :unset, config_skew: :unset, config_code_length: :unset, config_alg: :unset)
|
102
|
+
def create(friendly_name: nil, factor_type: nil, binding_alg: :unset, binding_public_key: :unset, config_app_id: :unset, config_notification_platform: :unset, config_notification_token: :unset, config_sdk_version: :unset, binding_secret: :unset, config_time_step: :unset, config_skew: :unset, config_code_length: :unset, config_alg: :unset, metadata: :unset)
|
76
103
|
data = Twilio::Values.of({
|
77
104
|
'FriendlyName' => friendly_name,
|
78
105
|
'FactorType' => factor_type,
|
@@ -87,6 +114,7 @@ module Twilio
|
|
87
114
|
'Config.Skew' => config_skew,
|
88
115
|
'Config.CodeLength' => config_code_length,
|
89
116
|
'Config.Alg' => config_alg,
|
117
|
+
'Metadata' => Twilio.serialize_object(metadata),
|
90
118
|
})
|
91
119
|
|
92
120
|
payload = @version.create('POST', @uri, data: data)
|
@@ -150,10 +178,10 @@ module Twilio
|
|
150
178
|
# @param [Version] version Version that contains the resource
|
151
179
|
# @param [Hash] payload payload that contains response from Twilio
|
152
180
|
# @param [String] service_sid The unique SID identifier of the Service.
|
153
|
-
# @param [String] identity
|
154
|
-
#
|
155
|
-
# external system, such as your user's UUID,
|
156
|
-
#
|
181
|
+
# @param [String] identity Customer unique identity for the Entity owner of the
|
182
|
+
# Factor. This identifier should be immutable, not PII, length between 8 and 64
|
183
|
+
# characters, and generated by your external system, such as your user's UUID,
|
184
|
+
# GUID, or SID. It can only contain dash (-) separated alphanumeric characters.
|
157
185
|
# @return [NewFactorInstance] NewFactorInstance
|
158
186
|
def initialize(version, payload, service_sid: nil, identity: nil)
|
159
187
|
super(version)
|
@@ -172,6 +200,7 @@ module Twilio
|
|
172
200
|
'status' => payload['status'],
|
173
201
|
'factor_type' => payload['factor_type'],
|
174
202
|
'config' => payload['config'],
|
203
|
+
'metadata' => payload['metadata'],
|
175
204
|
'url' => payload['url'],
|
176
205
|
}
|
177
206
|
end
|
@@ -207,7 +236,7 @@ module Twilio
|
|
207
236
|
end
|
208
237
|
|
209
238
|
##
|
210
|
-
# @return [Hash]
|
239
|
+
# @return [Hash] Binding of the factor
|
211
240
|
def binding
|
212
241
|
@properties['binding']
|
213
242
|
end
|
@@ -243,11 +272,17 @@ module Twilio
|
|
243
272
|
end
|
244
273
|
|
245
274
|
##
|
246
|
-
# @return [Hash]
|
275
|
+
# @return [Hash] Configurations for a `factor_type`.
|
247
276
|
def config
|
248
277
|
@properties['config']
|
249
278
|
end
|
250
279
|
|
280
|
+
##
|
281
|
+
# @return [Hash] Metadata of the factor.
|
282
|
+
def metadata
|
283
|
+
@properties['metadata']
|
284
|
+
end
|
285
|
+
|
251
286
|
##
|
252
287
|
# @return [String] The URL of this resource.
|
253
288
|
def url
|
@@ -32,7 +32,7 @@ module Twilio
|
|
32
32
|
# @param [String] identity The unique external identifier for the Entity of the
|
33
33
|
# Service. This identifier should be immutable, not PII, length between 8 and 64
|
34
34
|
# characters, and generated by your external system, such as your user's UUID,
|
35
|
-
# GUID, or SID.
|
35
|
+
# GUID, or SID. It can only contain dash (-) separated alphanumeric characters.
|
36
36
|
# @return [EntityInstance] Created EntityInstance
|
37
37
|
def create(identity: nil)
|
38
38
|
data = Twilio::Values.of({'Identity' => identity, })
|
@@ -168,7 +168,9 @@ module Twilio
|
|
168
168
|
# @param [Version] version Version that contains the resource
|
169
169
|
# @param [String] service_sid The unique SID identifier of the Service.
|
170
170
|
# @param [String] identity The unique external identifier for the Entity of the
|
171
|
-
# Service
|
171
|
+
# Service. This identifier should be immutable, not PII, length between 8 and 64
|
172
|
+
# characters, and generated by your external system, such as your user's UUID,
|
173
|
+
# GUID, or SID. It can only contain dash (-) separated alphanumeric characters.
|
172
174
|
# @return [EntityContext] EntityContext
|
173
175
|
def initialize(version, service_sid, identity)
|
174
176
|
super(version)
|
@@ -288,7 +290,9 @@ module Twilio
|
|
288
290
|
# @param [Hash] payload payload that contains response from Twilio
|
289
291
|
# @param [String] service_sid The unique SID identifier of the Service.
|
290
292
|
# @param [String] identity The unique external identifier for the Entity of the
|
291
|
-
# Service
|
293
|
+
# Service. This identifier should be immutable, not PII, length between 8 and 64
|
294
|
+
# characters, and generated by your external system, such as your user's UUID,
|
295
|
+
# GUID, or SID. It can only contain dash (-) separated alphanumeric characters.
|
292
296
|
# @return [EntityInstance] EntityInstance
|
293
297
|
def initialize(version, payload, service_sid: nil, identity: nil)
|
294
298
|
super(version)
|
@@ -33,7 +33,8 @@ module Twilio
|
|
33
33
|
# {email}[https://www.twilio.com/docs/verify/email] to verify. Phone numbers must
|
34
34
|
# be in {E.164 format}[https://www.twilio.com/docs/glossary/what-e164].
|
35
35
|
# @param [String] channel The verification method to use. Can be:
|
36
|
-
# {`email`}[https://www.twilio.com/docs/verify/email], `sms` or
|
36
|
+
# {`email`}[https://www.twilio.com/docs/verify/email], `sms`, `whatsapp` or
|
37
|
+
# `call`.
|
37
38
|
# @param [String] custom_friendly_name A custom user defined friendly name that
|
38
39
|
# overwrites the existing one in the verification message
|
39
40
|
# @param [String] custom_message The text of a custom message to use for the
|
@@ -42,10 +43,11 @@ module Twilio
|
|
42
43
|
# for example, to dial an extension. For more information, see the Programmable
|
43
44
|
# Voice documentation of
|
44
45
|
# {sendDigits}[https://www.twilio.com/docs/voice/twiml/number#attributes-sendDigits].
|
45
|
-
# @param [String] locale The locale to use for the verification SMS or
|
46
|
-
# be: `af`, `ar`, `ca`, `cs`, `da`, `de`, `el`, `en`, `en-GB`, `es`,
|
47
|
-
# `he`, `hi`, `hr`, `hu`, `id`, `it`, `ja`, `ko`, `ms`, `nb`, `nl`,
|
48
|
-
# `pr-BR`, `ro`, `ru`, `sv`, `th`, `tl`, `tr`, `vi`, `zh`, `zh-CN`, or
|
46
|
+
# @param [String] locale The locale to use for the verification SMS, WhatsApp or
|
47
|
+
# call. Can be: `af`, `ar`, `ca`, `cs`, `da`, `de`, `el`, `en`, `en-GB`, `es`,
|
48
|
+
# `fi`, `fr`, `he`, `hi`, `hr`, `hu`, `id`, `it`, `ja`, `ko`, `ms`, `nb`, `nl`,
|
49
|
+
# `pl`, `pt`, `pr-BR`, `ro`, `ru`, `sv`, `th`, `tl`, `tr`, `vi`, `zh`, `zh-CN`, or
|
50
|
+
# `zh-HK.`
|
49
51
|
# @param [String] custom_code A pre-generated code to use for verification. The
|
50
52
|
# code can be between 4 and 10 characters, inclusive.
|
51
53
|
# @param [String] amount The amount of the associated PSD2 compliant transaction.
|
@@ -59,13 +61,20 @@ module Twilio
|
|
59
61
|
# may include multiple Rate Limit values in each request.
|
60
62
|
# @param [Hash] channel_configuration
|
61
63
|
# {`email`}[https://www.twilio.com/docs/verify/email] channel configuration in
|
62
|
-
# json format.
|
64
|
+
# json format. The fields 'from' and 'from_name' are optional but if included the
|
65
|
+
# 'from' field must have a valid email address.
|
63
66
|
# @param [String] app_hash Your {App
|
64
67
|
# Hash}[https://developers.google.com/identity/sms-retriever/verify#computing_your_apps_hash_string]
|
65
68
|
# to be appended at the end of your verification SMS body. Applies only to SMS.
|
66
69
|
# Example SMS body: `<#> Your AppName verification code is: 1234 He42w354ol9`.
|
70
|
+
# @param [String] template_sid The message
|
71
|
+
# {template}[https://www.twilio.com/docs/verify/api/templates]. If provided, will
|
72
|
+
# override the default template for the Service. SMS channel only.
|
73
|
+
# @param [String] template_custom_substitutions A stringified JSON object in which
|
74
|
+
# the keys are the template's special variables and the values are the variables
|
75
|
+
# substitutions.
|
67
76
|
# @return [VerificationInstance] Created VerificationInstance
|
68
|
-
def create(to: nil, channel: nil, custom_friendly_name: :unset, custom_message: :unset, send_digits: :unset, locale: :unset, custom_code: :unset, amount: :unset, payee: :unset, rate_limits: :unset, channel_configuration: :unset, app_hash: :unset)
|
77
|
+
def create(to: nil, channel: nil, custom_friendly_name: :unset, custom_message: :unset, send_digits: :unset, locale: :unset, custom_code: :unset, amount: :unset, payee: :unset, rate_limits: :unset, channel_configuration: :unset, app_hash: :unset, template_sid: :unset, template_custom_substitutions: :unset)
|
69
78
|
data = Twilio::Values.of({
|
70
79
|
'To' => to,
|
71
80
|
'Channel' => channel,
|
@@ -79,6 +88,8 @@ module Twilio
|
|
79
88
|
'RateLimits' => Twilio.serialize_object(rate_limits),
|
80
89
|
'ChannelConfiguration' => Twilio.serialize_object(channel_configuration),
|
81
90
|
'AppHash' => app_hash,
|
91
|
+
'TemplateSid' => template_sid,
|
92
|
+
'TemplateCustomSubstitutions' => template_custom_substitutions,
|
82
93
|
})
|
83
94
|
|
84
95
|
payload = @version.create('POST', @uri, data: data)
|
@@ -216,6 +227,7 @@ module Twilio
|
|
216
227
|
'send_code_attempts' => payload['send_code_attempts'],
|
217
228
|
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
218
229
|
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
230
|
+
'sna' => payload['sna'],
|
219
231
|
'url' => payload['url'],
|
220
232
|
}
|
221
233
|
|
@@ -313,6 +325,12 @@ module Twilio
|
|
313
325
|
@properties['date_updated']
|
314
326
|
end
|
315
327
|
|
328
|
+
##
|
329
|
+
# @return [Hash] The set of fields used for a silent network auth (`sna`) verification
|
330
|
+
def sna
|
331
|
+
@properties['sna']
|
332
|
+
end
|
333
|
+
|
316
334
|
##
|
317
335
|
# @return [String] The absolute URL of the Verification resource
|
318
336
|
def url
|