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 that contains the resource

  • payload that contains response from Twilio

  • The SID of the Account that created this InsightsQuestionnairesQuestion resource.

  • The SID of the Call resource to fetch.



565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 565

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 that created the Flex Insights resource and owns this resource.

Returns:

  • The SID of the Account that created the Flex Insights resource and owns this resource.



601
602
603
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 601

def 
    @properties['account_sid']
end

#allow_naBoolean

Returns The flag to enable for disable NA for answer.

Returns:

  • The flag to enable for disable NA for answer.



637
638
639
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 637

def allow_na
    @properties['allow_na']
end

#answer_setHash

Returns Set of answers for the question.

Returns:

  • Set of answers for the question



649
650
651
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 649

def answer_set
    @properties['answer_set']
end

#answer_set_idString

Returns The answer_set for the question.

Returns:

  • The answer_set for the question.



631
632
633
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 631

def answer_set_id
    @properties['answer_set_id']
end

#categoryHash

Returns The Category for the question.

Returns:

  • The Category for the question.



625
626
627
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 625

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:

  • CallContext for this CallInstance



592
593
594
595
596
597
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 592

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:

  • (defaults to: :unset)

    The Authorization HTTP request header

Returns:

  • True if delete succeeds, false otherwise



663
664
665
666
667
668
669
670
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 663

def delete(
  authorization: :unset
)

    context.delete(
        authorization: authorization, 
    )
end

#descriptionString

Returns The description for the question.

Returns:

  • The description for the question.



619
620
621
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 619

def description
    @properties['description']
end

#inspectObject

Provide a detailed, user friendly representation



709
710
711
712
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 709

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

#questionString

Returns The question.

Returns:

  • The question.



613
614
615
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 613

def question
    @properties['question']
end

#question_sidString

Returns The SID of the question.

Returns:

  • The SID of the question



607
608
609
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 607

def question_sid
    @properties['question_sid']
end

#to_sObject

Provide a user friendly representation



702
703
704
705
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 702

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:

  • (defaults to: nil)

    The flag to enable for disable NA for answer.

  • (defaults to: :unset)

    The SID of the category

  • (defaults to: :unset)

    The question.

  • (defaults to: :unset)

    The description for the question.

  • (defaults to: :unset)

    The answer_set for the question.

  • (defaults to: :unset)

    The Authorization HTTP request header

Returns:

  • Updated InsightsQuestionnairesQuestionInstance



681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 681

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:



655
656
657
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 655

def url
    @properties['url']
end

#usageString

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

Returns:

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



643
644
645
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 643

def usage
    @properties['usage']
end