Class: Twilio::REST::Conversations::V1::ServiceContext::ConfigurationContext::NotificationContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Conversations::V1::ServiceContext::ConfigurationContext::NotificationContext
- Defined in:
- lib/twilio-ruby/rest/conversations/v1/service/configuration/notification.rb
Instance Method Summary collapse
-
#fetch ⇒ NotificationInstance
Fetch the NotificationInstance.
-
#initialize(version, chat_service_sid) ⇒ NotificationContext
constructor
Initialize the NotificationContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#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.
Constructor Details
#initialize(version, chat_service_sid) ⇒ NotificationContext
Initialize the NotificationContext
73 74 75 76 77 78 79 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration/notification.rb', line 73 def initialize(version, chat_service_sid) super(version) # Path Solution @solution = {chat_service_sid: chat_service_sid, } @uri = "/Services/#{@solution[:chat_service_sid]}/Configuration/Notifications" end |
Instance Method Details
#fetch ⇒ NotificationInstance
Fetch the NotificationInstance
142 143 144 145 146 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration/notification.rb', line 142 def fetch payload = @version.fetch('GET', @uri) NotificationInstance.new(@version, payload, chat_service_sid: @solution[:chat_service_sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
157 158 159 160 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration/notification.rb', line 157 def inspect context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Conversations.V1.NotificationContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
150 151 152 153 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration/notification.rb', line 150 def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Conversations.V1.NotificationContext #{context}>" 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
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration/notification.rb', line 117 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) data = Twilio::Values.of({ 'LogEnabled' => log_enabled, 'NewMessage.Enabled' => , 'NewMessage.Template' => , 'NewMessage.Sound' => , 'NewMessage.BadgeCountEnabled' => , 'AddedToConversation.Enabled' => added_to_conversation_enabled, 'AddedToConversation.Template' => added_to_conversation_template, 'AddedToConversation.Sound' => added_to_conversation_sound, 'RemovedFromConversation.Enabled' => removed_from_conversation_enabled, 'RemovedFromConversation.Template' => removed_from_conversation_template, 'RemovedFromConversation.Sound' => removed_from_conversation_sound, 'NewMessage.WithMedia.Enabled' => , 'NewMessage.WithMedia.Template' => , }) payload = @version.update('POST', @uri, data: data) NotificationInstance.new(@version, payload, chat_service_sid: @solution[:chat_service_sid], ) end |