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

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires.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, id: nil) ⇒ InsightsQuestionnairesInstance

Initialize the InsightsQuestionnairesInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • id (String) (defaults to: nil)

    The unique ID of the questionnaire



270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires.rb', line 270

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

  # Marshaled Properties
  @properties = {
      'account_sid' => payload['account_sid'],
      'id' => payload['id'],
      'name' => payload['name'],
      'description' => payload['description'],
      'active' => payload['active'],
      'questions' => payload['questions'],
      'url' => payload['url'],
  }

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



302
303
304
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires.rb', line 302

def 
  @properties['account_sid']
end

#activeBoolean

Returns Is questionnaire enabled ?.

Returns:

  • (Boolean)

    Is questionnaire enabled ?



326
327
328
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires.rb', line 326

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:



293
294
295
296
297
298
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires.rb', line 293

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

#delete(token: :unset) ⇒ Boolean

Delete the InsightsQuestionnairesInstance

Parameters:

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

    The Token HTTP request header

Returns:

  • (Boolean)

    true if delete succeeds, false otherwise



365
366
367
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires.rb', line 365

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

#descriptionString

Returns The questionnaire description.

Returns:

  • (String)

    The questionnaire description



320
321
322
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires.rb', line 320

def description
  @properties['description']
end

#fetch(token: :unset) ⇒ InsightsQuestionnairesInstance

Fetch the InsightsQuestionnairesInstance

Parameters:

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

    The Token HTTP request header

Returns:



373
374
375
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires.rb', line 373

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

#idString

Returns The questionnaire id.

Returns:

  • (String)

    The questionnaire id



308
309
310
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires.rb', line 308

def id
  @properties['id']
end

#inspectObject

Provide a detailed, user friendly representation



386
387
388
389
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires.rb', line 386

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

#nameString

Returns The category name.

Returns:

  • (String)

    The category name.



314
315
316
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires.rb', line 314

def name
  @properties['name']
end

#questionsArray[Hash]

Returns The questions list.

Returns:

  • (Array[Hash])

    The questions list



332
333
334
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires.rb', line 332

def questions
  @properties['questions']
end

#to_sObject

Provide a user friendly representation



379
380
381
382
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires.rb', line 379

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_ids: :unset, token: :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_ids (Array[String]) (defaults to: :unset)

    The list of questions ids under a questionnaire

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

    The Token HTTP request header

Returns:



351
352
353
354
355
356
357
358
359
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires.rb', line 351

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

#urlString

Returns The url.

Returns:

  • (String)

    The url



338
339
340
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires.rb', line 338

def url
  @properties['url']
end