Class: Twilio::REST::FlexApi::V1::AssessmentsContext

Inherits:
InstanceContext 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, assessment_sid) ⇒ AssessmentsContext

Initialize the AssessmentsContext

Parameters:

  • version (Version)

    Version that contains the resource

  • assessment_sid (String)

    The SID of the assessment to be modified



195
196
197
198
199
200
201
202
203
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 195

def initialize(version, assessment_sid)
    super(version)

    # Path Solution
    @solution = { assessment_sid: assessment_sid,  }
    @uri = "/Insights/QualityManagement/Assessments/#{@solution[:assessment_sid]}"

    
end

Instance Method Details

#inspectObject

Provide a detailed, user friendly representation



243
244
245
246
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 243

def inspect
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.FlexApi.V1.AssessmentsContext #{context}>"
end

#to_sObject

Provide a user friendly representation



236
237
238
239
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 236

def to_s
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.FlexApi.V1.AssessmentsContext #{context}>"
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:



211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 211

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

    data = Twilio::Values.of({
        'Offset' => offset,
        'AnswerText' => answer_text,
        'AnswerId' => answer_id,
    })

    headers = Twilio::Values.of({ 'Authorization' => authorization, })
    payload = @version.update('POST', @uri, data: data, headers: headers)
    AssessmentsInstance.new(
        @version,
        payload,
        assessment_sid: @solution[:assessment_sid],
    )
end