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

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

Instance Method Summary collapse

Constructor Details

#initialize(version, category_sid) ⇒ InsightsQuestionnairesCategoryContext

Initialize the InsightsQuestionnairesCategoryContext



227
228
229
230
231
232
233
234
235
236
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_category.rb', line 227

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



241
242
243
244
245
246
247
248
249
250
251
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_category.rb', line 241

def delete(
    authorization: :unset
)

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', 'Authorization' => authorization, })
    
    
    

    @version.delete('DELETE', @uri, headers: headers)
end

#delete_with_metadata(authorization: :unset) ⇒ Boolean

Delete the InsightsQuestionnairesCategoryInstanceMetadata



257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_category.rb', line 257

def (
  authorization: :unset
)

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', 'Authorization' => authorization, })
    
    
    
      response = @version.('DELETE', @uri, headers: headers)
      insightsQuestionnairesCategory_instance = InsightsQuestionnairesCategoryInstance.new(
          @version,
          response.body,
          account_sid: @solution[:account_sid],
          sid: @solution[:sid],
      )
      .new(@version, insightsQuestionnairesCategory_instance, response.headers, response.status_code)
end

#inspectObject

Provide a detailed, user friendly representation



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

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

#to_sObject

Provide a user friendly representation



340
341
342
343
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_category.rb', line 340

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



280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_category.rb', line 280

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

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

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', 'Authorization' => authorization, })
    
    
    
    
    
    payload = @version.update('POST', @uri, data: data, headers: headers)
    InsightsQuestionnairesCategoryInstance.new(
        @version,
        payload,
        category_sid: @solution[:category_sid],
    )
end

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

Update the InsightsQuestionnairesCategoryInstanceMetadata



308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_category.rb', line 308

def (
  name: nil, 
  authorization: :unset
)

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

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', 'Authorization' => authorization, })
    
    
    
    
    
    response = @version.('POST', @uri, data: data, headers: headers)
    insights_questionnaires_category_instance = InsightsQuestionnairesCategoryInstance.new(
        @version,
        response.body,
        category_sid: @solution[:category_sid],
    )
    .new(
        @version,
        insights_questionnaires_category_instance,
        response.headers,
        response.status_code
    )
end