Class: Twilio::REST::Conversations::V1::NotificationInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Conversations::V1::NotificationInstance
- Defined in:
- lib/twilio-ruby/rest/conversations/v1/notification.rb
Overview
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
Instance Method Summary collapse
-
#account_sid ⇒ String
The unique id of the 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 Chat Service that 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) ⇒ NotificationInstance
Update the NotificationInstance.
-
#url ⇒ String
An absolute URL for this configuration.
Constructor Details
#initialize(version, payload, chat_service_sid: nil) ⇒ NotificationInstance
Initialize the NotificationInstance
168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 |
# File 'lib/twilio-ruby/rest/conversations/v1/notification.rb', line 168 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 responsible for this configuration.
200 201 202 |
# File 'lib/twilio-ruby/rest/conversations/v1/notification.rb', line 200 def account_sid @properties['account_sid'] end |
#added_to_conversation ⇒ Hash
Returns The Push Notification configuration for being added to a Conversation.
218 219 220 |
# File 'lib/twilio-ruby/rest/conversations/v1/notification.rb', line 218 def added_to_conversation @properties['added_to_conversation'] end |
#chat_service_sid ⇒ String
Returns The SID of the Chat Service that the Configuration applies to.
206 207 208 |
# File 'lib/twilio-ruby/rest/conversations/v1/notification.rb', line 206 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
191 192 193 194 195 196 |
# File 'lib/twilio-ruby/rest/conversations/v1/notification.rb', line 191 def context unless @instance_context @instance_context = NotificationContext.new(@version, @params['chat_service_sid'], ) end @instance_context end |
#fetch ⇒ NotificationInstance
Fetch the NotificationInstance
289 290 291 |
# File 'lib/twilio-ruby/rest/conversations/v1/notification.rb', line 289 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
302 303 304 305 |
# File 'lib/twilio-ruby/rest/conversations/v1/notification.rb', line 302 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.
230 231 232 |
# File 'lib/twilio-ruby/rest/conversations/v1/notification.rb', line 230 def log_enabled @properties['log_enabled'] end |
#new_message ⇒ Hash
Returns The Push Notification configuration for New Messages.
212 213 214 |
# File 'lib/twilio-ruby/rest/conversations/v1/notification.rb', line 212 def @properties['new_message'] end |
#removed_from_conversation ⇒ Hash
Returns The Push Notification configuration for being removed from a Conversation.
224 225 226 |
# File 'lib/twilio-ruby/rest/conversations/v1/notification.rb', line 224 def removed_from_conversation @properties['removed_from_conversation'] end |
#to_s ⇒ Object
Provide a user friendly representation
295 296 297 298 |
# File 'lib/twilio-ruby/rest/conversations/v1/notification.rb', line 295 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) ⇒ NotificationInstance
Update the NotificationInstance
270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 |
# File 'lib/twilio-ruby/rest/conversations/v1/notification.rb', line 270 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) 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, ) end |
#url ⇒ String
Returns An absolute URL for this configuration.
236 237 238 |
# File 'lib/twilio-ruby/rest/conversations/v1/notification.rb', line 236 def url @properties['url'] end |