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.



557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 557

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:



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

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.



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

def allow_na
    @properties['allow_na']
end

#answer_setHash

Returns Set of answers for the question.

Returns:

  • (Hash)

    Set of answers for the question



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

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.



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

def answer_set_id
    @properties['answer_set_id']
end

#categoryHash

Returns The Category for the question.

Returns:

  • (Hash)

    The Category for the question.



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

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:



584
585
586
587
588
589
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 584

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



655
656
657
658
659
660
661
662
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 655

def delete(
    authorization: :unset
)

    context.delete(
        authorization: authorization, 
    )
end

#descriptionString

Returns The description for the question.

Returns:

  • (String)

    The description for the question.



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

def description
    @properties['description']
end

#inspectObject

Provide a detailed, user friendly representation



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

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

#questionString

Returns The question.

Returns:

  • (String)

    The question.



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

def question
    @properties['question']
end

#question_sidString

Returns The SID of the question.

Returns:

  • (String)

    The SID of the question



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

def question_sid
    @properties['question_sid']
end

#to_sObject

Provide a user friendly representation



694
695
696
697
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 694

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:



673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 673

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)


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

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



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

def usage
    @properties['usage']
end