Class: Twilio::REST::Conversations::V1::ServiceContext::ConfigurationInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Conversations::V1::ServiceContext::ConfigurationInstance
- Defined in:
- lib/twilio-ruby/rest/conversations/v1/service/configuration.rb
Instance Method Summary collapse
-
#chat_service_sid ⇒ String
The unique string that we created to identify the Service configuration resource.
-
#context ⇒ ConfigurationContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#default_chat_service_role_sid ⇒ String
The service-level role assigned to users when they are added to the service.
-
#default_conversation_creator_role_sid ⇒ String
The conversation-level role assigned to a conversation creator when they join a new conversation.
-
#default_conversation_role_sid ⇒ String
The conversation-level role assigned to users when they are added to a conversation.
-
#fetch ⇒ ConfigurationInstance
Fetch the ConfigurationInstance.
-
#initialize(version, payload, chat_service_sid: nil) ⇒ ConfigurationInstance
constructor
Initialize the ConfigurationInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#links ⇒ Hash
Contains an absolute API resource URL to access the push notifications configuration of this service.
-
#notifications ⇒ notifications
Access the notifications.
-
#reachability_enabled ⇒ Boolean
Whether the [Reachability Indicator](www.twilio.com/docs/conversations/reachability) is enabled for this Conversations Service.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(default_conversation_creator_role_sid: :unset, default_conversation_role_sid: :unset, default_chat_service_role_sid: :unset, reachability_enabled: :unset) ⇒ ConfigurationInstance
Update the ConfigurationInstance.
-
#url ⇒ String
An absolute API resource URL for this service configuration.
-
#webhooks ⇒ webhooks
Access the webhooks.
Constructor Details
#initialize(version, payload, chat_service_sid: nil) ⇒ ConfigurationInstance
Initialize the ConfigurationInstance
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 177 def initialize(version, payload , chat_service_sid: nil) super(version) # Marshaled Properties @properties = { 'chat_service_sid' => payload['chat_service_sid'], 'default_conversation_creator_role_sid' => payload['default_conversation_creator_role_sid'], 'default_conversation_role_sid' => payload['default_conversation_role_sid'], 'default_chat_service_role_sid' => payload['default_chat_service_role_sid'], 'url' => payload['url'], 'links' => payload['links'], 'reachability_enabled' => payload['reachability_enabled'], } # Context @instance_context = nil @params = { 'chat_service_sid' => chat_service_sid || @properties['chat_service_sid'] , } end |
Instance Method Details
#chat_service_sid ⇒ String
Returns The unique string that we created to identify the Service configuration resource.
209 210 211 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 209 def chat_service_sid @properties['chat_service_sid'] end |
#context ⇒ ConfigurationContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
200 201 202 203 204 205 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 200 def context unless @instance_context @instance_context = ConfigurationContext.new(@version , @params['chat_service_sid']) end @instance_context end |
#default_chat_service_role_sid ⇒ String
Returns The service-level role assigned to users when they are added to the service. See [Conversation Role](www.twilio.com/docs/conversations/api/role-resource) for more info about roles.
227 228 229 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 227 def default_chat_service_role_sid @properties['default_chat_service_role_sid'] end |
#default_conversation_creator_role_sid ⇒ String
Returns The conversation-level role assigned to a conversation creator when they join a new conversation. See [Conversation Role](www.twilio.com/docs/conversations/api/role-resource) for more info about roles.
215 216 217 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 215 def default_conversation_creator_role_sid @properties['default_conversation_creator_role_sid'] end |
#default_conversation_role_sid ⇒ String
Returns The conversation-level role assigned to users when they are added to a conversation. See [Conversation Role](www.twilio.com/docs/conversations/api/role-resource) for more info about roles.
221 222 223 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 221 def default_conversation_role_sid @properties['default_conversation_role_sid'] end |
#fetch ⇒ ConfigurationInstance
Fetch the ConfigurationInstance
252 253 254 255 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 252 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
302 303 304 305 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 302 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Conversations.V1.ConfigurationInstance #{values}>" end |
#links ⇒ Hash
Returns Contains an absolute API resource URL to access the push notifications configuration of this service.
239 240 241 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 239 def links @properties['links'] end |
#notifications ⇒ notifications
Access the notifications
282 283 284 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 282 def notifications context.notifications end |
#reachability_enabled ⇒ Boolean
Returns Whether the [Reachability Indicator](www.twilio.com/docs/conversations/reachability) is enabled for this Conversations Service. The default is ‘false`.
245 246 247 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 245 def reachability_enabled @properties['reachability_enabled'] end |
#to_s ⇒ Object
Provide a user friendly representation
295 296 297 298 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 295 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Conversations.V1.ConfigurationInstance #{values}>" end |
#update(default_conversation_creator_role_sid: :unset, default_conversation_role_sid: :unset, default_chat_service_role_sid: :unset, reachability_enabled: :unset) ⇒ ConfigurationInstance
Update the ConfigurationInstance
264 265 266 267 268 269 270 271 272 273 274 275 276 277 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 264 def update( default_conversation_creator_role_sid: :unset, default_conversation_role_sid: :unset, default_chat_service_role_sid: :unset, reachability_enabled: :unset ) context.update( default_conversation_creator_role_sid: default_conversation_creator_role_sid, default_conversation_role_sid: default_conversation_role_sid, default_chat_service_role_sid: default_chat_service_role_sid, reachability_enabled: reachability_enabled, ) end |
#url ⇒ String
Returns An absolute API resource URL for this service configuration.
233 234 235 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 233 def url @properties['url'] end |
#webhooks ⇒ webhooks
Access the webhooks
289 290 291 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 289 def webhooks context.webhooks end |