Class: Twilio::REST::Conversations::V1::WebhookContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Conversations::V1::WebhookContext
- Defined in:
- lib/twilio-ruby/rest/conversations/v1/webhook.rb
Overview
PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact [email protected].
Instance Method Summary collapse
-
#fetch ⇒ WebhookInstance
Fetch a WebhookInstance.
-
#initialize(version) ⇒ WebhookContext
constructor
Initialize the WebhookContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(method: :unset, filters: :unset, pre_webhook_url: :unset, post_webhook_url: :unset, target: :unset) ⇒ WebhookInstance
Update the WebhookInstance.
Constructor Details
#initialize(version) ⇒ WebhookContext
Initialize the WebhookContext
72 73 74 75 76 77 78 |
# File 'lib/twilio-ruby/rest/conversations/v1/webhook.rb', line 72 def initialize(version) super(version) # Path Solution @solution = {} @uri = "/Conversations/Webhooks" end |
Instance Method Details
#fetch ⇒ WebhookInstance
Fetch a WebhookInstance
83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/twilio-ruby/rest/conversations/v1/webhook.rb', line 83 def fetch params = Twilio::Values.of({}) payload = @version.fetch( 'GET', @uri, params, ) WebhookInstance.new(@version, payload, ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
137 138 139 140 |
# File 'lib/twilio-ruby/rest/conversations/v1/webhook.rb', line 137 def inspect context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Conversations.V1.WebhookContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
130 131 132 133 |
# File 'lib/twilio-ruby/rest/conversations/v1/webhook.rb', line 130 def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Conversations.V1.WebhookContext #{context}>" end |
#update(method: :unset, filters: :unset, pre_webhook_url: :unset, post_webhook_url: :unset, target: :unset) ⇒ WebhookInstance
Update the WebhookInstance
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
# File 'lib/twilio-ruby/rest/conversations/v1/webhook.rb', line 110 def update(method: :unset, filters: :unset, pre_webhook_url: :unset, post_webhook_url: :unset, target: :unset) data = Twilio::Values.of({ 'Method' => method, 'Filters' => Twilio.serialize_list(filters) { |e| e }, 'PreWebhookUrl' => pre_webhook_url, 'PostWebhookUrl' => post_webhook_url, 'Target' => target, }) payload = @version.update( 'POST', @uri, data: data, ) WebhookInstance.new(@version, payload, ) end |