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

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String)

    The SID of the Account that created this Assessments resource.

  • sid (String)

    The SID of the Call resource to fetch.



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

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

Returns The unique SID identifier of the Account.

Returns:

  • (String)

    The unique SID identifier of the Account.



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

def 
    @properties['account_sid']
end

#agent_idString

Returns The id of the Agent.

Returns:

  • (String)

    The id of the Agent



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

def agent_id
    @properties['agent_id']
end

#answer_idString

Returns The id of the answer selected by user.

Returns:

  • (String)

    The id of the answer selected by user



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

def answer_id
    @properties['answer_id']
end

#answer_textString

Returns The answer text selected by user.

Returns:

  • (String)

    The answer text selected by user



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

def answer_text
    @properties['answer_text']
end

#assessmentHash

Returns Assessment Details associated with an assessment.

Returns:

  • (Hash)

    Assessment Details associated with an assessment



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

def assessment
    @properties['assessment']
end

#assessment_sidString

Returns The SID of the assessment.

Returns:

  • (String)

    The SID of the assessment



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

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

Returns:



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

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

#inspectObject

Provide a detailed, user friendly representation



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

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

#offsetFloat

Returns Offset of the conversation.

Returns:

  • (Float)

    Offset of the conversation



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

def offset
    @properties['offset']
end

#reportBoolean

Returns The flag indicating if this assessment is part of report.

Returns:

  • (Boolean)

    The flag indicating if this assessment is part of report



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

def report
    @properties['report']
end

#segment_idString

Returns Segment Id of conversation.

Returns:

  • (String)

    Segment Id of conversation



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

def segment_id
    @properties['segment_id']
end

#timestampFloat

Returns:

  • (Float)


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

def timestamp
    @properties['timestamp']
end

#to_sObject

Provide a user friendly representation



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

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

Parameters:

  • offset (Float) (defaults to: nil)

    The offset of the conversation

  • answer_text (String) (defaults to: nil)

    The answer text selected by user

  • answer_id (String) (defaults to: nil)

    The id of the answer selected by user

  • authorization (String) (defaults to: :unset)

    The Authorization HTTP request header

Returns:



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

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

Returns:

  • (String)


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

def url
    @properties['url']
end

#user_emailString

Returns The email id of the user.

Returns:

  • (String)

    The email id of the user.



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

def user_email
    @properties['user_email']
end

#user_nameString

Returns The name of the user.

Returns:

  • (String)

    The name of the user.



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

def user_name
    @properties['user_name']
end

#weightFloat

Returns The weightage given to this comment.

Returns:

  • (Float)

    The weightage given to this comment



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

def weight
    @properties['weight']
end