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

Inherits:
InstanceContext show all
Defined in:
lib/twilio-ruby/rest/flex_api/v1/assessments.rb

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



202
203
204
205
206
207
208
209
210
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 202

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



255
256
257
258
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 255

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

#to_sObject

Provide a user friendly representation



248
249
250
251
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 248

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:



218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 218

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({'Content-Type' => 'application/x-www-form-urlencoded', 'Authorization' => authorization, })
    
    
    
    
    
    payload = @version.update('POST', @uri, data: data, headers: headers)
    AssessmentsInstance.new(
        @version,
        payload,
        assessment_sid: @solution[:assessment_sid],
    )
end