class Twilio::REST::Autopilot::V1::AssistantContext::DefaultsContext
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 help@twilio.com.
Public Class Methods
new(version, assistant_sid)
click to toggle source
Initialize the DefaultsContext
@param [Version] version Version
that contains the resource @param [String] assistant_sid The SID of the
{Assistant}[https://www.twilio.com/docs/autopilot/api/assistant] that is the parent of the resource to fetch.
@return [DefaultsContext] DefaultsContext
Calls superclass method
Twilio::REST::InstanceContext::new
# File lib/twilio-ruby/rest/autopilot/v1/assistant/defaults.rb 79 def initialize(version, assistant_sid) 80 super(version) 81 82 # Path Solution 83 @solution = {assistant_sid: assistant_sid, } 84 @uri = "/Assistants/#{@solution[:assistant_sid]}/Defaults" 85 end
Public Instance Methods
fetch()
click to toggle source
Fetch the DefaultsInstance
@return [DefaultsInstance] Fetched DefaultsInstance
# File lib/twilio-ruby/rest/autopilot/v1/assistant/defaults.rb 90 def fetch 91 payload = @version.fetch('GET', @uri) 92 93 DefaultsInstance.new(@version, payload, assistant_sid: @solution[:assistant_sid], ) 94 end
inspect()
click to toggle source
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/autopilot/v1/assistant/defaults.rb 118 def inspect 119 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 120 "#<Twilio.Autopilot.V1.DefaultsContext #{context}>" 121 end
to_s()
click to toggle source
Provide a user friendly representation
# File lib/twilio-ruby/rest/autopilot/v1/assistant/defaults.rb 111 def to_s 112 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 113 "#<Twilio.Autopilot.V1.DefaultsContext #{context}>" 114 end
update(defaults: :unset)
click to toggle source
Update the DefaultsInstance
@param [Hash] defaults A JSON string that describes the default task links for
the `assistant_initiation`, `collect`, and `fallback` situations.
@return [DefaultsInstance] Updated DefaultsInstance
# File lib/twilio-ruby/rest/autopilot/v1/assistant/defaults.rb 101 def update(defaults: :unset) 102 data = Twilio::Values.of({'Defaults' => Twilio.serialize_object(defaults), }) 103 104 payload = @version.update('POST', @uri, data: data) 105 106 DefaultsInstance.new(@version, payload, assistant_sid: @solution[:assistant_sid], ) 107 end