Class: Twilio::REST::FlexApi::V1::InsightsQuestionnairesInstance

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, questionnaire_sid: nil) ⇒ InsightsQuestionnairesInstance

Initialize the InsightsQuestionnairesInstance

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

  • sid (String)

    The SID of the Call resource to fetch.



593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires.rb', line 593

def initialize(version, payload , questionnaire_sid: nil)
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'account_sid' => payload['account_sid'],
        'questionnaire_sid' => payload['questionnaire_sid'],
        'name' => payload['name'],
        'description' => payload['description'],
        'active' => payload['active'],
        'questions' => payload['questions'],
        'url' => payload['url'],
    }

    # Context
    @instance_context = nil
    @params = { 'questionnaire_sid' => questionnaire_sid  || @properties['questionnaire_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:



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

def 
    @properties['account_sid']
end

#activeBoolean

Returns The flag to enable or disable questionnaire.

Returns:

  • (Boolean)

    The flag to enable or disable questionnaire



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

def active
    @properties['active']
end

#contextInsightsQuestionnairesContext

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

Returns:



617
618
619
620
621
622
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires.rb', line 617

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

#delete(authorization: :unset) ⇒ Boolean

Delete the InsightsQuestionnairesInstance

Parameters:

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

    The Authorization HTTP request header

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



670
671
672
673
674
675
676
677
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires.rb', line 670

def delete(
    authorization: :unset
)

    context.delete(
        authorization: authorization, 
    )
end

#descriptionString

Returns The description of this questionnaire.

Returns:

  • (String)

    The description of this questionnaire



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

def description
    @properties['description']
end

#fetch(authorization: :unset) ⇒ InsightsQuestionnairesInstance

Fetch the InsightsQuestionnairesInstance

Parameters:

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

    The Authorization HTTP request header

Returns:



683
684
685
686
687
688
689
690
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires.rb', line 683

def fetch(
    authorization: :unset
)

    context.fetch(
        authorization: authorization, 
    )
end

#inspectObject

Provide a detailed, user friendly representation



726
727
728
729
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires.rb', line 726

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

#nameString

Returns The name of this category.

Returns:

  • (String)

    The name of this category.



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

def name
    @properties['name']
end

#questionnaire_sidString

Returns The sid of this questionnaire.

Returns:

  • (String)

    The sid of this questionnaire



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

def questionnaire_sid
    @properties['questionnaire_sid']
end

#questionsArray<Hash>

Returns The list of questions with category for a questionnaire.

Returns:

  • (Array<Hash>)

    The list of questions with category for a questionnaire



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

def questions
    @properties['questions']
end

#to_sObject

Provide a user friendly representation



719
720
721
722
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires.rb', line 719

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

#update(active: nil, name: :unset, description: :unset, question_sids: :unset, authorization: :unset) ⇒ InsightsQuestionnairesInstance

Update the InsightsQuestionnairesInstance

Parameters:

  • active (Boolean) (defaults to: nil)

    The flag to enable or disable questionnaire

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

    The name of this questionnaire

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

    The description of this questionnaire

  • question_sids (Array[String]) (defaults to: :unset)

    The list of questions sids under a questionnaire

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

    The Authorization HTTP request header

Returns:



700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires.rb', line 700

def update(
    active: nil, 
    name: :unset, 
    description: :unset, 
    question_sids: :unset, 
    authorization: :unset
)

    context.update(
        active: active, 
        name: name, 
        description: description, 
        question_sids: question_sids, 
        authorization: authorization, 
    )
end

#urlString

Returns:

  • (String)


662
663
664
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires.rb', line 662

def url
    @properties['url']
end