Class: Twilio::REST::Conversations::V1::ConfigurationContext

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

Defined Under Namespace

Classes: WebhookContext, WebhookInstance, WebhookList, WebhookPage

Instance Method Summary collapse

Constructor Details

#initialize(version) ⇒ ConfigurationContext

Initialize the ConfigurationContext

Parameters:

  • version (Version)

    Version that contains the resource


66
67
68
69
70
71
72
73
74
75
# File 'lib/twilio-ruby/rest/conversations/v1/configuration.rb', line 66

def initialize(version)
  super(version)

  # Path Solution
  @solution = {}
  @uri = "/Configuration"

  # Components
  @webhooks = nil
end

Instance Method Details

#fetchConfigurationInstance

Fetch the ConfigurationInstance

Returns:


80
81
82
83
84
# File 'lib/twilio-ruby/rest/conversations/v1/configuration.rb', line 80

def fetch
  payload = @version.fetch('GET', @uri)

  ConfigurationInstance.new(@version, payload, )
end

#inspectObject

Provide a detailed, user friendly representation


129
130
131
132
# File 'lib/twilio-ruby/rest/conversations/v1/configuration.rb', line 129

def inspect
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Conversations.V1.ConfigurationContext #{context}>"
end

#to_sObject

Provide a user friendly representation


122
123
124
125
# File 'lib/twilio-ruby/rest/conversations/v1/configuration.rb', line 122

def to_s
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Conversations.V1.ConfigurationContext #{context}>"
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:


100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/twilio-ruby/rest/conversations/v1/configuration.rb', line 100

def update(default_chat_service_sid: :unset, default_messaging_service_sid: :unset, default_inactive_timer: :unset, default_closed_timer: :unset)
  data = Twilio::Values.of({
      'DefaultChatServiceSid' => default_chat_service_sid,
      'DefaultMessagingServiceSid' => default_messaging_service_sid,
      'DefaultInactiveTimer' => default_inactive_timer,
      'DefaultClosedTimer' => default_closed_timer,
  })

  payload = @version.update('POST', @uri, data: data)

  ConfigurationInstance.new(@version, payload, )
end

#webhooksWebhookContext

Access the webhooks

Returns:


116
117
118
# File 'lib/twilio-ruby/rest/conversations/v1/configuration.rb', line 116

def webhooks
  return WebhookContext.new(@version, )
end