Class: Twilio::REST::FlexApi::V1::InsightsQuestionnairesQuestionInstance

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, question_sid: nil) ⇒ InsightsQuestionnairesQuestionInstance

Initialize the InsightsQuestionnairesQuestionInstance

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 InsightsQuestionnairesQuestion resource.

  • sid (String)

    The SID of the Call resource to fetch.



293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 293

def initialize(version, payload , question_sid: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'account_sid' => payload['account_sid'],
        'question_sid' => payload['question_sid'],
        'question' => payload['question'],
        'description' => payload['description'],
        'category' => payload['category'],
        'answer_set_id' => payload['answer_set_id'],
        'allow_na' => payload['allow_na'],
        'usage' => payload['usage'] == nil ? payload['usage'] : payload['usage'].to_i,
        'answer_set' => payload['answer_set'],
        'url' => payload['url'],
    }

    # Context
    @instance_context = nil
    @params = { 'question_sid' => question_sid  || @properties['question_sid']  , }
end

Instance Method Details

#account_sidString

Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Flex Insights resource and owns this resource.

Returns:



328
329
330
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 328

def 
    @properties['account_sid']
end

#allow_naBoolean

Returns The flag to enable for disable NA for answer.

Returns:

  • (Boolean)

    The flag to enable for disable NA for answer.



364
365
366
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 364

def allow_na
    @properties['allow_na']
end

#answer_setHash

Returns Set of answers for the question.

Returns:

  • (Hash)

    Set of answers for the question



376
377
378
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 376

def answer_set
    @properties['answer_set']
end

#answer_set_idString

Returns The answer_set for the question.

Returns:

  • (String)

    The answer_set for the question.



358
359
360
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 358

def answer_set_id
    @properties['answer_set_id']
end

#categoryHash

Returns The Category for the question.

Returns:

  • (Hash)

    The Category for the question.



352
353
354
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 352

def category
    @properties['category']
end

#contextInsightsQuestionnairesQuestionContext

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

Returns:



319
320
321
322
323
324
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 319

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

#delete(token: :unset) ⇒ Boolean

Delete the InsightsQuestionnairesQuestionInstance

Parameters:

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

    The Token HTTP request header

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



390
391
392
393
394
395
396
397
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 390

def delete(
    token: :unset
)

    context.delete(
        token: token, 
    )
end

#descriptionString

Returns The description for the question.

Returns:

  • (String)

    The description for the question.



346
347
348
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 346

def description
    @properties['description']
end

#inspectObject

Provide a detailed, user friendly representation



436
437
438
439
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 436

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

#questionString

Returns The question.

Returns:

  • (String)

    The question.



340
341
342
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 340

def question
    @properties['question']
end

#question_sidString

Returns The SID of the question.

Returns:

  • (String)

    The SID of the question



334
335
336
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 334

def question_sid
    @properties['question_sid']
end

#to_sObject

Provide a user friendly representation



429
430
431
432
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 429

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

#update(allow_na: nil, category_sid: :unset, question: :unset, description: :unset, answer_set_id: :unset, token: :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.

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

    The Token HTTP request header

Returns:



408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 408

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

    context.update(
        allow_na: allow_na, 
        category_sid: category_sid, 
        question: question, 
        description: description, 
        answer_set_id: answer_set_id, 
        token: token, 
    )
end

#urlString

Returns:

  • (String)


382
383
384
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 382

def url
    @properties['url']
end

#usageString

Returns Integer value that tells a particular question is used by how many questionnaires.

Returns:

  • (String)

    Integer value that tells a particular question is used by how many questionnaires



370
371
372
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 370

def usage
    @properties['usage']
end