class Twilio::REST::Conversations::V1::ServiceContext::ConfigurationInstance

Public Class Methods

new(version, payload, chat_service_sid: nil) click to toggle source

Initialize the ConfigurationInstance @param [Version] version Version that contains the resource @param [Hash] payload payload that contains response from Twilio @param [String] chat_service_sid The unique string that we created to identify

the Service configuration resource.

@return [ConfigurationInstance] ConfigurationInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/conversations/v1/service/configuration.rb
153 def initialize(version, payload, chat_service_sid: nil)
154   super(version)
155 
156   # Marshaled Properties
157   @properties = {
158       'chat_service_sid' => payload['chat_service_sid'],
159       'default_conversation_creator_role_sid' => payload['default_conversation_creator_role_sid'],
160       'default_conversation_role_sid' => payload['default_conversation_role_sid'],
161       'default_chat_service_role_sid' => payload['default_chat_service_role_sid'],
162       'url' => payload['url'],
163       'links' => payload['links'],
164       'reachability_enabled' => payload['reachability_enabled'],
165   }
166 
167   # Context
168   @instance_context = nil
169   @params = {'chat_service_sid' => chat_service_sid, }
170 end

Public Instance Methods

chat_service_sid() click to toggle source

@return [String] The unique string that identifies the resource

    # File lib/twilio-ruby/rest/conversations/v1/service/configuration.rb
185 def chat_service_sid
186   @properties['chat_service_sid']
187 end
context() click to toggle source

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [ConfigurationContext] ConfigurationContext for this ConfigurationInstance

    # File lib/twilio-ruby/rest/conversations/v1/service/configuration.rb
176 def context
177   unless @instance_context
178     @instance_context = ConfigurationContext.new(@version, @params['chat_service_sid'], )
179   end
180   @instance_context
181 end
default_chat_service_role_sid() click to toggle source

@return [String] The service role assigned to users when they are added to the service

    # File lib/twilio-ruby/rest/conversations/v1/service/configuration.rb
203 def default_chat_service_role_sid
204   @properties['default_chat_service_role_sid']
205 end
default_conversation_creator_role_sid() click to toggle source

@return [String] The role assigned to a conversation creator user when they join a new conversation

    # File lib/twilio-ruby/rest/conversations/v1/service/configuration.rb
191 def default_conversation_creator_role_sid
192   @properties['default_conversation_creator_role_sid']
193 end
default_conversation_role_sid() click to toggle source

@return [String] The role assigned to users when they are added to a conversation

    # File lib/twilio-ruby/rest/conversations/v1/service/configuration.rb
197 def default_conversation_role_sid
198   @properties['default_conversation_role_sid']
199 end
fetch() click to toggle source

Fetch the ConfigurationInstance @return [ConfigurationInstance] Fetched ConfigurationInstance

    # File lib/twilio-ruby/rest/conversations/v1/service/configuration.rb
228 def fetch
229   context.fetch
230 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/conversations/v1/service/configuration.rb
269 def inspect
270   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
271   "<Twilio.Conversations.V1.ConfigurationInstance #{values}>"
272 end
reachability_enabled() click to toggle source

@return [Boolean] Whether the Reachability Indicator feature is enabled for this Conversations Service

    # File lib/twilio-ruby/rest/conversations/v1/service/configuration.rb
221 def reachability_enabled
222   @properties['reachability_enabled']
223 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/conversations/v1/service/configuration.rb
262 def to_s
263   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
264   "<Twilio.Conversations.V1.ConfigurationInstance #{values}>"
265 end
update(default_conversation_creator_role_sid: :unset, default_conversation_role_sid: :unset, default_chat_service_role_sid: :unset, reachability_enabled: :unset) click to toggle source

Update the ConfigurationInstance @param [String] default_conversation_creator_role_sid The conversation-level

role assigned to a conversation creator when they join a new conversation. See
the {Conversation
Role}[https://www.twilio.com/docs/conversations/api/role-resource] for more info
about roles.

@param [String] default_conversation_role_sid The conversation-level role

assigned to users when they are added to a conversation. See the {Conversation
Role}[https://www.twilio.com/docs/conversations/api/role-resource] for more info
about roles.

@param [String] default_chat_service_role_sid The service-level role assigned to

users when they are added to the service. See the {Conversation
Role}[https://www.twilio.com/docs/conversations/api/role-resource] for more info
about roles.

@param [Boolean] reachability_enabled Whether the {Reachability

Indicator}[https://www.twilio.com/docs/chat/reachability-indicator] is enabled
for this Conversations Service. The default is `false`.

@return [ConfigurationInstance] Updated ConfigurationInstance

    # File lib/twilio-ruby/rest/conversations/v1/service/configuration.rb
251 def update(default_conversation_creator_role_sid: :unset, default_conversation_role_sid: :unset, default_chat_service_role_sid: :unset, reachability_enabled: :unset)
252   context.update(
253       default_conversation_creator_role_sid: default_conversation_creator_role_sid,
254       default_conversation_role_sid: default_conversation_role_sid,
255       default_chat_service_role_sid: default_chat_service_role_sid,
256       reachability_enabled: reachability_enabled,
257   )
258 end
url() click to toggle source

@return [String] An absolute URL for this service configuration.

    # File lib/twilio-ruby/rest/conversations/v1/service/configuration.rb
209 def url
210   @properties['url']
211 end