Class: Twilio::REST::Conversations::V1::ConversationContext::WebhookInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Conversations::V1::ConversationContext::WebhookInstance
- Defined in:
- lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The unique ID of the [Account](www.twilio.com/docs/iam/api/account) responsible for this conversation.
-
#configuration ⇒ Hash
The configuration of this webhook.
-
#context ⇒ WebhookContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#conversation_sid ⇒ String
The unique ID of the [Conversation](www.twilio.com/docs/conversations/api/conversation-resource) for this webhook.
-
#date_created ⇒ Time
The date that this resource was created.
-
#date_updated ⇒ Time
The date that this resource was last updated.
-
#delete ⇒ Boolean
Delete the WebhookInstance.
-
#fetch ⇒ WebhookInstance
Fetch the WebhookInstance.
-
#initialize(version, payload, conversation_sid: nil, sid: nil) ⇒ WebhookInstance
constructor
Initialize the WebhookInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#sid ⇒ String
A 34 character string that uniquely identifies this resource.
-
#target ⇒ String
The target of this webhook:
webhook,studio,trigger. -
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(configuration_url: :unset, configuration_method: :unset, configuration_filters: :unset, configuration_triggers: :unset, configuration_flow_sid: :unset) ⇒ WebhookInstance
Update the WebhookInstance.
-
#url ⇒ String
An absolute API resource URL for this webhook.
Constructor Details
#initialize(version, payload, conversation_sid: nil, sid: nil) ⇒ WebhookInstance
Initialize the WebhookInstance
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/conversations/v1/conversation/webhook.rb', line 590 def initialize(version, payload , conversation_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'account_sid' => payload['account_sid'], 'conversation_sid' => payload['conversation_sid'], 'target' => payload['target'], 'url' => payload['url'], 'configuration' => payload['configuration'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), } # Context @instance_context = nil @params = { 'conversation_sid' => conversation_sid || @properties['conversation_sid'] ,'sid' => sid || @properties['sid'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The unique ID of the [Account](www.twilio.com/docs/iam/api/account) responsible for this conversation.
630 631 632 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb', line 630 def account_sid @properties['account_sid'] end |
#configuration ⇒ Hash
Returns The configuration of this webhook. Is defined based on target.
654 655 656 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb', line 654 def configuration @properties['configuration'] 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/conversations/v1/conversation/webhook.rb', line 615 def context unless @instance_context @instance_context = WebhookContext.new(@version , @params['conversation_sid'], @params['sid']) end @instance_context end |
#conversation_sid ⇒ String
Returns The unique ID of the [Conversation](www.twilio.com/docs/conversations/api/conversation-resource) for this webhook.
636 637 638 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb', line 636 def conversation_sid @properties['conversation_sid'] end |
#date_created ⇒ Time
Returns The date that this resource was created.
660 661 662 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb', line 660 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date that this resource was last updated.
666 667 668 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb', line 666 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the WebhookInstance
673 674 675 676 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb', line 673 def delete context.delete end |
#fetch ⇒ WebhookInstance
Fetch the WebhookInstance
681 682 683 684 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb', line 681 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
720 721 722 723 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb', line 720 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Conversations.V1.WebhookInstance #{values}>" end |
#sid ⇒ String
Returns A 34 character string that uniquely identifies this resource.
624 625 626 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb', line 624 def sid @properties['sid'] end |
#target ⇒ String
Returns The target of this webhook: webhook, studio, trigger.
642 643 644 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb', line 642 def target @properties['target'] end |
#to_s ⇒ Object
Provide a user friendly representation
713 714 715 716 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb', line 713 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Conversations.V1.WebhookInstance #{values}>" end |
#update(configuration_url: :unset, configuration_method: :unset, configuration_filters: :unset, configuration_triggers: :unset, configuration_flow_sid: :unset) ⇒ WebhookInstance
Update the WebhookInstance
694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb', line 694 def update( configuration_url: :unset, configuration_method: :unset, configuration_filters: :unset, configuration_triggers: :unset, configuration_flow_sid: :unset ) context.update( configuration_url: configuration_url, configuration_method: configuration_method, configuration_filters: configuration_filters, configuration_triggers: configuration_triggers, configuration_flow_sid: configuration_flow_sid, ) end |
#url ⇒ String
Returns An absolute API resource URL for this webhook.
648 649 650 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb', line 648 def url @properties['url'] end |