Class: Twilio::REST::Verify::V2::ServiceInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Verify::V2::ServiceInstance
- Defined in:
- lib/twilio-ruby/rest/verify/v2/service.rb
Overview
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the Account that created the resource.
-
#code_length ⇒ String
The length of the verification code.
-
#context ⇒ ServiceContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The RFC 2822 date and time in GMT when the resource was created.
-
#date_updated ⇒ Time
The RFC 2822 date and time in GMT when the resource was last updated.
-
#delete ⇒ Boolean
Deletes the ServiceInstance.
-
#dtmf_input_required ⇒ Boolean
Whether to ask the user to press a number before delivering the verify code in a phone call.
-
#fetch ⇒ ServiceInstance
Fetch a ServiceInstance.
-
#friendly_name ⇒ String
The string that you assigned to describe the verification service.
-
#initialize(version, payload, sid: nil) ⇒ ServiceInstance
constructor
Initialize the ServiceInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#links ⇒ String
The URLs of related resources.
-
#lookup_enabled ⇒ Boolean
Whether to perform a lookup with each verification.
-
#psd2_enabled ⇒ Boolean
Whether to pass PSD2 transaction parameters when starting a verification.
-
#rate_limits ⇒ rate_limits
Access the rate_limits.
-
#sid ⇒ String
The unique string that identifies the resource.
-
#skip_sms_to_landlines ⇒ Boolean
Whether to skip sending SMS verifications to landlines.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#tts_name ⇒ String
The name of an alternative text-to-speech service to use in phone calls.
-
#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) ⇒ ServiceInstance
Update the ServiceInstance.
-
#url ⇒ String
The absolute URL of the resource.
-
#verification_checks ⇒ verification_checks
Access the verification_checks.
-
#verifications ⇒ verifications
Access the verifications.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ ServiceInstance
Initialize the ServiceInstance
340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 340 def initialize(version, payload, sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'account_sid' => payload['account_sid'], 'friendly_name' => payload['friendly_name'], 'code_length' => payload['code_length'].to_i, 'lookup_enabled' => payload['lookup_enabled'], 'psd2_enabled' => payload['psd2_enabled'], 'skip_sms_to_landlines' => payload['skip_sms_to_landlines'], 'dtmf_input_required' => payload['dtmf_input_required'], 'tts_name' => payload['tts_name'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'url' => payload['url'], 'links' => payload['links'], } # Context @instance_context = nil @params = {'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
Returns The SID of the Account that created the resource.
384 385 386 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 384 def account_sid @properties['account_sid'] end |
#code_length ⇒ String
Returns The length of the verification code.
396 397 398 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 396 def code_length @properties['code_length'] end |
#context ⇒ ServiceContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
369 370 371 372 373 374 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 369 def context unless @instance_context @instance_context = ServiceContext.new(@version, @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
Returns The RFC 2822 date and time in GMT when the resource was created.
432 433 434 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 432 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The RFC 2822 date and time in GMT when the resource was last updated.
438 439 440 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 438 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Deletes the ServiceInstance
464 465 466 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 464 def delete context.delete end |
#dtmf_input_required ⇒ Boolean
Returns Whether to ask the user to press a number before delivering the verify code in a phone call.
420 421 422 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 420 def dtmf_input_required @properties['dtmf_input_required'] end |
#fetch ⇒ ServiceInstance
Fetch a ServiceInstance
457 458 459 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 457 def fetch context.fetch end |
#friendly_name ⇒ String
Returns The string that you assigned to describe the verification service.
390 391 392 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 390 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
527 528 529 530 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 527 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Verify.V2.ServiceInstance #{values}>" end |
#links ⇒ String
Returns The URLs of related resources.
450 451 452 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 450 def links @properties['links'] end |
#lookup_enabled ⇒ Boolean
Returns Whether to perform a lookup with each verification.
402 403 404 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 402 def lookup_enabled @properties['lookup_enabled'] end |
#psd2_enabled ⇒ Boolean
Returns Whether to pass PSD2 transaction parameters when starting a verification.
408 409 410 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 408 def psd2_enabled @properties['psd2_enabled'] end |
#rate_limits ⇒ rate_limits
Access the rate_limits
514 515 516 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 514 def rate_limits context.rate_limits end |
#sid ⇒ String
Returns The unique string that identifies the resource.
378 379 380 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 378 def sid @properties['sid'] end |
#skip_sms_to_landlines ⇒ Boolean
Returns Whether to skip sending SMS verifications to landlines.
414 415 416 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 414 def skip_sms_to_landlines @properties['skip_sms_to_landlines'] end |
#to_s ⇒ Object
Provide a user friendly representation
520 521 522 523 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 520 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Verify.V2.ServiceInstance #{values}>" end |
#tts_name ⇒ String
Returns The name of an alternative text-to-speech service to use in phone calls.
426 427 428 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 426 def tts_name @properties['tts_name'] end |
#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) ⇒ ServiceInstance
Update the ServiceInstance
485 486 487 488 489 490 491 492 493 494 495 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 485 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) context.update( friendly_name: friendly_name, code_length: code_length, lookup_enabled: lookup_enabled, skip_sms_to_landlines: skip_sms_to_landlines, dtmf_input_required: dtmf_input_required, tts_name: tts_name, psd2_enabled: psd2_enabled, ) end |
#url ⇒ String
Returns The absolute URL of the resource.
444 445 446 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 444 def url @properties['url'] end |
#verification_checks ⇒ verification_checks
Access the verification_checks
507 508 509 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 507 def verification_checks context.verification_checks end |
#verifications ⇒ verifications
Access the verifications
500 501 502 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 500 def verifications context.verifications end |