Class: Twilio::REST::FlexApi::V1::AssessmentsInstance

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/flex_api/v1/assessments.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, assessment_sid: nil) ⇒ AssessmentsInstance

Initialize the AssessmentsInstance



288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 288

def initialize(version, payload , assessment_sid: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'account_sid' => payload['account_sid'],
        'assessment_sid' => payload['assessment_sid'],
        'offset' => payload['offset'],
        'report' => payload['report'],
        'weight' => payload['weight'],
        'agent_id' => payload['agent_id'],
        'segment_id' => payload['segment_id'],
        'user_name' => payload['user_name'],
        'user_email' => payload['user_email'],
        'answer_text' => payload['answer_text'],
        'answer_id' => payload['answer_id'],
        'assessment' => payload['assessment'],
        'timestamp' => payload['timestamp'],
        'url' => payload['url'],
    }

    # Context
    @instance_context = nil
    @params = { 'assessment_sid' => assessment_sid  || @properties['assessment_sid']  , }
end

Instance Method Details

#account_sidString



327
328
329
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 327

def 
    @properties['account_sid']
end

#agent_idString



357
358
359
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 357

def agent_id
    @properties['agent_id']
end

#answer_idString



387
388
389
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 387

def answer_id
    @properties['answer_id']
end

#answer_textString



381
382
383
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 381

def answer_text
    @properties['answer_text']
end

#assessmentHash



393
394
395
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 393

def assessment
    @properties['assessment']
end

#assessment_sidString



333
334
335
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 333

def assessment_sid
    @properties['assessment_sid']
end

#contextAssessmentsContext

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



318
319
320
321
322
323
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 318

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

#inspectObject

Provide a detailed, user friendly representation



440
441
442
443
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 440

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

#offsetFloat



339
340
341
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 339

def offset
    @properties['offset']
end

#reportBoolean



345
346
347
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 345

def report
    @properties['report']
end

#segment_idString



363
364
365
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 363

def segment_id
    @properties['segment_id']
end

#timestampFloat



399
400
401
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 399

def timestamp
    @properties['timestamp']
end

#to_sObject

Provide a user friendly representation



433
434
435
436
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 433

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

#update(offset: nil, answer_text: nil, answer_id: nil, authorization: :unset) ⇒ AssessmentsInstance

Update the AssessmentsInstance



416
417
418
419
420
421
422
423
424
425
426
427
428
429
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 416

def update(
    offset: nil, 
    answer_text: nil, 
    answer_id: nil, 
    authorization: :unset
)

    context.update(
        offset: offset, 
        answer_text: answer_text, 
        answer_id: answer_id, 
        authorization: authorization, 
    )
end

#urlString



405
406
407
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 405

def url
    @properties['url']
end

#user_emailString



375
376
377
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 375

def user_email
    @properties['user_email']
end

#user_nameString



369
370
371
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 369

def user_name
    @properties['user_name']
end

#weightFloat



351
352
353
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 351

def weight
    @properties['weight']
end