Class: Twilio::REST::Conversations::V1::ServiceContext::ConversationContext::WebhookInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Conversations::V1::ServiceContext::ConversationContext::WebhookInstance
- Defined in:
- lib/twilio-ruby/rest/conversations/v1/service/conversation/webhook.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The unique ID of the [Account](www.twilio.com/docs/iam/api/account) responsible for this conversation.
-
#chat_service_sid ⇒ String
The SID of the [Conversation Service](www.twilio.com/docs/conversations/api/service-resource) the Participant resource is associated with.
-
#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](www.twilio.com/docs/conversations/api/conversation-resource) 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
Delete the WebhookInstance.
-
#fetch ⇒ WebhookInstance
Fetch the WebhookInstance.
-
#initialize(version, payload, chat_service_sid: nil, 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: ‘webhook`, `studio`, `trigger`.
-
#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 API resource URL for this webhook.
Constructor Details
#initialize(version, payload, chat_service_sid: nil, conversation_sid: nil, sid: nil) ⇒ WebhookInstance
Initialize the WebhookInstance
322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/webhook.rb', line 322 def initialize(version, payload , chat_service_sid: nil, conversation_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'account_sid' => payload['account_sid'], 'chat_service_sid' => payload['chat_service_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 = { 'chat_service_sid' => chat_service_sid || @properties['chat_service_sid'] ,'conversation_sid' => conversation_sid || @properties['conversation_sid'] ,'sid' => sid || @properties['sid'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The unique ID of the [Account](www.twilio.com/docs/iam/api/account) responsible for this conversation.
362 363 364 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/webhook.rb', line 362 def account_sid @properties['account_sid'] end |
#chat_service_sid ⇒ String
Returns The SID of the [Conversation Service](www.twilio.com/docs/conversations/api/service-resource) the Participant resource is associated with.
368 369 370 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/webhook.rb', line 368 def chat_service_sid @properties['chat_service_sid'] end |
#configuration ⇒ Hash
Returns The configuration of this webhook. Is defined based on target.
392 393 394 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/webhook.rb', line 392 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
347 348 349 350 351 352 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/webhook.rb', line 347 def context unless @instance_context @instance_context = WebhookContext.new(@version , @params['chat_service_sid'], @params['conversation_sid'], @params['sid']) end @instance_context end |
#conversation_sid ⇒ String
Returns The unique ID of the [Conversation](www.twilio.com/docs/conversations/api/conversation-resource) for this webhook.
374 375 376 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/webhook.rb', line 374 def conversation_sid @properties['conversation_sid'] end |
#date_created ⇒ Time
Returns The date that this resource was created.
398 399 400 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/webhook.rb', line 398 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date that this resource was last updated.
404 405 406 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/webhook.rb', line 404 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the WebhookInstance
411 412 413 414 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/webhook.rb', line 411 def delete context.delete end |
#fetch ⇒ WebhookInstance
Fetch the WebhookInstance
419 420 421 422 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/webhook.rb', line 419 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
458 459 460 461 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/webhook.rb', line 458 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.
356 357 358 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/webhook.rb', line 356 def sid @properties['sid'] end |
#target ⇒ String
Returns The target of this webhook: ‘webhook`, `studio`, `trigger`.
380 381 382 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/webhook.rb', line 380 def target @properties['target'] end |
#to_s ⇒ Object
Provide a user friendly representation
451 452 453 454 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/webhook.rb', line 451 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
432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/webhook.rb', line 432 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 API resource URL for this webhook.
386 387 388 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/webhook.rb', line 386 def url @properties['url'] end |