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

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload) ⇒ ConfigurationInstance

Initialize the ConfigurationInstance

Parameters:

  • version (Version) —

    Version that contains the resource

  • payload (Hash) —

    payload that contains response from Twilio

  • account_sid (String) —

    The SID of the Account that created this Configuration resource.

  • sid (String) —

    The SID of the Call resource to fetch.



288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
# File 'lib/twilio-ruby/rest/conversations/v1/configuration.rb', line 288

def initialize(version, payload )
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'account_sid' => payload['account_sid'],
        'default_chat_service_sid' => payload['default_chat_service_sid'],
        'default_messaging_service_sid' => payload['default_messaging_service_sid'],
        'default_inactive_timer' => payload['default_inactive_timer'],
        'default_closed_timer' => payload['default_closed_timer'],
        'url' => payload['url'],
        'links' => payload['links'],
    }

    # Context
    @instance_context = nil
    @params = {  }
end

Instance Method Details

#account_sid ⇒ String

Returns The SID of the Account responsible for this configuration.

Returns:

  • (String) —

    The SID of the Account responsible for this configuration.



321
322
323
# File 'lib/twilio-ruby/rest/conversations/v1/configuration.rb', line 321

def 
    @properties['account_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

Returns:



312
313
314
315
316
317
# File 'lib/twilio-ruby/rest/conversations/v1/configuration.rb', line 312

def context
    unless @instance_context
        @instance_context = ConfigurationContext.new(@version )
    end
    @instance_context
end

#default_chat_service_sid ⇒ String

Returns The SID of the default Conversation Service used when creating a conversation.

Returns:



327
328
329
# File 'lib/twilio-ruby/rest/conversations/v1/configuration.rb', line 327

def default_chat_service_sid
    @properties['default_chat_service_sid']
end

#default_closed_timer ⇒ String

Returns Default ISO8601 duration when conversation will be switched to closed state. Minimum value for this timer is 10 minutes.

Returns:

  • (String) —

    Default ISO8601 duration when conversation will be switched to closed state. Minimum value for this timer is 10 minutes.



345
346
347
# File 'lib/twilio-ruby/rest/conversations/v1/configuration.rb', line 345

def default_closed_timer
    @properties['default_closed_timer']
end

#default_inactive_timer ⇒ String

Returns Default ISO8601 duration when conversation will be switched to inactive state. Minimum value for this timer is 1 minute.

Returns:

  • (String) —

    Default ISO8601 duration when conversation will be switched to inactive state. Minimum value for this timer is 1 minute.



339
340
341
# File 'lib/twilio-ruby/rest/conversations/v1/configuration.rb', line 339

def default_inactive_timer
    @properties['default_inactive_timer']
end

#default_messaging_service_sid ⇒ String

Returns The SID of the default Messaging Service used when creating a conversation.

Returns:

  • (String) —

    The SID of the default Messaging Service used when creating a conversation.



333
334
335
# File 'lib/twilio-ruby/rest/conversations/v1/configuration.rb', line 333

def default_messaging_service_sid
    @properties['default_messaging_service_sid']
end

#fetch ⇒ ConfigurationInstance

Fetch the ConfigurationInstance

Returns:



364
365
366
367
# File 'lib/twilio-ruby/rest/conversations/v1/configuration.rb', line 364

def fetch

    context.fetch
end

#inspect ⇒ Object

Provide a detailed, user friendly representation



407
408
409
410
# File 'lib/twilio-ruby/rest/conversations/v1/configuration.rb', line 407

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

Returns Contains absolute API resource URLs to access the webhook and default service configurations.

Returns:

  • (Hash) —

    Contains absolute API resource URLs to access the webhook and default service configurations.



357
358
359
# File 'lib/twilio-ruby/rest/conversations/v1/configuration.rb', line 357

def links
    @properties['links']
end

#to_s ⇒ Object

Provide a user friendly representation



400
401
402
403
# File 'lib/twilio-ruby/rest/conversations/v1/configuration.rb', line 400

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

#update(default_chat_service_sid: :unset, default_messaging_service_sid: :unset, default_inactive_timer: :unset, default_closed_timer: :unset) ⇒ ConfigurationInstance

Update the ConfigurationInstance

Parameters:

  • default_chat_service_sid (String) (defaults to: :unset) —

    The SID of the default Conversation Service to use when creating a conversation.

  • default_messaging_service_sid (String) (defaults to: :unset) —

    The SID of the default Messaging Service to use when creating a conversation.

  • default_inactive_timer (String) (defaults to: :unset) —

    Default ISO8601 duration when conversation will be switched to inactive state. Minimum value for this timer is 1 minute.

  • default_closed_timer (String) (defaults to: :unset) —

    Default ISO8601 duration when conversation will be switched to closed state. Minimum value for this timer is 10 minutes.

Returns:



376
377
378
379
380
381
382
383
384
385
386
387
388
389
# File 'lib/twilio-ruby/rest/conversations/v1/configuration.rb', line 376

def update(
  default_chat_service_sid: :unset, 
  default_messaging_service_sid: :unset, 
  default_inactive_timer: :unset, 
  default_closed_timer: :unset
)

    context.update(
        default_chat_service_sid: default_chat_service_sid, 
        default_messaging_service_sid: default_messaging_service_sid, 
        default_inactive_timer: default_inactive_timer, 
        default_closed_timer: default_closed_timer, 
    )
end

#url ⇒ String

Returns An absolute API resource URL for this global configuration.

Returns:

  • (String) —

    An absolute API resource URL for this global configuration.



351
352
353
# File 'lib/twilio-ruby/rest/conversations/v1/configuration.rb', line 351

def url
    @properties['url']
end

#webhooks ⇒ webhooks

Access the webhooks

Returns:



394
395
396
# File 'lib/twilio-ruby/rest/conversations/v1/configuration.rb', line 394

def webhooks
    context.webhooks
end