class Twilio::REST::Autopilot::V1::AssistantContext::DefaultsInstance
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
Initialize the DefaultsInstance
@param [Version] version Version
that contains the resource @param [Hash] payload payload that contains response from Twilio
@param [String] assistant_sid
The SID of the
{Assistant}[https://www.twilio.com/docs/autopilot/api/assistant] that is the parent of the resource.
@return [DefaultsInstance] DefaultsInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/autopilot/v1/assistant/defaults.rb 135 def initialize(version, payload, assistant_sid: nil) 136 super(version) 137 138 # Marshaled Properties 139 @properties = { 140 'account_sid' => payload['account_sid'], 141 'assistant_sid' => payload['assistant_sid'], 142 'url' => payload['url'], 143 'data' => payload['data'], 144 } 145 146 # Context 147 @instance_context = nil 148 @params = {'assistant_sid' => assistant_sid, } 149 end
Public Instance Methods
@return [String] The SID of the Account that created the resource
# File lib/twilio-ruby/rest/autopilot/v1/assistant/defaults.rb 164 def account_sid 165 @properties['account_sid'] 166 end
@return [String] The SID of the Assistant that is the parent of the resource
# File lib/twilio-ruby/rest/autopilot/v1/assistant/defaults.rb 170 def assistant_sid 171 @properties['assistant_sid'] 172 end
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [DefaultsContext] DefaultsContext
for this DefaultsInstance
# File lib/twilio-ruby/rest/autopilot/v1/assistant/defaults.rb 155 def context 156 unless @instance_context 157 @instance_context = DefaultsContext.new(@version, @params['assistant_sid'], ) 158 end 159 @instance_context 160 end
@return [Hash] The JSON string that describes the default task links
# File lib/twilio-ruby/rest/autopilot/v1/assistant/defaults.rb 182 def data 183 @properties['data'] 184 end
Fetch the DefaultsInstance
@return [DefaultsInstance] Fetched DefaultsInstance
# File lib/twilio-ruby/rest/autopilot/v1/assistant/defaults.rb 189 def fetch 190 context.fetch 191 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/autopilot/v1/assistant/defaults.rb 211 def inspect 212 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 213 "<Twilio.Autopilot.V1.DefaultsInstance #{values}>" 214 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/autopilot/v1/assistant/defaults.rb 204 def to_s 205 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 206 "<Twilio.Autopilot.V1.DefaultsInstance #{values}>" 207 end
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 198 def update(defaults: :unset) 199 context.update(defaults: defaults, ) 200 end
@return [String] The absolute URL of the Defaults resource
# File lib/twilio-ruby/rest/autopilot/v1/assistant/defaults.rb 176 def url 177 @properties['url'] 178 end