Class: Twilio::REST::Trusthub::V1::SupportingDocumentTypeInstance

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, sid: nil) ⇒ SupportingDocumentTypeInstance

Initialize the SupportingDocumentTypeInstance

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 SupportingDocumentType resource.

  • sid (String) (defaults to: nil) —

    The SID of the Call resource to fetch.



383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
# File 'lib/twilio-ruby/rest/trusthub/v1/supporting_document_type.rb', line 383

def initialize(version, payload , sid: nil)
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'sid' => payload['sid'],
        'friendly_name' => payload['friendly_name'],
        'machine_name' => payload['machine_name'],
        'fields' => payload['fields'],
        'url' => payload['url'],
    }

    # Context
    @instance_context = nil
    @params = { 'sid' => sid  || @properties['sid']  , }
end

Instance Method Details

#context ⇒ SupportingDocumentTypeContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:



405
406
407
408
409
410
# File 'lib/twilio-ruby/rest/trusthub/v1/supporting_document_type.rb', line 405

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

#fetch ⇒ SupportingDocumentTypeInstance

Fetch the SupportingDocumentTypeInstance

Returns:



445
446
447
448
# File 'lib/twilio-ruby/rest/trusthub/v1/supporting_document_type.rb', line 445

def fetch

    context.fetch
end

#fields ⇒ Array<Hash>

Returns The required information for creating a Supporting Document. The required fields will change as regulatory needs change and will differ for businesses and individuals.

Returns:

  • (Array<Hash>) —

    The required information for creating a Supporting Document. The required fields will change as regulatory needs change and will differ for businesses and individuals.



432
433
434
# File 'lib/twilio-ruby/rest/trusthub/v1/supporting_document_type.rb', line 432

def fields
    @properties['fields']
end

#friendly_name ⇒ String

Returns A human-readable description of the Supporting Document Type resource.

Returns:

  • (String) —

    A human-readable description of the Supporting Document Type resource.



420
421
422
# File 'lib/twilio-ruby/rest/trusthub/v1/supporting_document_type.rb', line 420

def friendly_name
    @properties['friendly_name']
end

#inspect ⇒ Object

Provide a detailed, user friendly representation



459
460
461
462
# File 'lib/twilio-ruby/rest/trusthub/v1/supporting_document_type.rb', line 459

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

#machine_name ⇒ String

Returns The machine-readable description of the Supporting Document Type resource.

Returns:

  • (String) —

    The machine-readable description of the Supporting Document Type resource.



426
427
428
# File 'lib/twilio-ruby/rest/trusthub/v1/supporting_document_type.rb', line 426

def machine_name
    @properties['machine_name']
end

#sid ⇒ String

Returns The unique string that identifies the Supporting Document Type resource.

Returns:

  • (String) —

    The unique string that identifies the Supporting Document Type resource.



414
415
416
# File 'lib/twilio-ruby/rest/trusthub/v1/supporting_document_type.rb', line 414

def sid
    @properties['sid']
end

#to_s ⇒ Object

Provide a user friendly representation



452
453
454
455
# File 'lib/twilio-ruby/rest/trusthub/v1/supporting_document_type.rb', line 452

def to_s
    values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Trusthub.V1.SupportingDocumentTypeInstance #{values}>"
end

#url ⇒ String

Returns The absolute URL of the Supporting Document Type resource.

Returns:

  • (String) —

    The absolute URL of the Supporting Document Type resource.



438
439
440
# File 'lib/twilio-ruby/rest/trusthub/v1/supporting_document_type.rb', line 438

def url
    @properties['url']
end