Class: Twilio::REST::Conversations::V1::ServiceContext::ConfigurationInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/conversations/v1/service/configuration.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, chat_service_sid: nil) ⇒ ConfigurationInstance

Initialize the ConfigurationInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • chat_service_sid (String) (defaults to: nil)

    The unique string that we created to identify the Service configuration resource.


153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 153

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, }
end

Instance Method Details

#chat_service_sidString

Returns The unique string that identifies the resource.

Returns:

  • (String)

    The unique string that identifies the resource


185
186
187
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 185

def chat_service_sid
  @properties['chat_service_sid']
end

#contextConfigurationContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:


176
177
178
179
180
181
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 176

def context
  unless @instance_context
    @instance_context = ConfigurationContext.new(@version, @params['chat_service_sid'], )
  end
  @instance_context
end

#default_chat_service_role_sidString

Returns The service role assigned to users when they are added to the service.

Returns:

  • (String)

    The service role assigned to users when they are added to the service


203
204
205
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 203

def default_chat_service_role_sid
  @properties['default_chat_service_role_sid']
end

#default_conversation_creator_role_sidString

Returns The role assigned to a conversation creator user when they join a new conversation.

Returns:

  • (String)

    The role assigned to a conversation creator user when they join a new conversation


191
192
193
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 191

def default_conversation_creator_role_sid
  @properties['default_conversation_creator_role_sid']
end

#default_conversation_role_sidString

Returns The role assigned to users when they are added to a conversation.

Returns:

  • (String)

    The role assigned to users when they are added to a conversation


197
198
199
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 197

def default_conversation_role_sid
  @properties['default_conversation_role_sid']
end

#fetchConfigurationInstance

Fetch the ConfigurationInstance

Returns:


228
229
230
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 228

def fetch
  context.fetch
end

#inspectObject

Provide a detailed, user friendly representation


269
270
271
272
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 269

def inspect
  values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.Conversations.V1.ConfigurationInstance #{values}>"
end

Returns Absolute URL to access the push notifications configuration of this service.

Returns:

  • (String)

    Absolute URL to access the push notifications configuration of this service.


215
216
217
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 215

def links
  @properties['links']
end

#reachability_enabledBoolean

Returns Whether the Reachability Indicator feature is enabled for this Conversations Service.

Returns:

  • (Boolean)

    Whether the Reachability Indicator feature is enabled for this Conversations Service


221
222
223
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 221

def reachability_enabled
  @properties['reachability_enabled']
end

#to_sObject

Provide a user friendly representation


262
263
264
265
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 262

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

Parameters:

  • default_conversation_creator_role_sid (String) (defaults to: :unset)

    The conversation-level role assigned to a conversation creator when they join a new conversation. See the Conversation Role for more info about roles.

  • default_conversation_role_sid (String) (defaults to: :unset)

    The conversation-level role assigned to users when they are added to a conversation. See the Conversation Role for more info about roles.

  • default_chat_service_role_sid (String) (defaults to: :unset)

    The service-level role assigned to users when they are added to the service. See the Conversation Role for more info about roles.

  • reachability_enabled (Boolean) (defaults to: :unset)

    Whether the Reachability Indicator is enabled for this Conversations Service. The default is `false`.

Returns:


251
252
253
254
255
256
257
258
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 251

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

#urlString

Returns An absolute URL for this service configuration.

Returns:

  • (String)

    An absolute URL for this service configuration.


209
210
211
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration.rb', line 209

def url
  @properties['url']
end