class Twilio::REST::Conversations::V1::ServiceContext::ConfigurationContext
Public Class Methods
Initialize the ConfigurationContext
@param [Version] version Version
that contains the resource @param [String] chat_service_sid The SID of the Service configuration resource
to fetch.
@return [ConfigurationContext] ConfigurationContext
Twilio::REST::InstanceContext::new
# File lib/twilio-ruby/rest/conversations/v1/service/configuration.rb 71 def initialize(version, chat_service_sid) 72 super(version) 73 74 # Path Solution 75 @solution = {chat_service_sid: chat_service_sid, } 76 @uri = "/Services/#{@solution[:chat_service_sid]}/Configuration" 77 78 # Components 79 @notifications = nil 80 end
Public Instance Methods
Fetch the ConfigurationInstance
@return [ConfigurationInstance] Fetched ConfigurationInstance
# File lib/twilio-ruby/rest/conversations/v1/service/configuration.rb 85 def fetch 86 payload = @version.fetch('GET', @uri) 87 88 ConfigurationInstance.new(@version, payload, chat_service_sid: @solution[:chat_service_sid], ) 89 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/conversations/v1/service/configuration.rb 139 def inspect 140 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 141 "#<Twilio.Conversations.V1.ConfigurationContext #{context}>" 142 end
Access the notifications @return [NotificationContext] NotificationContext
# File lib/twilio-ruby/rest/conversations/v1/service/configuration.rb 126 def notifications 127 return NotificationContext.new(@version, @solution[:chat_service_sid], ) 128 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/conversations/v1/service/configuration.rb 132 def to_s 133 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 134 "#<Twilio.Conversations.V1.ConfigurationContext #{context}>" 135 end
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 110 def update(default_conversation_creator_role_sid: :unset, default_conversation_role_sid: :unset, default_chat_service_role_sid: :unset, reachability_enabled: :unset) 111 data = Twilio::Values.of({ 112 'DefaultConversationCreatorRoleSid' => default_conversation_creator_role_sid, 113 'DefaultConversationRoleSid' => default_conversation_role_sid, 114 'DefaultChatServiceRoleSid' => default_chat_service_role_sid, 115 'ReachabilityEnabled' => reachability_enabled, 116 }) 117 118 payload = @version.update('POST', @uri, data: data) 119 120 ConfigurationInstance.new(@version, payload, chat_service_sid: @solution[:chat_service_sid], ) 121 end