class Twilio::REST::Conversations::V1::ConversationContext::WebhookInstance
Public Class Methods
Initialize the WebhookInstance
@param [Version] version Version
that contains the resource @param [Hash] payload payload that contains response from Twilio
@param [String] conversation_sid
The unique ID of the
{Conversation}[https://www.twilio.com/docs/conversations/api/conversation-resource] for this webhook.
@param [String] sid A 34 character string that uniquely identifies this
resource.
@return [WebhookInstance] WebhookInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb 276 def initialize(version, payload, conversation_sid: nil, sid: nil) 277 super(version) 278 279 # Marshaled Properties 280 @properties = { 281 'sid' => payload['sid'], 282 'account_sid' => payload['account_sid'], 283 'conversation_sid' => payload['conversation_sid'], 284 'target' => payload['target'], 285 'url' => payload['url'], 286 'configuration' => payload['configuration'], 287 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 288 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 289 } 290 291 # Context 292 @instance_context = nil 293 @params = {'conversation_sid' => conversation_sid, 'sid' => sid || @properties['sid'], } 294 end
Public Instance Methods
@return [String] The unique ID of the Account responsible for this conversation.
# File lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb 315 def account_sid 316 @properties['account_sid'] 317 end
@return [Hash] The configuration of this webhook.
# File lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb 339 def configuration 340 @properties['configuration'] 341 end
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/conversation/webhook.rb 300 def context 301 unless @instance_context 302 @instance_context = WebhookContext.new(@version, @params['conversation_sid'], @params['sid'], ) 303 end 304 @instance_context 305 end
@return [String] The unique ID of the Conversation for this webhook.
# File lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb 321 def conversation_sid 322 @properties['conversation_sid'] 323 end
@return [Time] The date that this resource was created.
# File lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb 345 def date_created 346 @properties['date_created'] 347 end
@return [Time] The date that this resource was last updated.
# File lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb 351 def date_updated 352 @properties['date_updated'] 353 end
Delete the WebhookInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb 388 def delete 389 context.delete 390 end
Fetch the WebhookInstance
@return [WebhookInstance] Fetched WebhookInstance
# File lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb 358 def fetch 359 context.fetch 360 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb 401 def inspect 402 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 403 "<Twilio.Conversations.V1.WebhookInstance #{values}>" 404 end
@return [String] A 34 character string that uniquely identifies this resource.
# File lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb 309 def sid 310 @properties['sid'] 311 end
@return [String] The target of this webhook.
# File lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb 327 def target 328 @properties['target'] 329 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb 394 def to_s 395 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 396 "<Twilio.Conversations.V1.WebhookInstance #{values}>" 397 end
Update the WebhookInstance
@param [String] configuration_url The absolute url the webhook request should be
sent to.
@param [webhook.Method] configuration_method The HTTP
method to be used when
sending a webhook request.
@param [Array] configuration_filters The list of events, firing webhook
event for this Conversation.
@param [Array] configuration_triggers The list of keywords, firing
webhook event for this Conversation.
@param [String] configuration_flow_sid The studio flow SID, where the webhook
should be sent to.
@return [WebhookInstance] Updated WebhookInstance
# File lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb 375 def update(configuration_url: :unset, configuration_method: :unset, configuration_filters: :unset, configuration_triggers: :unset, configuration_flow_sid: :unset) 376 context.update( 377 configuration_url: configuration_url, 378 configuration_method: configuration_method, 379 configuration_filters: configuration_filters, 380 configuration_triggers: configuration_triggers, 381 configuration_flow_sid: configuration_flow_sid, 382 ) 383 end
@return [String] An absolute URL for this webhook.
# File lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb 333 def url 334 @properties['url'] 335 end