Class: Twilio::REST::Trusthub::V1::SupportingDocumentContext

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

Instance Method Summary collapse

Constructor Details

#initialize(version, sid) ⇒ SupportingDocumentContext

Initialize the SupportingDocumentContext

Parameters:

  • version (Version)

    Version that contains the resource

  • sid (String)

    The unique string created by Twilio to identify the Supporting Document resource.



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

def initialize(version, sid)
    super(version)
    

    # Path Solution
    @solution = { sid: sid,  }
    @uri = "/SupportingDocuments/#{@solution[:sid]}"

    
end

Instance Method Details

#deleteBoolean

Delete the SupportingDocumentInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



240
241
242
243
244
245
246
247
248
# File 'lib/twilio-ruby/rest/trusthub/v1/supporting_document.rb', line 240

def delete

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

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

#delete_with_metadataBoolean

Delete the SupportingDocumentInstanceMetadata

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
# File 'lib/twilio-ruby/rest/trusthub/v1/supporting_document.rb', line 253

def 

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

#fetchSupportingDocumentInstance

Fetch the SupportingDocumentInstance

Returns:



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

def fetch

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.fetch('GET', @uri, headers: headers)
    SupportingDocumentInstance.new(
        @version,
        payload,
        sid: @solution[:sid],
    )
end

#fetch_with_metadataSupportingDocumentInstance

Fetch the SupportingDocumentInstanceMetadata

Returns:



291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
# File 'lib/twilio-ruby/rest/trusthub/v1/supporting_document.rb', line 291

def 

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    response = @version.('GET', @uri, headers: headers)
    supporting_document_instance = SupportingDocumentInstance.new(
        @version,
        response.body,
        sid: @solution[:sid],
    )
    .new(
        @version,
        supporting_document_instance,
        response.headers,
        response.status_code
    )
end

#inspectObject

Provide a detailed, user friendly representation



387
388
389
390
# File 'lib/twilio-ruby/rest/trusthub/v1/supporting_document.rb', line 387

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

#to_sObject

Provide a user friendly representation



380
381
382
383
# File 'lib/twilio-ruby/rest/trusthub/v1/supporting_document.rb', line 380

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

#update(friendly_name: :unset, attributes: :unset) ⇒ SupportingDocumentInstance

Update the SupportingDocumentInstance

Parameters:

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

    The string that you assigned to describe the resource.

  • attributes (Object) (defaults to: :unset)

    The set of parameters that are the attributes of the Supporting Document resource which are derived Supporting Document Types.

Returns:



318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
# File 'lib/twilio-ruby/rest/trusthub/v1/supporting_document.rb', line 318

def update(
    friendly_name: :unset, 
    attributes: :unset
)

    data = Twilio::Values.of({
        'FriendlyName' => friendly_name,
        'Attributes' => Twilio.serialize_object(attributes),
    })

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

#update_with_metadata(friendly_name: :unset, attributes: :unset) ⇒ SupportingDocumentInstance

Update the SupportingDocumentInstanceMetadata

Parameters:

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

    The string that you assigned to describe the resource.

  • attributes (Object) (defaults to: :unset)

    The set of parameters that are the attributes of the Supporting Document resource which are derived Supporting Document Types.

Returns:



347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
# File 'lib/twilio-ruby/rest/trusthub/v1/supporting_document.rb', line 347

def (
  friendly_name: :unset, 
  attributes: :unset
)

    data = Twilio::Values.of({
        'FriendlyName' => friendly_name,
        'Attributes' => Twilio.serialize_object(attributes),
    })

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