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.



304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires.rb', line 304

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:



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

def 
    @properties['account_sid']
end

#activeBoolean

Returns The flag to enable or disable questionnaire.

Returns:

  • (Boolean)

    The flag to enable or disable questionnaire



360
361
362
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires.rb', line 360

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:



327
328
329
330
331
332
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires.rb', line 327

def context
    unless @instance_context
        @instance_context = InsightsQuestionnairesContext.new(@version , @params['questionnaire_sid'])
    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



380
381
382
383
384
385
386
387
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires.rb', line 380

def delete(
    token: :unset
)

    context.delete(
        token: token, 
    )
end

#descriptionString

Returns The description of this questionnaire.

Returns:

  • (String)

    The description of this questionnaire



354
355
356
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires.rb', line 354

def description
    @properties['description']
end

#fetch(token: :unset) ⇒ InsightsQuestionnairesInstance

Fetch the InsightsQuestionnairesInstance

Parameters:

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

    The Token HTTP request header

Returns:



393
394
395
396
397
398
399
400
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires.rb', line 393

def fetch(
    token: :unset
)

    context.fetch(
        token: token, 
    )
end

#inspectObject

Provide a detailed, user friendly representation



436
437
438
439
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires.rb', line 436

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.



348
349
350
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires.rb', line 348

def name
    @properties['name']
end

#questionnaire_sidString

Returns The sid of this questionnaire.

Returns:

  • (String)

    The sid of this questionnaire



342
343
344
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires.rb', line 342

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



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

def questions
    @properties['questions']
end

#to_sObject

Provide a user friendly representation



429
430
431
432
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires.rb', line 429

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

    The list of questions sids under a questionnaire

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

    The Token HTTP request header

Returns:



410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires.rb', line 410

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

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

#urlString

Returns:

  • (String)


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

def url
    @properties['url']
end