class Twilio::REST::Conversations::V1::ConfigurationContext::WebhookInstance

Public Class Methods

new(version, payload) click to toggle source

Initialize the WebhookInstance @param [Version] version Version that contains the resource @param [Hash] payload payload that contains response from Twilio @return [WebhookInstance] WebhookInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb
133 def initialize(version, payload)
134   super(version)
135 
136   # Marshaled Properties
137   @properties = {
138       'account_sid' => payload['account_sid'],
139       'method' => payload['method'],
140       'filters' => payload['filters'],
141       'pre_webhook_url' => payload['pre_webhook_url'],
142       'post_webhook_url' => payload['post_webhook_url'],
143       'target' => payload['target'],
144       'url' => payload['url'],
145   }
146 
147   # Context
148   @instance_context = nil
149   @params = {}
150 end

Public Instance Methods

account_sid() click to toggle source

@return [String] The unique ID of the Account responsible for this conversation.

    # File lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb
165 def account_sid
166   @properties['account_sid']
167 end
context() click to toggle source

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [WebhookContext] WebhookContext for this WebhookInstance

    # File lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb
156 def context
157   unless @instance_context
158     @instance_context = WebhookContext.new(@version, )
159   end
160   @instance_context
161 end
fetch() click to toggle source

Fetch the WebhookInstance @return [WebhookInstance] Fetched WebhookInstance

    # File lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb
208 def fetch
209   context.fetch
210 end
filters() click to toggle source

@return [Array] The list of webhook event triggers that are enabled for this Service.

    # File lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb
177 def filters
178   @properties['filters']
179 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb
245 def inspect
246   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
247   "<Twilio.Conversations.V1.WebhookInstance #{values}>"
248 end
method() click to toggle source

@return [webhook.Method] The HTTP method to be used when sending a webhook request.

    # File lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb
171 def method
172   @properties['method']
173 end
post_webhook_url() click to toggle source

@return [String] The absolute url the post-event webhook request should be sent to.

    # File lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb
189 def post_webhook_url
190   @properties['post_webhook_url']
191 end
pre_webhook_url() click to toggle source

@return [String] The absolute url the pre-event webhook request should be sent to.

    # File lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb
183 def pre_webhook_url
184   @properties['pre_webhook_url']
185 end
target() click to toggle source

@return [webhook.Target] The routing target of the webhook.

    # File lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb
195 def target
196   @properties['target']
197 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb
238 def to_s
239   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
240   "<Twilio.Conversations.V1.WebhookInstance #{values}>"
241 end
update(method: :unset, filters: :unset, pre_webhook_url: :unset, post_webhook_url: :unset, target: :unset) click to toggle source

Update the WebhookInstance @param [String] method The HTTP method to be used when sending a webhook

request.

@param [Array] filters The list of webhook event triggers that are

enabled for this Service: `onMessageAdded`, `onMessageUpdated`,
`onMessageRemoved`, `onConversationUpdated`, `onConversationRemoved`,
`onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved`

@param [String] pre_webhook_url The absolute url the pre-event webhook request

should be sent to.

@param [String] post_webhook_url The absolute url the post-event webhook request

should be sent to.

@param [webhook.Target] target The routing target of the webhook. @return [WebhookInstance] Updated WebhookInstance

    # File lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb
226 def update(method: :unset, filters: :unset, pre_webhook_url: :unset, post_webhook_url: :unset, target: :unset)
227   context.update(
228       method: method,
229       filters: filters,
230       pre_webhook_url: pre_webhook_url,
231       post_webhook_url: post_webhook_url,
232       target: target,
233   )
234 end
url() click to toggle source

@return [String] An absolute URL for this webhook.

    # File lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb
201 def url
202   @properties['url']
203 end