Class: Twilio::REST::Conversations::V1::ServiceContext::ConfigurationContext::NotificationInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Conversations::V1::ServiceContext::ConfigurationContext::NotificationInstance
- Defined in:
- lib/twilio-ruby/rest/conversations/v1/service/configuration/notification.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The unique ID of the [Account](www.twilio.com/docs/iam/api/account) responsible for this configuration.
-
#added_to_conversation ⇒ Hash
The Push Notification configuration for being added to a Conversation.
-
#chat_service_sid ⇒ String
The SID of the [Conversation Service](www.twilio.com/docs/conversations/api/service-resource) the Configuration applies to.
-
#context ⇒ NotificationContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#fetch ⇒ NotificationInstance
Fetch the NotificationInstance.
-
#initialize(version, payload, chat_service_sid: nil) ⇒ NotificationInstance
constructor
Initialize the NotificationInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#log_enabled ⇒ Boolean
Weather the notification logging is enabled.
-
#new_message ⇒ Hash
The Push Notification configuration for New Messages.
-
#removed_from_conversation ⇒ Hash
The Push Notification configuration for being removed from a Conversation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(log_enabled: :unset, new_message_enabled: :unset, new_message_template: :unset, new_message_sound: :unset, new_message_badge_count_enabled: :unset, added_to_conversation_enabled: :unset, added_to_conversation_template: :unset, added_to_conversation_sound: :unset, removed_from_conversation_enabled: :unset, removed_from_conversation_template: :unset, removed_from_conversation_sound: :unset, new_message_with_media_enabled: :unset, new_message_with_media_template: :unset) ⇒ NotificationInstance
Update the NotificationInstance.
-
#url ⇒ String
An absolute API resource URL for this configuration.
Constructor Details
#initialize(version, payload, chat_service_sid: nil) ⇒ NotificationInstance
Initialize the NotificationInstance
399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration/notification.rb', line 399 def initialize(version, payload , chat_service_sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'chat_service_sid' => payload['chat_service_sid'], 'new_message' => payload['new_message'], 'added_to_conversation' => payload['added_to_conversation'], 'removed_from_conversation' => payload['removed_from_conversation'], 'log_enabled' => payload['log_enabled'], 'url' => payload['url'], } # Context @instance_context = nil @params = { 'chat_service_sid' => chat_service_sid || @properties['chat_service_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 configuration.
432 433 434 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration/notification.rb', line 432 def account_sid @properties['account_sid'] end |
#added_to_conversation ⇒ Hash
Returns The Push Notification configuration for being added to a Conversation.
450 451 452 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration/notification.rb', line 450 def added_to_conversation @properties['added_to_conversation'] end |
#chat_service_sid ⇒ String
Returns The SID of the [Conversation Service](www.twilio.com/docs/conversations/api/service-resource) the Configuration applies to.
438 439 440 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration/notification.rb', line 438 def chat_service_sid @properties['chat_service_sid'] end |
#context ⇒ NotificationContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
423 424 425 426 427 428 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration/notification.rb', line 423 def context unless @instance_context @instance_context = NotificationContext.new(@version , @params['chat_service_sid']) end @instance_context end |
#fetch ⇒ NotificationInstance
Fetch the NotificationInstance
475 476 477 478 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration/notification.rb', line 475 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
538 539 540 541 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration/notification.rb', line 538 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Conversations.V1.NotificationInstance #{values}>" end |
#log_enabled ⇒ Boolean
Returns Weather the notification logging is enabled.
462 463 464 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration/notification.rb', line 462 def log_enabled @properties['log_enabled'] end |
#new_message ⇒ Hash
Returns The Push Notification configuration for New Messages.
444 445 446 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration/notification.rb', line 444 def @properties['new_message'] end |
#removed_from_conversation ⇒ Hash
Returns The Push Notification configuration for being removed from a Conversation.
456 457 458 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration/notification.rb', line 456 def removed_from_conversation @properties['removed_from_conversation'] end |
#to_s ⇒ Object
Provide a user friendly representation
531 532 533 534 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration/notification.rb', line 531 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Conversations.V1.NotificationInstance #{values}>" end |
#update(log_enabled: :unset, new_message_enabled: :unset, new_message_template: :unset, new_message_sound: :unset, new_message_badge_count_enabled: :unset, added_to_conversation_enabled: :unset, added_to_conversation_template: :unset, added_to_conversation_sound: :unset, removed_from_conversation_enabled: :unset, removed_from_conversation_template: :unset, removed_from_conversation_sound: :unset, new_message_with_media_enabled: :unset, new_message_with_media_template: :unset) ⇒ NotificationInstance
Update the NotificationInstance
496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration/notification.rb', line 496 def update( log_enabled: :unset, new_message_enabled: :unset, new_message_template: :unset, new_message_sound: :unset, new_message_badge_count_enabled: :unset, added_to_conversation_enabled: :unset, added_to_conversation_template: :unset, added_to_conversation_sound: :unset, removed_from_conversation_enabled: :unset, removed_from_conversation_template: :unset, removed_from_conversation_sound: :unset, new_message_with_media_enabled: :unset, new_message_with_media_template: :unset ) context.update( log_enabled: log_enabled, new_message_enabled: , new_message_template: , new_message_sound: , new_message_badge_count_enabled: , added_to_conversation_enabled: added_to_conversation_enabled, added_to_conversation_template: added_to_conversation_template, added_to_conversation_sound: added_to_conversation_sound, removed_from_conversation_enabled: removed_from_conversation_enabled, removed_from_conversation_template: removed_from_conversation_template, removed_from_conversation_sound: removed_from_conversation_sound, new_message_with_media_enabled: , new_message_with_media_template: , ) end |
#url ⇒ String
Returns An absolute API resource URL for this configuration.
468 469 470 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration/notification.rb', line 468 def url @properties['url'] end |