Class: Twilio::REST::FlexApi::V1::AssessmentsList

Inherits:
ListResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/flex_api/v1/assessments.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

Constructor Details

#initialize(version) ⇒ AssessmentsList

Initialize the AssessmentsList

Parameters:

  • version (Version)

    Version that contains the resource



20
21
22
23
24
25
26
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 20

def initialize(version)
  super(version)

  # Path Solution
  @solution = {}
  @uri = "/Insights/QM/Assessments"
end

Instance Method Details

#create(category_id: nil, category_name: nil, segment_id: nil, user_name: nil, user_email: nil, agent_id: nil, offset: nil, metric_id: nil, metric_name: nil, answer_text: nil, answer_id: nil, questionnaire_id: nil, token: :unset) ⇒ AssessmentsInstance

Create the AssessmentsInstance

Parameters:

  • category_id (String) (defaults to: nil)

    The id of the category

  • category_name (String) (defaults to: nil)

    The name of the category

  • segment_id (String) (defaults to: nil)

    Segment Id of the conversation

  • user_name (String) (defaults to: nil)

    Name of the user assessing conversation

  • user_email (String) (defaults to: nil)

    Email of the user assessing conversation

  • agent_id (String) (defaults to: nil)

    The id of the Agent

  • offset (String) (defaults to: nil)

    The offset of the conversation.

  • metric_id (String) (defaults to: nil)

    The question Id selected for assessment

  • metric_name (String) (defaults to: nil)

    The question name of the assessment

  • 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

  • questionnaire_id (String) (defaults to: nil)

    Questionnaire Id of the associated question

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

    The Token HTTP request header

Returns:



44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 44

def create(category_id: nil, category_name: nil, segment_id: nil, user_name: nil, user_email: nil, agent_id: nil, offset: nil, metric_id: nil, metric_name: nil, answer_text: nil, answer_id: nil, questionnaire_id: nil, token: :unset)
  data = Twilio::Values.of({
      'CategoryId' => category_id,
      'CategoryName' => category_name,
      'SegmentId' => segment_id,
      'UserName' => user_name,
      'UserEmail' => user_email,
      'AgentId' => agent_id,
      'Offset' => offset,
      'MetricId' => metric_id,
      'MetricName' => metric_name,
      'AnswerText' => answer_text,
      'AnswerId' => answer_id,
      'QuestionnaireId' => questionnaire_id,
  })
  headers = Twilio::Values.of({'Token' => token, })

  payload = @version.create('POST', @uri, data: data, headers: headers)

  AssessmentsInstance.new(@version, payload, )
end

#to_sObject

Provide a user friendly representation



68
69
70
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 68

def to_s
  '#<Twilio.FlexApi.V1.AssessmentsList>'
end