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.



541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 541

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_sid ⇒ String

Returns The unique SID identifier of the Account.

Returns:

  • (String) —

    The unique SID identifier of the Account.



581
582
583
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 581

def 
    @properties['account_sid']
end

#agent_id ⇒ String

Returns The id of the Agent.

Returns:

  • (String) —

    The id of the Agent



611
612
613
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 611

def agent_id
    @properties['agent_id']
end

#answer_id ⇒ String

Returns The id of the answer selected by user.

Returns:

  • (String) —

    The id of the answer selected by user



641
642
643
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 641

def answer_id
    @properties['answer_id']
end

#answer_text ⇒ String

Returns The answer text selected by user.

Returns:

  • (String) —

    The answer text selected by user



635
636
637
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 635

def answer_text
    @properties['answer_text']
end

#assessment ⇒ Hash

Returns Assessment Details associated with an assessment.

Returns:

  • (Hash) —

    Assessment Details associated with an assessment



647
648
649
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 647

def assessment
    @properties['assessment']
end

#assessment_sid ⇒ String

Returns The SID of the assessment.

Returns:

  • (String) —

    The SID of the assessment



587
588
589
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 587

def assessment_sid
    @properties['assessment_sid']
end

#context ⇒ AssessmentsContext

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

Returns:



572
573
574
575
576
577
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 572

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

#inspect ⇒ Object

Provide a detailed, user friendly representation



694
695
696
697
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 694

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

#offset ⇒ String

Returns Offset of the conversation.

Returns:

  • (String) —

    Offset of the conversation



593
594
595
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 593

def offset
    @properties['offset']
end

#report ⇒ Boolean

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

Returns:

  • (Boolean) —

    The flag indicating if this assessment is part of report



599
600
601
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 599

def report
    @properties['report']
end

#segment_id ⇒ String

Returns Segment Id of conversation.

Returns:

  • (String) —

    Segment Id of conversation



617
618
619
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 617

def segment_id
    @properties['segment_id']
end

#timestamp ⇒ String

Returns:

  • (String)


653
654
655
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 653

def timestamp
    @properties['timestamp']
end

#to_s ⇒ Object

Provide a user friendly representation



687
688
689
690
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 687

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:



670
671
672
673
674
675
676
677
678
679
680
681
682
683
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 670

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

#url ⇒ String

Returns:

  • (String)


659
660
661
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 659

def url
    @properties['url']
end

#user_email ⇒ String

Returns The email id of the user.

Returns:

  • (String) —

    The email id of the user.



629
630
631
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 629

def user_email
    @properties['user_email']
end

#user_name ⇒ String

Returns The name of the user.

Returns:

  • (String) —

    The name of the user.



623
624
625
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 623

def user_name
    @properties['user_name']
end

#weight ⇒ String

Returns The weightage given to this comment.

Returns:

  • (String) —

    The weightage given to this comment



605
606
607
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 605

def weight
    @properties['weight']
end