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
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
-
#account_sid ⇒ String
The unique id of the 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 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
Deletes the WebhookInstance.
-
#fetch ⇒ WebhookInstance
Fetch a 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.
-
#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 URL for this webhook.
Constructor Details
#initialize(version, payload, conversation_sid: nil, sid: nil) ⇒ WebhookInstance
Initialize the WebhookInstance
298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb', line 298 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, 'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
Returns The unique id of the Account responsible for this conversation.
337 338 339 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb', line 337 def account_sid @properties['account_sid'] end |
#configuration ⇒ Hash
Returns The configuration of this webhook.
361 362 363 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb', line 361 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
322 323 324 325 326 327 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb', line 322 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 for this webhook.
343 344 345 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb', line 343 def conversation_sid @properties['conversation_sid'] end |
#date_created ⇒ Time
Returns The date that this resource was created.
367 368 369 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb', line 367 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date that this resource was last updated.
373 374 375 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb', line 373 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Deletes the WebhookInstance
410 411 412 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb', line 410 def delete context.delete end |
#fetch ⇒ WebhookInstance
Fetch a WebhookInstance
380 381 382 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb', line 380 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
423 424 425 426 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb', line 423 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.
331 332 333 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb', line 331 def sid @properties['sid'] end |
#target ⇒ String
Returns The target of this webhook.
349 350 351 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb', line 349 def target @properties['target'] end |
#to_s ⇒ Object
Provide a user friendly representation
416 417 418 419 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb', line 416 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
397 398 399 400 401 402 403 404 405 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb', line 397 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 URL for this webhook.
355 356 357 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb', line 355 def url @properties['url'] end |