Class: Twilio::REST::Conversations::V1::ConfigurationContext::WebhookInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Conversations::V1::ConfigurationContext::WebhookInstance
- Defined in:
- lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The unique ID of the Account responsible for this conversation.
-
#context ⇒ WebhookContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#fetch ⇒ WebhookInstance
Fetch the WebhookInstance.
-
#filters ⇒ Array<String>
The list of webhook event triggers that are enabled for this Service:
onMessageAdded,onMessageUpdated,onMessageRemoved,onMessageAdd,onMessageUpdate,onMessageRemove,onConversationUpdated,onConversationRemoved,onConversationAdd,onConversationAdded,onConversationRemove,onConversationUpdate,onConversationStateUpdated,onParticipantAdded,onParticipantUpdated,onParticipantRemoved,onParticipantAdd,onParticipantRemove,onParticipantUpdate,onDeliveryUpdated,onUserAdded,onUserUpdate,onUserUpdated. -
#initialize(version, payload) ⇒ WebhookInstance
constructor
Initialize the WebhookInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
- #method ⇒ Method
-
#post_webhook_url ⇒ String
The absolute url the post-event webhook request should be sent to.
-
#pre_webhook_url ⇒ String
The absolute url the pre-event webhook request should be sent to.
- #target ⇒ Target
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(method: :unset, filters: :unset, pre_webhook_url: :unset, post_webhook_url: :unset, target: :unset) ⇒ WebhookInstance
Update the WebhookInstance.
-
#url ⇒ String
An absolute API resource API resource URL for this webhook.
Constructor Details
#initialize(version, payload) ⇒ WebhookInstance
Initialize the WebhookInstance
286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb', line 286 def initialize(version, payload ) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'method' => payload['method'], 'filters' => payload['filters'], 'pre_webhook_url' => payload['pre_webhook_url'], 'post_webhook_url' => payload['post_webhook_url'], 'target' => payload['target'], 'url' => payload['url'], } # Context @instance_context = nil @params = { } end |
Instance Method Details
#account_sid ⇒ String
Returns The unique ID of the Account responsible for this conversation.
319 320 321 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb', line 319 def account_sid @properties['account_sid'] 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
310 311 312 313 314 315 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb', line 310 def context unless @instance_context @instance_context = WebhookContext.new(@version ) end @instance_context end |
#fetch ⇒ WebhookInstance
Fetch the WebhookInstance
362 363 364 365 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb', line 362 def fetch context.fetch end |
#filters ⇒ Array<String>
Returns The list of webhook event triggers that are enabled for this Service: onMessageAdded, onMessageUpdated, onMessageRemoved, onMessageAdd, onMessageUpdate, onMessageRemove, onConversationUpdated, onConversationRemoved, onConversationAdd, onConversationAdded, onConversationRemove, onConversationUpdate, onConversationStateUpdated, onParticipantAdded, onParticipantUpdated, onParticipantRemoved, onParticipantAdd, onParticipantRemove, onParticipantUpdate, onDeliveryUpdated, onUserAdded, onUserUpdate, onUserUpdated.
331 332 333 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb', line 331 def filters @properties['filters'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
401 402 403 404 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb', line 401 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Conversations.V1.WebhookInstance #{values}>" end |
#method ⇒ Method
325 326 327 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb', line 325 def method @properties['method'] end |
#post_webhook_url ⇒ String
Returns The absolute url the post-event webhook request should be sent to.
343 344 345 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb', line 343 def post_webhook_url @properties['post_webhook_url'] end |
#pre_webhook_url ⇒ String
Returns The absolute url the pre-event webhook request should be sent to.
337 338 339 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb', line 337 def pre_webhook_url @properties['pre_webhook_url'] end |
#target ⇒ Target
349 350 351 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb', line 349 def target @properties['target'] end |
#to_s ⇒ Object
Provide a user friendly representation
394 395 396 397 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb', line 394 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Conversations.V1.WebhookInstance #{values}>" end |
#update(method: :unset, filters: :unset, pre_webhook_url: :unset, post_webhook_url: :unset, target: :unset) ⇒ WebhookInstance
Update the WebhookInstance
375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb', line 375 def update( method: :unset, filters: :unset, pre_webhook_url: :unset, post_webhook_url: :unset, target: :unset ) context.update( method: method, filters: filters, pre_webhook_url: pre_webhook_url, post_webhook_url: post_webhook_url, target: target, ) end |
#url ⇒ String
Returns An absolute API resource API resource URL for this webhook.
355 356 357 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb', line 355 def url @properties['url'] end |