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.



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

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:



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

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.



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

def allow_na
    @properties['allow_na']
end

#answer_setHash

Returns Set of answers for the question.

Returns:

  • (Hash)

    Set of answers for the question



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

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.



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

def answer_set_id
    @properties['answer_set_id']
end

#categoryHash

Returns The Category for the question.

Returns:

  • (Hash)

    The Category for the question.



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

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:



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

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

#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



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

def delete(
    authorization: :unset
)

    context.delete(
        authorization: authorization, 
    )
end

#descriptionString

Returns The description for the question.

Returns:

  • (String)

    The description for the question.



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

def description
    @properties['description']
end

#inspectObject

Provide a detailed, user friendly representation



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

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

#questionString

Returns The question.

Returns:

  • (String)

    The question.



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

def question
    @properties['question']
end

#question_sidString

Returns The SID of the question.

Returns:

  • (String)

    The SID of the question



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

def question_sid
    @properties['question_sid']
end

#to_sObject

Provide a user friendly representation



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

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, 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:



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

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

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

#urlString

Returns:

  • (String)


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

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



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

def usage
    @properties['usage']
end