Class: Twilio::REST::Autopilot::V1::AssistantContext::TaskContext::SampleContext
- Inherits:
- 
      InstanceContext
      
        - Object
- InstanceContext
- Twilio::REST::Autopilot::V1::AssistantContext::TaskContext::SampleContext
 
- Defined in:
- lib/twilio-ruby/rest/autopilot/v1/assistant/task/sample.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
- 
  
    
      #delete  ⇒ Boolean 
    
    
  
  
  
  
  
  
  
  
  
    Deletes the SampleInstance. 
- 
  
    
      #fetch  ⇒ SampleInstance 
    
    
  
  
  
  
  
  
  
  
  
    Fetch a SampleInstance. 
- 
  
    
      #initialize(version, assistant_sid, task_sid, sid)  ⇒ SampleContext 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    Initialize the SampleContext. 
- 
  
    
      #to_s  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Provide a user friendly representation. 
- 
  
    
      #update(language: :unset, tagged_text: :unset, source_channel: :unset)  ⇒ SampleInstance 
    
    
  
  
  
  
  
  
  
  
  
    Update the SampleInstance. 
Constructor Details
#initialize(version, assistant_sid, task_sid, sid) ⇒ SampleContext
Initialize the SampleContext
| 212 213 214 215 216 217 218 | # File 'lib/twilio-ruby/rest/autopilot/v1/assistant/task/sample.rb', line 212 def initialize(version, assistant_sid, task_sid, sid) super(version) # Path Solution @solution = {assistant_sid: assistant_sid, task_sid: task_sid, sid: sid, } @uri = "/Assistants/#{@solution[:assistant_sid]}/Tasks/#{@solution[:task_sid]}/Samples/#{@solution[:sid]}" end | 
Instance Method Details
#delete ⇒ Boolean
Deletes the SampleInstance
| 278 279 280 | # File 'lib/twilio-ruby/rest/autopilot/v1/assistant/task/sample.rb', line 278 def delete @version.delete('delete', @uri) end | 
#fetch ⇒ SampleInstance
Fetch a SampleInstance
| 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 | # File 'lib/twilio-ruby/rest/autopilot/v1/assistant/task/sample.rb', line 223 def fetch params = Twilio::Values.of({}) payload = @version.fetch( 'GET', @uri, params, ) SampleInstance.new( @version, payload, assistant_sid: @solution[:assistant_sid], task_sid: @solution[:task_sid], sid: @solution[:sid], ) end | 
#to_s ⇒ Object
Provide a user friendly representation
| 284 285 286 287 | # File 'lib/twilio-ruby/rest/autopilot/v1/assistant/task/sample.rb', line 284 def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Autopilot.V1.SampleContext #{context}>" end | 
#update(language: :unset, tagged_text: :unset, source_channel: :unset) ⇒ SampleInstance
Update the SampleInstance
| 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 | # File 'lib/twilio-ruby/rest/autopilot/v1/assistant/task/sample.rb', line 253 def update(language: :unset, tagged_text: :unset, source_channel: :unset) data = Twilio::Values.of({ 'Language' => language, 'TaggedText' => tagged_text, 'SourceChannel' => source_channel, }) payload = @version.update( 'POST', @uri, data: data, ) SampleInstance.new( @version, payload, assistant_sid: @solution[:assistant_sid], task_sid: @solution[:task_sid], sid: @solution[:sid], ) end |