twilio-ruby 5.51.0 → 5.53.0
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/.travis.yml +22 -28
- data/CHANGES.md +50 -0
- data/README.md +3 -2
- data/lib/twilio-ruby/http/http_client.rb +3 -1
- 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/bulkexports/v1/export.rb +0 -8
- data/lib/twilio-ruby/rest/bulkexports/v1/export/day.rb +0 -8
- data/lib/twilio-ruby/rest/bulkexports/v1/export/export_custom_job.rb +1 -7
- data/lib/twilio-ruby/rest/bulkexports/v1/export/job.rb +1 -9
- data/lib/twilio-ruby/rest/bulkexports/v1/export_configuration.rb +0 -8
- data/lib/twilio-ruby/rest/events/v1/schema.rb +12 -12
- data/lib/twilio-ruby/rest/events/v1/schema/{schema_version.rb → version.rb} +37 -37
- data/lib/twilio-ruby/rest/events/v1/sink.rb +22 -0
- data/lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb +15 -12
- data/lib/twilio-ruby/rest/messaging/v1/service.rb +69 -26
- data/lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb +3 -3
- 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/sms_command.rb +6 -6
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +16 -4
- data/lib/twilio-ruby/rest/verify/v2/service.rb +61 -3
- data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb +39 -1
- data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge/notification.rb +202 -0
- data/lib/twilio-ruby/rest/verify/v2/service/entity/new_factor.rb +45 -15
- data/lib/twilio-ruby/version.rb +1 -1
- metadata +4 -3
@@ -147,7 +147,7 @@ module Twilio
|
|
147
147
|
'us_app_to_person_usecase' => payload['us_app_to_person_usecase'],
|
148
148
|
'has_embedded_links' => payload['has_embedded_links'],
|
149
149
|
'has_embedded_phone' => payload['has_embedded_phone'],
|
150
|
-
'
|
150
|
+
'campaign_status' => payload['campaign_status'],
|
151
151
|
'campaign_id' => payload['campaign_id'],
|
152
152
|
'is_externally_registered' => payload['is_externally_registered'],
|
153
153
|
'rate_limits' => payload['rate_limits'],
|
@@ -207,8 +207,8 @@ module Twilio
|
|
207
207
|
|
208
208
|
##
|
209
209
|
# @return [String] Campaign status
|
210
|
-
def
|
211
|
-
@properties['
|
210
|
+
def campaign_status
|
211
|
+
@properties['campaign_status']
|
212
212
|
end
|
213
213
|
|
214
214
|
##
|
@@ -140,7 +140,7 @@ module Twilio
|
|
140
140
|
# available as variable `{{contact.channel.address}}`.
|
141
141
|
# @param [String] from The Twilio phone number to send messages or initiate calls
|
142
142
|
# from during the Flow's Execution. Available as variable
|
143
|
-
# `{{flow.channel.address}}`.
|
143
|
+
# `{{flow.channel.address}}`. For SMS, this can also be a Messaging Service SID.
|
144
144
|
# @param [Hash] parameters JSON data that will be added to the Flow's context and
|
145
145
|
# that can be accessed as variables inside your Flow. For example, if you pass in
|
146
146
|
# `Parameters={"name":"Zeke"}`, a widget in your Flow can reference the variable
|
@@ -140,7 +140,7 @@ module Twilio
|
|
140
140
|
# available as variable `{{contact.channel.address}}`.
|
141
141
|
# @param [String] from The Twilio phone number to send messages or initiate calls
|
142
142
|
# from during the Flow's Execution. Available as variable
|
143
|
-
# `{{flow.channel.address}}`.
|
143
|
+
# `{{flow.channel.address}}`. For SMS, this can also be a Messaging Service SID.
|
144
144
|
# @param [Hash] parameters JSON data that will be added to the Flow's context and
|
145
145
|
# that can be accessed as variables inside your Flow. For example, if you pass in
|
146
146
|
# `Parameters={"name":"Zeke"}`, a widget in your Flow can reference the variable
|
@@ -53,8 +53,8 @@ module Twilio
|
|
53
53
|
# Lists SmsCommandInstance records from the API as a list.
|
54
54
|
# Unlike stream(), this operation is eager and will load `limit` records into
|
55
55
|
# memory before returning.
|
56
|
-
# @param [String] sim The SID or unique name of the Sim that SMS Command
|
57
|
-
# to or from.
|
56
|
+
# @param [String] sim The SID or unique name of the Sim resource that SMS Command
|
57
|
+
# was sent to or from.
|
58
58
|
# @param [sms_command.Status] status The status of the SMS Command. Can be:
|
59
59
|
# `queued`, `sent`, `delivered`, `received` or `failed`. See the {SMS Command
|
60
60
|
# Status
|
@@ -85,8 +85,8 @@ module Twilio
|
|
85
85
|
# Streams SmsCommandInstance records from the API as an Enumerable.
|
86
86
|
# This operation lazily loads records as efficiently as possible until the limit
|
87
87
|
# is reached.
|
88
|
-
# @param [String] sim The SID or unique name of the Sim that SMS Command
|
89
|
-
# to or from.
|
88
|
+
# @param [String] sim The SID or unique name of the Sim resource that SMS Command
|
89
|
+
# was sent to or from.
|
90
90
|
# @param [sms_command.Status] status The status of the SMS Command. Can be:
|
91
91
|
# `queued`, `sent`, `delivered`, `received` or `failed`. See the {SMS Command
|
92
92
|
# Status
|
@@ -128,8 +128,8 @@ module Twilio
|
|
128
128
|
##
|
129
129
|
# Retrieve a single page of SmsCommandInstance records from the API.
|
130
130
|
# Request is executed immediately.
|
131
|
-
# @param [String] sim The SID or unique name of the Sim that SMS Command
|
132
|
-
# to or from.
|
131
|
+
# @param [String] sim The SID or unique name of the Sim resource that SMS Command
|
132
|
+
# was sent to or from.
|
133
133
|
# @param [sms_command.Status] status The status of the SMS Command. Can be:
|
134
134
|
# `queued`, `sent`, `delivered`, `received` or `failed`. See the {SMS Command
|
135
135
|
# Status
|
@@ -360,9 +360,16 @@ module Twilio
|
|
360
360
|
|
361
361
|
##
|
362
362
|
# Delete the TaskInstance
|
363
|
+
# @param [String] if_match If provided, deletes this Task if (and only if) the
|
364
|
+
# {ETag}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag] header of
|
365
|
+
# the Task matches the provided value. This matches the semantics of (and is
|
366
|
+
# implemented with) the HTTP {If-Match
|
367
|
+
# header}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match].
|
363
368
|
# @return [Boolean] true if delete succeeds, false otherwise
|
364
|
-
def delete
|
365
|
-
|
369
|
+
def delete(if_match: :unset)
|
370
|
+
headers = Twilio::Values.of({'If-Match' => if_match, })
|
371
|
+
|
372
|
+
@version.delete('DELETE', @uri, headers: headers)
|
366
373
|
end
|
367
374
|
|
368
375
|
##
|
@@ -623,9 +630,14 @@ module Twilio
|
|
623
630
|
|
624
631
|
##
|
625
632
|
# Delete the TaskInstance
|
633
|
+
# @param [String] if_match If provided, deletes this Task if (and only if) the
|
634
|
+
# {ETag}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag] header of
|
635
|
+
# the Task matches the provided value. This matches the semantics of (and is
|
636
|
+
# implemented with) the HTTP {If-Match
|
637
|
+
# header}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match].
|
626
638
|
# @return [Boolean] true if delete succeeds, false otherwise
|
627
|
-
def delete
|
628
|
-
context.delete
|
639
|
+
def delete(if_match: :unset)
|
640
|
+
context.delete(if_match: if_match, )
|
629
641
|
end
|
630
642
|
|
631
643
|
##
|
@@ -60,8 +60,21 @@ module Twilio
|
|
60
60
|
# factors. Set the FCM Credential for this service. This will allow to send push
|
61
61
|
# notifications to Android devices. See {Credential
|
62
62
|
# Resource}[https://www.twilio.com/docs/notify/api/credential-resource]
|
63
|
+
# @param [String] totp_issuer Optional configuration for the TOTP factors. Set
|
64
|
+
# TOTP Issuer for this service. This will allow to configure the issuer of the
|
65
|
+
# TOTP URI. Defaults to the service friendly name if not provided.
|
66
|
+
# @param [String] totp_time_step Optional configuration for the TOTP factors.
|
67
|
+
# Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is
|
68
|
+
# generated every time_step seconds. Must be between 20 and 60 seconds, inclusive.
|
69
|
+
# Defaults to 30 seconds
|
70
|
+
# @param [String] totp_code_length Optional configuration for the TOTP factors.
|
71
|
+
# Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive.
|
72
|
+
# Defaults to 6
|
73
|
+
# @param [String] totp_skew Optional configuration for the TOTP factors. The
|
74
|
+
# number of time-steps, past and future, that are valid for validation of TOTP
|
75
|
+
# codes. Must be between 0 and 2, inclusive. Defaults to 1
|
63
76
|
# @return [ServiceInstance] Created ServiceInstance
|
64
|
-
def create(friendly_name: nil, code_length: :unset, lookup_enabled: :unset, skip_sms_to_landlines: :unset, dtmf_input_required: :unset, tts_name: :unset, psd2_enabled: :unset, do_not_share_warning_enabled: :unset, custom_code_enabled: :unset, push_include_date: :unset, push_apn_credential_sid: :unset, push_fcm_credential_sid: :unset)
|
77
|
+
def create(friendly_name: nil, code_length: :unset, lookup_enabled: :unset, skip_sms_to_landlines: :unset, dtmf_input_required: :unset, tts_name: :unset, psd2_enabled: :unset, do_not_share_warning_enabled: :unset, custom_code_enabled: :unset, push_include_date: :unset, push_apn_credential_sid: :unset, push_fcm_credential_sid: :unset, totp_issuer: :unset, totp_time_step: :unset, totp_code_length: :unset, totp_skew: :unset)
|
65
78
|
data = Twilio::Values.of({
|
66
79
|
'FriendlyName' => friendly_name,
|
67
80
|
'CodeLength' => code_length,
|
@@ -75,6 +88,10 @@ module Twilio
|
|
75
88
|
'Push.IncludeDate' => push_include_date,
|
76
89
|
'Push.ApnCredentialSid' => push_apn_credential_sid,
|
77
90
|
'Push.FcmCredentialSid' => push_fcm_credential_sid,
|
91
|
+
'Totp.Issuer' => totp_issuer,
|
92
|
+
'Totp.TimeStep' => totp_time_step,
|
93
|
+
'Totp.CodeLength' => totp_code_length,
|
94
|
+
'Totp.Skew' => totp_skew,
|
78
95
|
})
|
79
96
|
|
80
97
|
payload = @version.create('POST', @uri, data: data)
|
@@ -273,8 +290,21 @@ module Twilio
|
|
273
290
|
# factors. Set the FCM Credential for this service. This will allow to send push
|
274
291
|
# notifications to Android devices. See {Credential
|
275
292
|
# Resource}[https://www.twilio.com/docs/notify/api/credential-resource]
|
293
|
+
# @param [String] totp_issuer Optional configuration for the TOTP factors. Set
|
294
|
+
# TOTP Issuer for this service. This will allow to configure the issuer of the
|
295
|
+
# TOTP URI.
|
296
|
+
# @param [String] totp_time_step Optional configuration for the TOTP factors.
|
297
|
+
# Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is
|
298
|
+
# generated every time_step seconds. Must be between 20 and 60 seconds, inclusive.
|
299
|
+
# Defaults to 30 seconds
|
300
|
+
# @param [String] totp_code_length Optional configuration for the TOTP factors.
|
301
|
+
# Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive.
|
302
|
+
# Defaults to 6
|
303
|
+
# @param [String] totp_skew Optional configuration for the TOTP factors. The
|
304
|
+
# number of time-steps, past and future, that are valid for validation of TOTP
|
305
|
+
# codes. Must be between 0 and 2, inclusive. Defaults to 1
|
276
306
|
# @return [ServiceInstance] Updated ServiceInstance
|
277
|
-
def update(friendly_name: :unset, code_length: :unset, lookup_enabled: :unset, skip_sms_to_landlines: :unset, dtmf_input_required: :unset, tts_name: :unset, psd2_enabled: :unset, do_not_share_warning_enabled: :unset, custom_code_enabled: :unset, push_include_date: :unset, push_apn_credential_sid: :unset, push_fcm_credential_sid: :unset)
|
307
|
+
def update(friendly_name: :unset, code_length: :unset, lookup_enabled: :unset, skip_sms_to_landlines: :unset, dtmf_input_required: :unset, tts_name: :unset, psd2_enabled: :unset, do_not_share_warning_enabled: :unset, custom_code_enabled: :unset, push_include_date: :unset, push_apn_credential_sid: :unset, push_fcm_credential_sid: :unset, totp_issuer: :unset, totp_time_step: :unset, totp_code_length: :unset, totp_skew: :unset)
|
278
308
|
data = Twilio::Values.of({
|
279
309
|
'FriendlyName' => friendly_name,
|
280
310
|
'CodeLength' => code_length,
|
@@ -288,6 +318,10 @@ module Twilio
|
|
288
318
|
'Push.IncludeDate' => push_include_date,
|
289
319
|
'Push.ApnCredentialSid' => push_apn_credential_sid,
|
290
320
|
'Push.FcmCredentialSid' => push_fcm_credential_sid,
|
321
|
+
'Totp.Issuer' => totp_issuer,
|
322
|
+
'Totp.TimeStep' => totp_time_step,
|
323
|
+
'Totp.CodeLength' => totp_code_length,
|
324
|
+
'Totp.Skew' => totp_skew,
|
291
325
|
})
|
292
326
|
|
293
327
|
payload = @version.update('POST', @uri, data: data)
|
@@ -449,6 +483,7 @@ module Twilio
|
|
449
483
|
'do_not_share_warning_enabled' => payload['do_not_share_warning_enabled'],
|
450
484
|
'custom_code_enabled' => payload['custom_code_enabled'],
|
451
485
|
'push' => payload['push'],
|
486
|
+
'totp' => payload['totp'],
|
452
487
|
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
453
488
|
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
454
489
|
'url' => payload['url'],
|
@@ -543,6 +578,12 @@ module Twilio
|
|
543
578
|
@properties['push']
|
544
579
|
end
|
545
580
|
|
581
|
+
##
|
582
|
+
# @return [Hash] The service level configuration of factor TOTP type.
|
583
|
+
def totp
|
584
|
+
@properties['totp']
|
585
|
+
end
|
586
|
+
|
546
587
|
##
|
547
588
|
# @return [Time] The RFC 2822 date and time in GMT when the resource was created
|
548
589
|
def date_created
|
@@ -616,8 +657,21 @@ module Twilio
|
|
616
657
|
# factors. Set the FCM Credential for this service. This will allow to send push
|
617
658
|
# notifications to Android devices. See {Credential
|
618
659
|
# Resource}[https://www.twilio.com/docs/notify/api/credential-resource]
|
660
|
+
# @param [String] totp_issuer Optional configuration for the TOTP factors. Set
|
661
|
+
# TOTP Issuer for this service. This will allow to configure the issuer of the
|
662
|
+
# TOTP URI.
|
663
|
+
# @param [String] totp_time_step Optional configuration for the TOTP factors.
|
664
|
+
# Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is
|
665
|
+
# generated every time_step seconds. Must be between 20 and 60 seconds, inclusive.
|
666
|
+
# Defaults to 30 seconds
|
667
|
+
# @param [String] totp_code_length Optional configuration for the TOTP factors.
|
668
|
+
# Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive.
|
669
|
+
# Defaults to 6
|
670
|
+
# @param [String] totp_skew Optional configuration for the TOTP factors. The
|
671
|
+
# number of time-steps, past and future, that are valid for validation of TOTP
|
672
|
+
# codes. Must be between 0 and 2, inclusive. Defaults to 1
|
619
673
|
# @return [ServiceInstance] Updated ServiceInstance
|
620
|
-
def update(friendly_name: :unset, code_length: :unset, lookup_enabled: :unset, skip_sms_to_landlines: :unset, dtmf_input_required: :unset, tts_name: :unset, psd2_enabled: :unset, do_not_share_warning_enabled: :unset, custom_code_enabled: :unset, push_include_date: :unset, push_apn_credential_sid: :unset, push_fcm_credential_sid: :unset)
|
674
|
+
def update(friendly_name: :unset, code_length: :unset, lookup_enabled: :unset, skip_sms_to_landlines: :unset, dtmf_input_required: :unset, tts_name: :unset, psd2_enabled: :unset, do_not_share_warning_enabled: :unset, custom_code_enabled: :unset, push_include_date: :unset, push_apn_credential_sid: :unset, push_fcm_credential_sid: :unset, totp_issuer: :unset, totp_time_step: :unset, totp_code_length: :unset, totp_skew: :unset)
|
621
675
|
context.update(
|
622
676
|
friendly_name: friendly_name,
|
623
677
|
code_length: code_length,
|
@@ -631,6 +685,10 @@ module Twilio
|
|
631
685
|
push_include_date: push_include_date,
|
632
686
|
push_apn_credential_sid: push_apn_credential_sid,
|
633
687
|
push_fcm_credential_sid: push_fcm_credential_sid,
|
688
|
+
totp_issuer: totp_issuer,
|
689
|
+
totp_time_step: totp_time_step,
|
690
|
+
totp_code_length: totp_code_length,
|
691
|
+
totp_skew: totp_skew,
|
634
692
|
)
|
635
693
|
end
|
636
694
|
|
@@ -45,14 +45,18 @@ module Twilio
|
|
45
45
|
# @param [Hash] hidden_details Details provided to give context about the
|
46
46
|
# Challenge. Not shown to the end user. It must be a stringified JSON with only
|
47
47
|
# strings values eg. `{"ip": "172.168.1.234"}`
|
48
|
+
# @param [String] auth_payload Optional payload used to verify the Challenge upon
|
49
|
+
# creation. Only used with a Factor of type `totp` to carry the TOTP code that
|
50
|
+
# needs to be verified.
|
48
51
|
# @return [ChallengeInstance] Created ChallengeInstance
|
49
|
-
def create(factor_sid: nil, expiration_date: :unset, details_message: :unset, details_fields: :unset, hidden_details: :unset)
|
52
|
+
def create(factor_sid: nil, expiration_date: :unset, details_message: :unset, details_fields: :unset, hidden_details: :unset, auth_payload: :unset)
|
50
53
|
data = Twilio::Values.of({
|
51
54
|
'FactorSid' => factor_sid,
|
52
55
|
'ExpirationDate' => Twilio.serialize_iso8601_datetime(expiration_date),
|
53
56
|
'Details.Message' => details_message,
|
54
57
|
'Details.Fields' => Twilio.serialize_list(details_fields) { |e| Twilio.serialize_object(e) },
|
55
58
|
'HiddenDetails' => Twilio.serialize_object(hidden_details),
|
59
|
+
'AuthPayload' => auth_payload,
|
56
60
|
})
|
57
61
|
|
58
62
|
payload = @version.create('POST', @uri, data: data)
|
@@ -219,6 +223,9 @@ module Twilio
|
|
219
223
|
# Path Solution
|
220
224
|
@solution = {service_sid: service_sid, identity: identity, sid: sid, }
|
221
225
|
@uri = "/Services/#{@solution[:service_sid]}/Entities/#{@solution[:identity]}/Challenges/#{@solution[:sid]}"
|
226
|
+
|
227
|
+
# Dependents
|
228
|
+
@notifications = nil
|
222
229
|
end
|
223
230
|
|
224
231
|
##
|
@@ -255,6 +262,23 @@ module Twilio
|
|
255
262
|
)
|
256
263
|
end
|
257
264
|
|
265
|
+
##
|
266
|
+
# Access the notifications
|
267
|
+
# @return [NotificationList]
|
268
|
+
# @return [NotificationContext]
|
269
|
+
def notifications
|
270
|
+
unless @notifications
|
271
|
+
@notifications = NotificationList.new(
|
272
|
+
@version,
|
273
|
+
service_sid: @solution[:service_sid],
|
274
|
+
identity: @solution[:identity],
|
275
|
+
challenge_sid: @solution[:sid],
|
276
|
+
)
|
277
|
+
end
|
278
|
+
|
279
|
+
@notifications
|
280
|
+
end
|
281
|
+
|
258
282
|
##
|
259
283
|
# Provide a user friendly representation
|
260
284
|
def to_s
|
@@ -304,6 +328,7 @@ module Twilio
|
|
304
328
|
'hidden_details' => payload['hidden_details'],
|
305
329
|
'factor_type' => payload['factor_type'],
|
306
330
|
'url' => payload['url'],
|
331
|
+
'links' => payload['links'],
|
307
332
|
}
|
308
333
|
|
309
334
|
# Context
|
@@ -423,6 +448,12 @@ module Twilio
|
|
423
448
|
@properties['url']
|
424
449
|
end
|
425
450
|
|
451
|
+
##
|
452
|
+
# @return [String] Nested resource URLs.
|
453
|
+
def links
|
454
|
+
@properties['links']
|
455
|
+
end
|
456
|
+
|
426
457
|
##
|
427
458
|
# Fetch the ChallengeInstance
|
428
459
|
# @return [ChallengeInstance] Fetched ChallengeInstance
|
@@ -439,6 +470,13 @@ module Twilio
|
|
439
470
|
context.update(auth_payload: auth_payload, )
|
440
471
|
end
|
441
472
|
|
473
|
+
##
|
474
|
+
# Access the notifications
|
475
|
+
# @return [notifications] notifications
|
476
|
+
def notifications
|
477
|
+
context.notifications
|
478
|
+
end
|
479
|
+
|
442
480
|
##
|
443
481
|
# Provide a user friendly representation
|
444
482
|
def to_s
|
@@ -0,0 +1,202 @@
|
|
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 V2 < Version
|
13
|
+
class ServiceContext < InstanceContext
|
14
|
+
class EntityContext < InstanceContext
|
15
|
+
class ChallengeContext < InstanceContext
|
16
|
+
##
|
17
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
18
|
+
class NotificationList < ListResource
|
19
|
+
##
|
20
|
+
# Initialize the NotificationList
|
21
|
+
# @param [Version] version Version that contains the resource
|
22
|
+
# @param [String] service_sid The unique SID identifier of the Service.
|
23
|
+
# @param [String] identity Customer unique identity for the Entity owner of the
|
24
|
+
# Challenge. This value must be between 8 and 64 characters long.
|
25
|
+
# @param [String] challenge_sid The unique SID identifier of the Challenge.
|
26
|
+
# @return [NotificationList] NotificationList
|
27
|
+
def initialize(version, service_sid: nil, identity: nil, challenge_sid: nil)
|
28
|
+
super(version)
|
29
|
+
|
30
|
+
# Path Solution
|
31
|
+
@solution = {service_sid: service_sid, identity: identity, challenge_sid: challenge_sid}
|
32
|
+
@uri = "/Services/#{@solution[:service_sid]}/Entities/#{@solution[:identity]}/Challenges/#{@solution[:challenge_sid]}/Notifications"
|
33
|
+
end
|
34
|
+
|
35
|
+
##
|
36
|
+
# Create the NotificationInstance
|
37
|
+
# @param [String] ttl How long, in seconds, the Notification is valid. Delivery
|
38
|
+
# will be attempted if the device is offline until the TTL elapses. 0 means that
|
39
|
+
# the notification delivery is attempted immediately, only once, and is not stored
|
40
|
+
# for future delivery. Must be an integer between 0 and 300 seconds, inclusive.
|
41
|
+
# Defaults to 300 seconds.
|
42
|
+
# @return [NotificationInstance] Created NotificationInstance
|
43
|
+
def create(ttl: :unset)
|
44
|
+
data = Twilio::Values.of({'Ttl' => ttl, })
|
45
|
+
|
46
|
+
payload = @version.create('POST', @uri, data: data)
|
47
|
+
|
48
|
+
NotificationInstance.new(
|
49
|
+
@version,
|
50
|
+
payload,
|
51
|
+
service_sid: @solution[:service_sid],
|
52
|
+
identity: @solution[:identity],
|
53
|
+
challenge_sid: @solution[:challenge_sid],
|
54
|
+
)
|
55
|
+
end
|
56
|
+
|
57
|
+
##
|
58
|
+
# Provide a user friendly representation
|
59
|
+
def to_s
|
60
|
+
'#<Twilio.Verify.V2.NotificationList>'
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
##
|
65
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
66
|
+
class NotificationPage < Page
|
67
|
+
##
|
68
|
+
# Initialize the NotificationPage
|
69
|
+
# @param [Version] version Version that contains the resource
|
70
|
+
# @param [Response] response Response from the API
|
71
|
+
# @param [Hash] solution Path solution for the resource
|
72
|
+
# @return [NotificationPage] NotificationPage
|
73
|
+
def initialize(version, response, solution)
|
74
|
+
super(version, response)
|
75
|
+
|
76
|
+
# Path Solution
|
77
|
+
@solution = solution
|
78
|
+
end
|
79
|
+
|
80
|
+
##
|
81
|
+
# Build an instance of NotificationInstance
|
82
|
+
# @param [Hash] payload Payload response from the API
|
83
|
+
# @return [NotificationInstance] NotificationInstance
|
84
|
+
def get_instance(payload)
|
85
|
+
NotificationInstance.new(
|
86
|
+
@version,
|
87
|
+
payload,
|
88
|
+
service_sid: @solution[:service_sid],
|
89
|
+
identity: @solution[:identity],
|
90
|
+
challenge_sid: @solution[:challenge_sid],
|
91
|
+
)
|
92
|
+
end
|
93
|
+
|
94
|
+
##
|
95
|
+
# Provide a user friendly representation
|
96
|
+
def to_s
|
97
|
+
'<Twilio.Verify.V2.NotificationPage>'
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
##
|
102
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
103
|
+
class NotificationInstance < InstanceResource
|
104
|
+
##
|
105
|
+
# Initialize the NotificationInstance
|
106
|
+
# @param [Version] version Version that contains the resource
|
107
|
+
# @param [Hash] payload payload that contains response from Twilio
|
108
|
+
# @param [String] service_sid The unique SID identifier of the Service.
|
109
|
+
# @param [String] identity Customer unique identity for the Entity owner of the
|
110
|
+
# Challenge. This value must be between 8 and 64 characters long.
|
111
|
+
# @param [String] challenge_sid The unique SID identifier of the Challenge.
|
112
|
+
# @return [NotificationInstance] NotificationInstance
|
113
|
+
def initialize(version, payload, service_sid: nil, identity: nil, challenge_sid: nil)
|
114
|
+
super(version)
|
115
|
+
|
116
|
+
# Marshaled Properties
|
117
|
+
@properties = {
|
118
|
+
'sid' => payload['sid'],
|
119
|
+
'account_sid' => payload['account_sid'],
|
120
|
+
'service_sid' => payload['service_sid'],
|
121
|
+
'entity_sid' => payload['entity_sid'],
|
122
|
+
'identity' => payload['identity'],
|
123
|
+
'challenge_sid' => payload['challenge_sid'],
|
124
|
+
'priority' => payload['priority'],
|
125
|
+
'ttl' => payload['ttl'].to_i,
|
126
|
+
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
127
|
+
}
|
128
|
+
end
|
129
|
+
|
130
|
+
##
|
131
|
+
# @return [String] A string that uniquely identifies this Notification.
|
132
|
+
def sid
|
133
|
+
@properties['sid']
|
134
|
+
end
|
135
|
+
|
136
|
+
##
|
137
|
+
# @return [String] Account Sid.
|
138
|
+
def account_sid
|
139
|
+
@properties['account_sid']
|
140
|
+
end
|
141
|
+
|
142
|
+
##
|
143
|
+
# @return [String] Service Sid.
|
144
|
+
def service_sid
|
145
|
+
@properties['service_sid']
|
146
|
+
end
|
147
|
+
|
148
|
+
##
|
149
|
+
# @return [String] Entity Sid.
|
150
|
+
def entity_sid
|
151
|
+
@properties['entity_sid']
|
152
|
+
end
|
153
|
+
|
154
|
+
##
|
155
|
+
# @return [String] Unique external identifier of the Entity
|
156
|
+
def identity
|
157
|
+
@properties['identity']
|
158
|
+
end
|
159
|
+
|
160
|
+
##
|
161
|
+
# @return [String] Challenge Sid.
|
162
|
+
def challenge_sid
|
163
|
+
@properties['challenge_sid']
|
164
|
+
end
|
165
|
+
|
166
|
+
##
|
167
|
+
# @return [String] The priority of the Notification.
|
168
|
+
def priority
|
169
|
+
@properties['priority']
|
170
|
+
end
|
171
|
+
|
172
|
+
##
|
173
|
+
# @return [String] How long, in seconds, the Notification is valid.
|
174
|
+
def ttl
|
175
|
+
@properties['ttl']
|
176
|
+
end
|
177
|
+
|
178
|
+
##
|
179
|
+
# @return [Time] The date this Notification was created
|
180
|
+
def date_created
|
181
|
+
@properties['date_created']
|
182
|
+
end
|
183
|
+
|
184
|
+
##
|
185
|
+
# Provide a user friendly representation
|
186
|
+
def to_s
|
187
|
+
"<Twilio.Verify.V2.NotificationInstance>"
|
188
|
+
end
|
189
|
+
|
190
|
+
##
|
191
|
+
# Provide a detailed, user friendly representation
|
192
|
+
def inspect
|
193
|
+
"<Twilio.Verify.V2.NotificationInstance>"
|
194
|
+
end
|
195
|
+
end
|
196
|
+
end
|
197
|
+
end
|
198
|
+
end
|
199
|
+
end
|
200
|
+
end
|
201
|
+
end
|
202
|
+
end
|