Class: Twilio::REST::FlexApi::V1::InsightsQuestionnairesCategoryContext

Inherits:
InstanceContext
  • 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, category_sid) ⇒ InsightsQuestionnairesCategoryContext

Initialize the InsightsQuestionnairesCategoryContext

Parameters:

  • version (Version)

    Version that contains the resource

  • category_sid (String)

    The SID of the category to be updated



162
163
164
165
166
167
168
169
170
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_category.rb', line 162

def initialize(version, category_sid)
    super(version)

    # Path Solution
    @solution = { category_sid: category_sid,  }
    @uri = "/Insights/QualityManagement/Categories/#{@solution[:category_sid]}"

    
end

Instance Method Details

#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



175
176
177
178
179
180
181
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_category.rb', line 175

def delete(
    authorization: :unset
)

    headers = Twilio::Values.of({ 'Authorization' => authorization, })
    @version.delete('DELETE', @uri, headers: headers)
end

#inspectObject

Provide a detailed, user friendly representation



216
217
218
219
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_category.rb', line 216

def inspect
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.FlexApi.V1.InsightsQuestionnairesCategoryContext #{context}>"
end

#to_sObject

Provide a user friendly representation



209
210
211
212
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_category.rb', line 209

def to_s
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.FlexApi.V1.InsightsQuestionnairesCategoryContext #{context}>"
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:



188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_category.rb', line 188

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

    data = Twilio::Values.of({
        'Name' => name,
    })

    headers = Twilio::Values.of({ 'Authorization' => authorization, })
    payload = @version.update('POST', @uri, data: data, headers: headers)
    InsightsQuestionnairesCategoryInstance.new(
        @version,
        payload,
        category_sid: @solution[:category_sid],
    )
end