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
180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 180 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.
212 213 214 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 212 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
203 204 205 206 207 208 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 203 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.
230 231 232 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 230 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.
218 219 220 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 218 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.
224 225 226 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 224 def default_conversation_role_sid @properties['default_conversation_role_sid'] end |
#fetch ⇒ ConfigurationInstance
Fetch the ConfigurationInstance
255 256 257 258 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 255 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
305 306 307 308 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 305 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.
242 243 244 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 242 def links @properties['links'] end |
#notifications ⇒ notifications
Access the notifications
285 286 287 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 285 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`.
248 249 250 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 248 def reachability_enabled @properties['reachability_enabled'] end |
#to_s ⇒ Object
Provide a user friendly representation
298 299 300 301 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 298 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
267 268 269 270 271 272 273 274 275 276 277 278 279 280 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 267 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.
236 237 238 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 236 def url @properties['url'] end |
#webhooks ⇒ webhooks
Access the webhooks
292 293 294 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 292 def webhooks context.webhooks end |