Class: Twilio::REST::FlexApi::V1::InsightsQuestionnairesQuestionContext

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

Instance Method Summary collapse

Constructor Details

#initialize(version, question_sid) ⇒ InsightsQuestionnairesQuestionContext

Initialize the InsightsQuestionnairesQuestionContext

Parameters:

  • version (Version)

    Version that contains the resource

  • question_sid (String)

    The SID of the question



269
270
271
272
273
274
275
276
277
278
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 269

def initialize(version, question_sid)
    super(version)
    

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

    
end

Instance Method Details

#delete(authorization: :unset) ⇒ Boolean

Delete the InsightsQuestionnairesQuestionInstance

Parameters:

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

    The Authorization HTTP request header

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



283
284
285
286
287
288
289
290
291
292
293
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 283

def delete(
  authorization: :unset
)

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', 'Authorization' => authorization, })
    
    
    

    @version.delete('DELETE', @uri, headers: headers)
end

#delete_with_metadata(authorization: :unset) ⇒ Boolean

Delete the InsightsQuestionnairesQuestionInstanceMetadata

Parameters:

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

    The Authorization HTTP request header

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 299

def (
  authorization: :unset
)

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', 'Authorization' => authorization, })
    
    
    
      response = @version.('DELETE', @uri, headers: headers)
      insightsQuestionnairesQuestion_instance = InsightsQuestionnairesQuestionInstance.new(
          @version,
          response.body,
          account_sid: @solution[:account_sid],
          sid: @solution[:sid],
      )
      InsightsQuestionnairesQuestionInstanceMetadata.new(@version, insightsQuestionnairesQuestion_instance, response.headers, response.status_code)
end

#inspectObject

Provide a detailed, user friendly representation



413
414
415
416
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 413

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

#to_sObject

Provide a user friendly representation



406
407
408
409
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 406

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

#update(allow_na: nil, category_sid: :unset, question: :unset, description: :unset, answer_set_id: :unset, authorization: :unset) ⇒ InsightsQuestionnairesQuestionInstance

Update the InsightsQuestionnairesQuestionInstance

Parameters:

  • allow_na (Boolean) (defaults to: nil)

    The flag to enable for disable NA for answer.

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

    The SID of the category

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

    The question.

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

    The description for the question.

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

    The answer_set for the question.

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

    The Authorization HTTP request header

Returns:



326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 326

def update(
  allow_na: nil, 
  category_sid: :unset, 
  question: :unset, 
  description: :unset, 
  answer_set_id: :unset, 
  authorization: :unset
)

    data = Twilio::Values.of({
        'AllowNa' => allow_na,
        'CategorySid' => category_sid,
        'Question' => question,
        'Description' => description,
        'AnswerSetId' => answer_set_id,
    })

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', 'Authorization' => authorization, })
    
    
    
    
    
    payload = @version.update('POST', @uri, data: data, headers: headers)
    InsightsQuestionnairesQuestionInstance.new(
        @version,
        payload,
        question_sid: @solution[:question_sid],
    )
end

#update_with_metadata(allow_na: nil, category_sid: :unset, question: :unset, description: :unset, answer_set_id: :unset, authorization: :unset) ⇒ InsightsQuestionnairesQuestionInstance

Update the InsightsQuestionnairesQuestionInstanceMetadata

Parameters:

  • allow_na (Boolean) (defaults to: nil)

    The flag to enable for disable NA for answer.

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

    The SID of the category

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

    The question.

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

    The description for the question.

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

    The answer_set for the question.

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

    The Authorization HTTP request header

Returns:



366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 366

def (
  allow_na: nil, 
  category_sid: :unset, 
  question: :unset, 
  description: :unset, 
  answer_set_id: :unset, 
  authorization: :unset
)

    data = Twilio::Values.of({
        'AllowNa' => allow_na,
        'CategorySid' => category_sid,
        'Question' => question,
        'Description' => description,
        'AnswerSetId' => answer_set_id,
    })

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', 'Authorization' => authorization, })
    
    
    
    
    
    response = @version.('POST', @uri, data: data, headers: headers)
    insights_questionnaires_question_instance = InsightsQuestionnairesQuestionInstance.new(
        @version,
        response.body,
        question_sid: @solution[:question_sid],
    )
    InsightsQuestionnairesQuestionInstanceMetadata.new(
        @version,
        insights_questionnaires_question_instance,
        response.headers,
        response.status_code
    )
end