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
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 190 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.
222 223 224 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 222 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
213 214 215 216 217 218 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 213 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.
240 241 242 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 240 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.
228 229 230 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 228 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.
234 235 236 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 234 def default_conversation_role_sid @properties['default_conversation_role_sid'] end |
#fetch ⇒ ConfigurationInstance
Fetch the ConfigurationInstance
265 266 267 268 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 265 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
315 316 317 318 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 315 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.
252 253 254 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 252 def links @properties['links'] end |
#notifications ⇒ notifications
Access the notifications
302 303 304 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 302 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`.
258 259 260 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 258 def reachability_enabled @properties['reachability_enabled'] end |
#to_s ⇒ Object
Provide a user friendly representation
308 309 310 311 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 308 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
277 278 279 280 281 282 283 284 285 286 287 288 289 290 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 277 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.
246 247 248 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 246 def url @properties['url'] end |
#webhooks ⇒ webhooks
Access the webhooks
295 296 297 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 295 def webhooks context.webhooks end |