class Twilio::REST::Conversations::V1::ConfigurationContext::WebhookContext
Public Class Methods
new(version)
click to toggle source
Initialize the WebhookContext
@param [Version] version Version
that contains the resource @return [WebhookContext] WebhookContext
Calls superclass method
Twilio::REST::InstanceContext::new
# File lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb 67 def initialize(version) 68 super(version) 69 70 # Path Solution 71 @solution = {} 72 @uri = "/Configuration/Webhooks" 73 end
Public Instance Methods
fetch()
click to toggle source
Fetch the WebhookInstance
@return [WebhookInstance] Fetched WebhookInstance
# File lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb 78 def fetch 79 payload = @version.fetch('GET', @uri) 80 81 WebhookInstance.new(@version, payload, ) 82 end
inspect()
click to toggle source
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb 121 def inspect 122 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 123 "#<Twilio.Conversations.V1.WebhookContext #{context}>" 124 end
to_s()
click to toggle source
Provide a user friendly representation
# File lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb 114 def to_s 115 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 116 "#<Twilio.Conversations.V1.WebhookContext #{context}>" 117 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 98 def update(method: :unset, filters: :unset, pre_webhook_url: :unset, post_webhook_url: :unset, target: :unset) 99 data = Twilio::Values.of({ 100 'Method' => method, 101 'Filters' => Twilio.serialize_list(filters) { |e| e }, 102 'PreWebhookUrl' => pre_webhook_url, 103 'PostWebhookUrl' => post_webhook_url, 104 'Target' => target, 105 }) 106 107 payload = @version.update('POST', @uri, data: data) 108 109 WebhookInstance.new(@version, payload, ) 110 end