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



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

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



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

def 
    @properties['account_sid']
end

#agent_idString



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

def agent_id
    @properties['agent_id']
end

#answer_idString



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

def answer_id
    @properties['answer_id']
end

#answer_textString



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

def answer_text
    @properties['answer_text']
end

#assessmentHash



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

def assessment
    @properties['assessment']
end

#assessment_sidString



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

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



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

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

#inspectObject

Provide a detailed, user friendly representation



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

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

#offsetFloat



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

def offset
    @properties['offset']
end

#reportBoolean



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

def report
    @properties['report']
end

#segment_idString



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

def segment_id
    @properties['segment_id']
end

#timestampFloat



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

def timestamp
    @properties['timestamp']
end

#to_sObject

Provide a user friendly representation



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

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



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

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



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

def url
    @properties['url']
end

#user_emailString



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

def user_email
    @properties['user_email']
end

#user_nameString



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

def user_name
    @properties['user_name']
end

#weightFloat



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

def weight
    @properties['weight']
end