class Twilio::REST::Verify::V2::ServiceInstance
Public Class Methods
Initialize the ServiceInstance
@param [Version] version Version
that contains the resource @param [Hash] payload payload that contains response from Twilio
@param [String] sid The Twilio-provided string that uniquely identifies the
Verification Service resource to fetch.
@return [ServiceInstance] ServiceInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/verify/v2/service.rb 469 def initialize(version, payload, sid: nil) 470 super(version) 471 472 # Marshaled Properties 473 @properties = { 474 'sid' => payload['sid'], 475 'account_sid' => payload['account_sid'], 476 'friendly_name' => payload['friendly_name'], 477 'code_length' => payload['code_length'].to_i, 478 'lookup_enabled' => payload['lookup_enabled'], 479 'psd2_enabled' => payload['psd2_enabled'], 480 'skip_sms_to_landlines' => payload['skip_sms_to_landlines'], 481 'dtmf_input_required' => payload['dtmf_input_required'], 482 'tts_name' => payload['tts_name'], 483 'do_not_share_warning_enabled' => payload['do_not_share_warning_enabled'], 484 'custom_code_enabled' => payload['custom_code_enabled'], 485 'push' => payload['push'], 486 'totp' => payload['totp'], 487 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 488 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 489 'url' => payload['url'], 490 'links' => payload['links'], 491 } 492 493 # Context 494 @instance_context = nil 495 @params = {'sid' => sid || @properties['sid'], } 496 end
Public Instance Methods
Access the access_tokens
@return [access_tokens] access_tokens
# File lib/twilio-ruby/rest/verify/v2/service.rb 740 def access_tokens 741 context.access_tokens 742 end
@return [String] The SID of the Account that created the resource
# File lib/twilio-ruby/rest/verify/v2/service.rb 517 def account_sid 518 @properties['account_sid'] 519 end
@return [String] The length of the verification code
# File lib/twilio-ruby/rest/verify/v2/service.rb 529 def code_length 530 @properties['code_length'] 531 end
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [ServiceContext] ServiceContext
for this ServiceInstance
# File lib/twilio-ruby/rest/verify/v2/service.rb 502 def context 503 unless @instance_context 504 @instance_context = ServiceContext.new(@version, @params['sid'], ) 505 end 506 @instance_context 507 end
@return [Boolean] Whether to allow sending verifications with a custom code.
# File lib/twilio-ruby/rest/verify/v2/service.rb 571 def custom_code_enabled 572 @properties['custom_code_enabled'] 573 end
@return [Time] The RFC 2822 date and time in GMT when the resource was created
# File lib/twilio-ruby/rest/verify/v2/service.rb 589 def date_created 590 @properties['date_created'] 591 end
@return [Time] The RFC 2822 date and time in GMT when the resource was last updated
# File lib/twilio-ruby/rest/verify/v2/service.rb 595 def date_updated 596 @properties['date_updated'] 597 end
Delete the ServiceInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/verify/v2/service.rb 621 def delete 622 context.delete 623 end
@return [Boolean] Whether to ask the user to press a number before delivering the verify code in a phone call
# File lib/twilio-ruby/rest/verify/v2/service.rb 553 def dtmf_input_required 554 @properties['dtmf_input_required'] 555 end
Access the entities @return [entities] entities
# File lib/twilio-ruby/rest/verify/v2/service.rb 726 def entities 727 context.entities 728 end
Fetch the ServiceInstance
@return [ServiceInstance] Fetched ServiceInstance
# File lib/twilio-ruby/rest/verify/v2/service.rb 614 def fetch 615 context.fetch 616 end
@return [String] The string that you assigned to describe the verification service
# File lib/twilio-ruby/rest/verify/v2/service.rb 523 def friendly_name 524 @properties['friendly_name'] 525 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/verify/v2/service.rb 753 def inspect 754 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 755 "<Twilio.Verify.V2.ServiceInstance #{values}>" 756 end
@return [String] The URLs of related resources
# File lib/twilio-ruby/rest/verify/v2/service.rb 607 def links 608 @properties['links'] 609 end
@return [Boolean] Whether to perform a lookup with each verification
# File lib/twilio-ruby/rest/verify/v2/service.rb 535 def lookup_enabled 536 @properties['lookup_enabled'] 537 end
Access the messaging_configurations
@return [messaging_configurations] messaging_configurations
# File lib/twilio-ruby/rest/verify/v2/service.rb 719 def messaging_configurations 720 context.messaging_configurations 721 end
@return [Boolean] Whether to pass PSD2 transaction parameters when starting a verification
# File lib/twilio-ruby/rest/verify/v2/service.rb 541 def psd2_enabled 542 @properties['psd2_enabled'] 543 end
@return [Hash] The service level configuration of factor push type.
# File lib/twilio-ruby/rest/verify/v2/service.rb 577 def push 578 @properties['push'] 579 end
Access the rate_limits
@return [rate_limits] rate_limits
# File lib/twilio-ruby/rest/verify/v2/service.rb 712 def rate_limits 713 context.rate_limits 714 end
@return [String] The unique string that identifies the resource
# File lib/twilio-ruby/rest/verify/v2/service.rb 511 def sid 512 @properties['sid'] 513 end
@return [Boolean] Whether to skip sending SMS verifications to landlines
# File lib/twilio-ruby/rest/verify/v2/service.rb 547 def skip_sms_to_landlines 548 @properties['skip_sms_to_landlines'] 549 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/verify/v2/service.rb 746 def to_s 747 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 748 "<Twilio.Verify.V2.ServiceInstance #{values}>" 749 end
@return [Hash] The service level configuration of factor TOTP type.
# File lib/twilio-ruby/rest/verify/v2/service.rb 583 def totp 584 @properties['totp'] 585 end
@return [String] The name of an alternative text-to-speech service to use in phone calls
# File lib/twilio-ruby/rest/verify/v2/service.rb 559 def tts_name 560 @properties['tts_name'] 561 end
Update the ServiceInstance
@param [String] friendly_name
A descriptive string that you create to describe
the verification service. It can be up to 30 characters long. **This value should not contain PII.**
@param [String] code_length
The length of the verification code to generate.
Must be an integer value between 4 and 10, inclusive.
@param [Boolean] lookup_enabled
Whether to perform a lookup with each
verification started and return info about the phone number.
@param [Boolean] skip_sms_to_landlines
Whether to skip sending SMS verifications
to landlines. Requires `lookup_enabled`.
@param [Boolean] dtmf_input_required
Whether to ask the user to press a number
before delivering the verify code in a phone call.
@param [String] tts_name
The name of an alternative text-to-speech service to
use in phone calls. Applies only to TTS languages.
@param [Boolean] psd2_enabled
Whether to pass PSD2 transaction parameters when
starting a verification.
@param [Boolean] do_not_share_warning_enabled
Whether to add a privacy warning
at the end of an SMS. **Disabled by default and applies only for SMS.**
@param [Boolean] custom_code_enabled
Whether to allow sending verifications with
a custom code instead of a randomly generated one. Not available for all customers.
@param [Boolean] push_include_date Optional configuration for the Push factors.
If true, include the date in the Challenge's reponse. Otherwise, the date is omitted from the response. See {Challenge}[https://www.twilio.com/docs/verify/api/challenge] resource’s details parameter for more info. Default: true
@param [String] push_apn_credential_sid Optional configuration for the Push
factors. Set the APN Credential for this service. This will allow to send push notifications to iOS devices. See {Credential Resource}[https://www.twilio.com/docs/notify/api/credential-resource]
@param [String] push_fcm_credential_sid Optional configuration for the Push
factors. Set the FCM Credential for this service. This will allow to send push notifications to Android devices. See {Credential Resource}[https://www.twilio.com/docs/notify/api/credential-resource]
@param [String] totp_issuer Optional configuration for the TOTP factors. Set
TOTP Issuer for this service. This will allow to configure the issuer of the TOTP URI.
@param [String] totp_time_step Optional configuration for the TOTP factors.
Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive. Defaults to 30 seconds
@param [String] totp_code_length Optional configuration for the TOTP factors.
Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6
@param [String] totp_skew Optional configuration for the TOTP factors. The
number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1
@return [ServiceInstance] Updated ServiceInstance
# File lib/twilio-ruby/rest/verify/v2/service.rb 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) 675 context.update( 676 friendly_name: friendly_name, 677 code_length: code_length, 678 lookup_enabled: lookup_enabled, 679 skip_sms_to_landlines: skip_sms_to_landlines, 680 dtmf_input_required: dtmf_input_required, 681 tts_name: tts_name, 682 psd2_enabled: psd2_enabled, 683 do_not_share_warning_enabled: do_not_share_warning_enabled, 684 custom_code_enabled: custom_code_enabled, 685 push_include_date: push_include_date, 686 push_apn_credential_sid: push_apn_credential_sid, 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, 692 ) 693 end
@return [String] The absolute URL of the resource
# File lib/twilio-ruby/rest/verify/v2/service.rb 601 def url 602 @properties['url'] 603 end
Access the verification_checks
@return [verification_checks] verification_checks
# File lib/twilio-ruby/rest/verify/v2/service.rb 705 def verification_checks 706 context.verification_checks 707 end
Access the verifications @return [verifications] verifications
# File lib/twilio-ruby/rest/verify/v2/service.rb 698 def verifications 699 context.verifications 700 end
Access the webhooks @return [webhooks] webhooks
# File lib/twilio-ruby/rest/verify/v2/service.rb 733 def webhooks 734 context.webhooks 735 end