Class: Twilio::REST::Autopilot::V1::AssistantContext::DefaultsInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/autopilot/v1/assistant/defaults.rb

Overview

PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact [email protected]

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, assistant_sid: nil) ⇒ DefaultsInstance

Initialize the DefaultsInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • assistant_sid (String) (defaults to: nil)

    The SID of the Assistant that is the parent of the resource.


135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/defaults.rb', line 135

def initialize(version, payload, assistant_sid: nil)
  super(version)

  # Marshaled Properties
  @properties = {
      'account_sid' => payload['account_sid'],
      'assistant_sid' => payload['assistant_sid'],
      'url' => payload['url'],
      'data' => payload['data'],
  }

  # Context
  @instance_context = nil
  @params = {'assistant_sid' => assistant_sid, }
end

Instance Method Details

#account_sidString

Returns The SID of the Account that created the resource.

Returns:

  • (String)

    The SID of the Account that created the resource


164
165
166
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/defaults.rb', line 164

def 
  @properties['account_sid']
end

#assistant_sidString

Returns The SID of the Assistant that is the parent of the resource.

Returns:

  • (String)

    The SID of the Assistant that is the parent of the resource


170
171
172
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/defaults.rb', line 170

def assistant_sid
  @properties['assistant_sid']
end

#contextDefaultsContext

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

Returns:


155
156
157
158
159
160
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/defaults.rb', line 155

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

#dataHash

Returns The JSON string that describes the default task links.

Returns:

  • (Hash)

    The JSON string that describes the default task links


182
183
184
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/defaults.rb', line 182

def data
  @properties['data']
end

#fetchDefaultsInstance

Fetch the DefaultsInstance

Returns:


189
190
191
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/defaults.rb', line 189

def fetch
  context.fetch
end

#inspectObject

Provide a detailed, user friendly representation


211
212
213
214
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/defaults.rb', line 211

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

#to_sObject

Provide a user friendly representation


204
205
206
207
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/defaults.rb', line 204

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

#update(defaults: :unset) ⇒ DefaultsInstance

Update the DefaultsInstance

Parameters:

  • defaults (Hash) (defaults to: :unset)

    A JSON string that describes the default task links for the `assistant_initiation`, `collect`, and `fallback` situations.

Returns:


198
199
200
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/defaults.rb', line 198

def update(defaults: :unset)
  context.update(defaults: defaults, )
end

#urlString

Returns The absolute URL of the Defaults resource.

Returns:

  • (String)

    The absolute URL of the Defaults resource


176
177
178
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/defaults.rb', line 176

def url
  @properties['url']
end