Class: Twilio::REST::Verify::V2::ServiceContext::VerificationInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Verify::V2::ServiceContext::VerificationInstance
- Defined in:
- lib/twilio-ruby/rest/verify/v2/service/verification.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Verification resource.
-
#amount ⇒ String
The amount of the associated PSD2 compliant transaction.
- #channel ⇒ Channel
-
#context ⇒ VerificationContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date and time in GMT when the resource was created specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
-
#date_updated ⇒ Time
The date and time in GMT when the resource was last updated specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
-
#fetch ⇒ VerificationInstance
Fetch the VerificationInstance.
-
#initialize(version, payload, service_sid: nil, sid: nil) ⇒ VerificationInstance
constructor
Initialize the VerificationInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#lookup ⇒ Hash
Information about the phone number being verified.
-
#payee ⇒ String
The payee of the associated PSD2 compliant transaction.
-
#send_code_attempts ⇒ Array<Hash>
An array of verification attempt objects containing the channel attempted and the channel-specific transaction SID.
-
#service_sid ⇒ String
The SID of the [Service](www.twilio.com/docs/verify/api/service) the resource is associated with.
-
#sid ⇒ String
The unique string that we created to identify the Verification resource.
-
#sna ⇒ Hash
The set of fields used for a silent network auth (
sna) verification. -
#status ⇒ String
The status of the verification.
-
#to ⇒ String
The phone number or [email](www.twilio.com/docs/verify/email) being verified.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(status: nil) ⇒ VerificationInstance
Update the VerificationInstance.
-
#url ⇒ String
The absolute URL of the Verification resource.
-
#valid ⇒ Boolean
Use "status" instead.
Constructor Details
#initialize(version, payload, service_sid: nil, sid: nil) ⇒ VerificationInstance
Initialize the VerificationInstance
491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 |
# File 'lib/twilio-ruby/rest/verify/v2/service/verification.rb', line 491 def initialize(version, payload , service_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'service_sid' => payload['service_sid'], 'account_sid' => payload['account_sid'], 'to' => payload['to'], 'channel' => payload['channel'], 'status' => payload['status'], 'valid' => payload['valid'], 'lookup' => payload['lookup'], 'amount' => payload['amount'], 'payee' => payload['payee'], 'send_code_attempts' => payload['send_code_attempts'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'sna' => payload['sna'], 'url' => payload['url'], } # Context @instance_context = nil @params = { 'service_sid' => service_sid || @properties['service_sid'] ,'sid' => sid || @properties['sid'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Verification resource.
544 545 546 |
# File 'lib/twilio-ruby/rest/verify/v2/service/verification.rb', line 544 def account_sid @properties['account_sid'] end |
#amount ⇒ String
Returns The amount of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled.
580 581 582 |
# File 'lib/twilio-ruby/rest/verify/v2/service/verification.rb', line 580 def amount @properties['amount'] end |
#channel ⇒ Channel
556 557 558 |
# File 'lib/twilio-ruby/rest/verify/v2/service/verification.rb', line 556 def channel @properties['channel'] end |
#context ⇒ VerificationContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
523 524 525 526 527 528 |
# File 'lib/twilio-ruby/rest/verify/v2/service/verification.rb', line 523 def context unless @instance_context @instance_context = VerificationContext.new(@version , @params['service_sid'], @params['sid']) end @instance_context end |
#date_created ⇒ Time
Returns The date and time in GMT when the resource was created specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
598 599 600 |
# File 'lib/twilio-ruby/rest/verify/v2/service/verification.rb', line 598 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date and time in GMT when the resource was last updated specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
604 605 606 |
# File 'lib/twilio-ruby/rest/verify/v2/service/verification.rb', line 604 def date_updated @properties['date_updated'] end |
#fetch ⇒ VerificationInstance
Fetch the VerificationInstance
623 624 625 626 |
# File 'lib/twilio-ruby/rest/verify/v2/service/verification.rb', line 623 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
650 651 652 653 |
# File 'lib/twilio-ruby/rest/verify/v2/service/verification.rb', line 650 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Verify.V2.VerificationInstance #{values}>" end |
#lookup ⇒ Hash
Returns Information about the phone number being verified.
574 575 576 |
# File 'lib/twilio-ruby/rest/verify/v2/service/verification.rb', line 574 def lookup @properties['lookup'] end |
#payee ⇒ String
Returns The payee of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled.
586 587 588 |
# File 'lib/twilio-ruby/rest/verify/v2/service/verification.rb', line 586 def payee @properties['payee'] end |
#send_code_attempts ⇒ Array<Hash>
Returns An array of verification attempt objects containing the channel attempted and the channel-specific transaction SID.
592 593 594 |
# File 'lib/twilio-ruby/rest/verify/v2/service/verification.rb', line 592 def send_code_attempts @properties['send_code_attempts'] end |
#service_sid ⇒ String
Returns The SID of the [Service](www.twilio.com/docs/verify/api/service) the resource is associated with.
538 539 540 |
# File 'lib/twilio-ruby/rest/verify/v2/service/verification.rb', line 538 def service_sid @properties['service_sid'] end |
#sid ⇒ String
Returns The unique string that we created to identify the Verification resource.
532 533 534 |
# File 'lib/twilio-ruby/rest/verify/v2/service/verification.rb', line 532 def sid @properties['sid'] end |
#sna ⇒ Hash
Returns The set of fields used for a silent network auth (sna) verification. Contains a single field with the URL to be invoked to verify the phone number.
610 611 612 |
# File 'lib/twilio-ruby/rest/verify/v2/service/verification.rb', line 610 def sna @properties['sna'] end |
#status ⇒ String
Returns The status of the verification. Can be: pending, approved, canceled, max_attempts_reached, deleted, failed or expired.
562 563 564 |
# File 'lib/twilio-ruby/rest/verify/v2/service/verification.rb', line 562 def status @properties['status'] end |
#to ⇒ String
Returns The phone number or [email](www.twilio.com/docs/verify/email) being verified. Phone numbers must be in [E.164 format](www.twilio.com/docs/glossary/what-e164).
550 551 552 |
# File 'lib/twilio-ruby/rest/verify/v2/service/verification.rb', line 550 def to @properties['to'] end |
#to_s ⇒ Object
Provide a user friendly representation
643 644 645 646 |
# File 'lib/twilio-ruby/rest/verify/v2/service/verification.rb', line 643 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Verify.V2.VerificationInstance #{values}>" end |
#update(status: nil) ⇒ VerificationInstance
Update the VerificationInstance
632 633 634 635 636 637 638 639 |
# File 'lib/twilio-ruby/rest/verify/v2/service/verification.rb', line 632 def update( status: nil ) context.update( status: status, ) end |
#url ⇒ String
Returns The absolute URL of the Verification resource.
616 617 618 |
# File 'lib/twilio-ruby/rest/verify/v2/service/verification.rb', line 616 def url @properties['url'] end |
#valid ⇒ Boolean
Returns Use "status" instead. Legacy property indicating whether the verification was successful.
568 569 570 |
# File 'lib/twilio-ruby/rest/verify/v2/service/verification.rb', line 568 def valid @properties['valid'] end |