Class: Twilio::REST::IpMessaging::V2::ServiceContext::ChannelContext::WebhookInstance
- Inherits:
-
Twilio::REST::InstanceResource
- Object
- Twilio::REST::InstanceResource
- Twilio::REST::IpMessaging::V2::ServiceContext::ChannelContext::WebhookInstance
- Defined in:
- lib/twilio-ruby/rest/ip_messaging/v2/service/channel/webhook.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the Account that created the resource.
-
#channel_sid ⇒ String
The SID of the Channel the Channel Webhook resource belongs to.
-
#configuration ⇒ Hash
The JSON string that describes the configuration object for the channel webhook.
-
#context ⇒ WebhookContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The ISO 8601 date and time in GMT when the resource was created.
-
#date_updated ⇒ Time
The ISO 8601 date and time in GMT when the resource was last updated.
-
#delete ⇒ Boolean
Deletes the WebhookInstance.
-
#fetch ⇒ WebhookInstance
Fetch a WebhookInstance.
-
#initialize(version, payload, service_sid: nil, channel_sid: nil, sid: nil) ⇒ WebhookInstance
constructor
Initialize the WebhookInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#service_sid ⇒ String
The SID of the Service that the Channel Webhook resource is associated with.
-
#sid ⇒ String
The unique string that identifies the resource.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#type ⇒ String
The type of webhook.
-
#update(configuration_url: :unset, configuration_method: :unset, configuration_filters: :unset, configuration_triggers: :unset, configuration_flow_sid: :unset, configuration_retry_count: :unset) ⇒ WebhookInstance
Update the WebhookInstance.
-
#url ⇒ String
The absolute URL of the Channel Webhook resource.
Constructor Details
#initialize(version, payload, service_sid: nil, channel_sid: nil, sid: nil) ⇒ WebhookInstance
Initialize the WebhookInstance
331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 |
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/channel/webhook.rb', line 331 def initialize(version, payload, service_sid: nil, channel_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'account_sid' => payload['account_sid'], 'service_sid' => payload['service_sid'], 'channel_sid' => payload['channel_sid'], 'type' => payload['type'], '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 = { 'service_sid' => service_sid, 'channel_sid' => channel_sid, 'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
Returns The SID of the Account that created the resource.
380 381 382 |
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/channel/webhook.rb', line 380 def account_sid @properties['account_sid'] end |
#channel_sid ⇒ String
Returns The SID of the Channel the Channel Webhook resource belongs to.
392 393 394 |
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/channel/webhook.rb', line 392 def channel_sid @properties['channel_sid'] end |
#configuration ⇒ Hash
Returns The JSON string that describes the configuration object for the channel webhook.
410 411 412 |
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/channel/webhook.rb', line 410 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
360 361 362 363 364 365 366 367 368 369 370 |
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/channel/webhook.rb', line 360 def context unless @instance_context @instance_context = WebhookContext.new( @version, @params['service_sid'], @params['channel_sid'], @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
Returns The ISO 8601 date and time in GMT when the resource was created.
416 417 418 |
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/channel/webhook.rb', line 416 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The ISO 8601 date and time in GMT when the resource was last updated.
422 423 424 |
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/channel/webhook.rb', line 422 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Deletes the WebhookInstance
469 470 471 |
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/channel/webhook.rb', line 469 def delete context.delete end |
#fetch ⇒ WebhookInstance
Fetch a WebhookInstance
429 430 431 |
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/channel/webhook.rb', line 429 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
482 483 484 485 |
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/channel/webhook.rb', line 482 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.IpMessaging.V2.WebhookInstance #{values}>" end |
#service_sid ⇒ String
Returns The SID of the Service that the Channel Webhook resource is associated with.
386 387 388 |
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/channel/webhook.rb', line 386 def service_sid @properties['service_sid'] end |
#sid ⇒ String
Returns The unique string that identifies the resource.
374 375 376 |
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/channel/webhook.rb', line 374 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
475 476 477 478 |
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/channel/webhook.rb', line 475 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.IpMessaging.V2.WebhookInstance #{values}>" end |
#type ⇒ String
Returns The type of webhook.
398 399 400 |
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/channel/webhook.rb', line 398 def type @properties['type'] end |
#update(configuration_url: :unset, configuration_method: :unset, configuration_filters: :unset, configuration_triggers: :unset, configuration_flow_sid: :unset, configuration_retry_count: :unset) ⇒ WebhookInstance
Update the WebhookInstance
455 456 457 458 459 460 461 462 463 464 |
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/channel/webhook.rb', line 455 def update(configuration_url: :unset, configuration_method: :unset, configuration_filters: :unset, configuration_triggers: :unset, configuration_flow_sid: :unset, configuration_retry_count: :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, configuration_retry_count: configuration_retry_count, ) end |
#url ⇒ String
Returns The absolute URL of the Channel Webhook resource.
404 405 406 |
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/channel/webhook.rb', line 404 def url @properties['url'] end |