Class: Twilio::REST::Verify::V2::ServiceContext::WebhookInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Verify::V2::ServiceContext::WebhookInstance
- Defined in:
- lib/twilio-ruby/rest/verify/v2/service/webhook.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Service resource.
-
#context ⇒ WebhookContext
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 [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
-
#date_updated ⇒ Time
The date and time in GMT when the resource was last updated specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
-
#delete ⇒ Boolean
Delete the WebhookInstance.
-
#event_types ⇒ Array<String>
The array of events that this Webhook is subscribed to.
-
#fetch ⇒ WebhookInstance
Fetch the WebhookInstance.
-
#friendly_name ⇒ String
The string that you assigned to describe the webhook.
-
#initialize(version, payload, service_sid: nil, sid: nil) ⇒ WebhookInstance
constructor
Initialize the WebhookInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#service_sid ⇒ String
The unique SID identifier of the Service.
-
#sid ⇒ String
The unique string that we created to identify the Webhook resource.
- #status ⇒ Status
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(friendly_name: :unset, event_types: :unset, webhook_url: :unset, status: :unset, version_: :unset) ⇒ WebhookInstance
Update the WebhookInstance.
-
#url ⇒ String
The absolute URL of the Webhook resource.
- #version ⇒ Version
- #webhook_method ⇒ Methods
-
#webhook_url ⇒ String
The URL associated with this Webhook.
Constructor Details
#initialize(version, payload, service_sid: nil, sid: nil) ⇒ WebhookInstance
Initialize the WebhookInstance
586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 |
# File 'lib/twilio-ruby/rest/verify/v2/service/webhook.rb', line 586 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'], 'friendly_name' => payload['friendly_name'], 'event_types' => payload['event_types'], 'status' => payload['status'], 'version' => payload['version'], 'webhook_url' => payload['webhook_url'], 'webhook_method' => payload['webhook_method'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), '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 Service resource.
636 637 638 |
# File 'lib/twilio-ruby/rest/verify/v2/service/webhook.rb', line 636 def account_sid @properties['account_sid'] end |
#context ⇒ WebhookContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
615 616 617 618 619 620 |
# File 'lib/twilio-ruby/rest/verify/v2/service/webhook.rb', line 615 def context unless @instance_context @instance_context = WebhookContext.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 [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
678 679 680 |
# File 'lib/twilio-ruby/rest/verify/v2/service/webhook.rb', line 678 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 [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
684 685 686 |
# File 'lib/twilio-ruby/rest/verify/v2/service/webhook.rb', line 684 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the WebhookInstance
697 698 699 700 |
# File 'lib/twilio-ruby/rest/verify/v2/service/webhook.rb', line 697 def delete context.delete end |
#event_types ⇒ Array<String>
Returns The array of events that this Webhook is subscribed to. Possible event types: ‘*, factor.deleted, factor.created, factor.verified, challenge.approved, challenge.denied`.
648 649 650 |
# File 'lib/twilio-ruby/rest/verify/v2/service/webhook.rb', line 648 def event_types @properties['event_types'] end |
#fetch ⇒ WebhookInstance
Fetch the WebhookInstance
705 706 707 708 |
# File 'lib/twilio-ruby/rest/verify/v2/service/webhook.rb', line 705 def fetch context.fetch end |
#friendly_name ⇒ String
Returns The string that you assigned to describe the webhook. **This value should not contain PII.**.
642 643 644 |
# File 'lib/twilio-ruby/rest/verify/v2/service/webhook.rb', line 642 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
744 745 746 747 |
# File 'lib/twilio-ruby/rest/verify/v2/service/webhook.rb', line 744 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Verify.V2.WebhookInstance #{values}>" end |
#service_sid ⇒ String
Returns The unique SID identifier of the Service.
630 631 632 |
# File 'lib/twilio-ruby/rest/verify/v2/service/webhook.rb', line 630 def service_sid @properties['service_sid'] end |
#sid ⇒ String
Returns The unique string that we created to identify the Webhook resource.
624 625 626 |
# File 'lib/twilio-ruby/rest/verify/v2/service/webhook.rb', line 624 def sid @properties['sid'] end |
#status ⇒ Status
654 655 656 |
# File 'lib/twilio-ruby/rest/verify/v2/service/webhook.rb', line 654 def status @properties['status'] end |
#to_s ⇒ Object
Provide a user friendly representation
737 738 739 740 |
# File 'lib/twilio-ruby/rest/verify/v2/service/webhook.rb', line 737 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Verify.V2.WebhookInstance #{values}>" end |
#update(friendly_name: :unset, event_types: :unset, webhook_url: :unset, status: :unset, version_: :unset) ⇒ WebhookInstance
Update the WebhookInstance
718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 |
# File 'lib/twilio-ruby/rest/verify/v2/service/webhook.rb', line 718 def update( friendly_name: :unset, event_types: :unset, webhook_url: :unset, status: :unset, version_: :unset ) context.update( friendly_name: friendly_name, event_types: event_types, webhook_url: webhook_url, status: status, version_: version_, ) end |
#url ⇒ String
Returns The absolute URL of the Webhook resource.
690 691 692 |
# File 'lib/twilio-ruby/rest/verify/v2/service/webhook.rb', line 690 def url @properties['url'] end |
#version ⇒ Version
660 661 662 |
# File 'lib/twilio-ruby/rest/verify/v2/service/webhook.rb', line 660 def version @properties['version'] end |
#webhook_method ⇒ Methods
672 673 674 |
# File 'lib/twilio-ruby/rest/verify/v2/service/webhook.rb', line 672 def webhook_method @properties['webhook_method'] end |
#webhook_url ⇒ String
Returns The URL associated with this Webhook.
666 667 668 |
# File 'lib/twilio-ruby/rest/verify/v2/service/webhook.rb', line 666 def webhook_url @properties['webhook_url'] end |