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

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

Overview

PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact [email protected].

Instance Method Summary collapse

Constructor Details

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

Initialize the InsightsQuestionnairesCategoryInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • category_id (String) (defaults to: nil)

    The ID of the category to be update



228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_category.rb', line 228

def initialize(version, payload, category_id: nil)
  super(version)

  # Marshaled Properties
  @properties = {
      'account_sid' => payload['account_sid'],
      'category_id' => payload['category_id'],
      'name' => payload['name'],
      'url' => payload['url'],
  }

  # Context
  @instance_context = nil
  @params = {'category_id' => category_id || @properties['category_id'], }
end

Instance Method Details

#account_sidString

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

Returns:

  • (String)

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



257
258
259
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_category.rb', line 257

def 
  @properties['account_sid']
end

#category_idString

Returns Unique category ID.

Returns:

  • (String)

    Unique category ID



263
264
265
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_category.rb', line 263

def category_id
  @properties['category_id']
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:



248
249
250
251
252
253
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_category.rb', line 248

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

#delete(token: :unset) ⇒ Boolean

Delete the InsightsQuestionnairesCategoryInstance

Parameters:

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

    The Token HTTP request header

Returns:

  • (Boolean)

    true if delete succeeds, false otherwise



292
293
294
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_category.rb', line 292

def delete(token: :unset)
  context.delete(token: token, )
end

#inspectObject

Provide a detailed, user friendly representation



305
306
307
308
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_category.rb', line 305

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

#nameString

Returns The category name.

Returns:

  • (String)

    The category name.



269
270
271
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_category.rb', line 269

def name
  @properties['name']
end

#to_sObject

Provide a user friendly representation



298
299
300
301
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_category.rb', line 298

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

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

Update the InsightsQuestionnairesCategoryInstance

Parameters:

  • name (String) (defaults to: nil)

    The name of this category.

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

    The Token HTTP request header

Returns:



284
285
286
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_category.rb', line 284

def update(name: nil, token: :unset)
  context.update(name: name, token: token, )
end

#urlString

Returns The url.

Returns:

  • (String)

    The url



275
276
277
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_category.rb', line 275

def url
  @properties['url']
end