Class: Twilio::REST::FlexApi::V1::InsightsQuestionnairesCategoryInstance

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, category_sid: nil) ⇒ InsightsQuestionnairesCategoryInstance

Initialize the InsightsQuestionnairesCategoryInstance

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

  • sid (String)

    The SID of the Call resource to fetch.



499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_category.rb', line 499

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

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



529
530
531
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_category.rb', line 529

def 
    @properties['account_sid']
end

#category_sidString

Returns The SID of the category.

Returns:

  • (String)

    The SID of the category



535
536
537
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_category.rb', line 535

def category_sid
    @properties['category_sid']
end

#contextInsightsQuestionnairesCategoryContext

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

Returns:



520
521
522
523
524
525
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_category.rb', line 520

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

#delete(authorization: :unset) ⇒ Boolean

Delete the InsightsQuestionnairesCategoryInstance

Parameters:

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

    The Authorization HTTP request header

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



555
556
557
558
559
560
561
562
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_category.rb', line 555

def delete(
    authorization: :unset
)

    context.delete(
        authorization: authorization, 
    )
end

#inspectObject

Provide a detailed, user friendly representation



589
590
591
592
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_category.rb', line 589

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

#nameString

Returns The name of this category.

Returns:

  • (String)

    The name of this category.



541
542
543
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_category.rb', line 541

def name
    @properties['name']
end

#to_sObject

Provide a user friendly representation



582
583
584
585
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_category.rb', line 582

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

#update(name: nil, authorization: :unset) ⇒ InsightsQuestionnairesCategoryInstance

Update the InsightsQuestionnairesCategoryInstance

Parameters:

  • name (String) (defaults to: nil)

    The name of this category.

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

    The Authorization HTTP request header

Returns:



569
570
571
572
573
574
575
576
577
578
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_category.rb', line 569

def update(
    name: nil, 
    authorization: :unset
)

    context.update(
        name: name, 
        authorization: authorization, 
    )
end

#urlString

Returns:

  • (String)


547
548
549
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_category.rb', line 547

def url
    @properties['url']
end