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.



218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
# File 'lib/twilio-ruby/rest/trusthub/v1/supporting_document_type.rb', line 218

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

#contextSupportingDocumentTypeContext

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

Returns:



239
240
241
242
243
244
# File 'lib/twilio-ruby/rest/trusthub/v1/supporting_document_type.rb', line 239

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

#fetchSupportingDocumentTypeInstance

Fetch the SupportingDocumentTypeInstance

Returns:



279
280
281
282
# File 'lib/twilio-ruby/rest/trusthub/v1/supporting_document_type.rb', line 279

def fetch

    context.fetch
end

#fieldsArray<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.



266
267
268
# File 'lib/twilio-ruby/rest/trusthub/v1/supporting_document_type.rb', line 266

def fields
    @properties['fields']
end

#friendly_nameString

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

Returns:

  • (String)

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



254
255
256
# File 'lib/twilio-ruby/rest/trusthub/v1/supporting_document_type.rb', line 254

def friendly_name
    @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



293
294
295
296
# File 'lib/twilio-ruby/rest/trusthub/v1/supporting_document_type.rb', line 293

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

#machine_nameString

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

Returns:

  • (String)

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



260
261
262
# File 'lib/twilio-ruby/rest/trusthub/v1/supporting_document_type.rb', line 260

def machine_name
    @properties['machine_name']
end

#sidString

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

Returns:

  • (String)

    The unique string that identifies the Supporting Document Type resource.



248
249
250
# File 'lib/twilio-ruby/rest/trusthub/v1/supporting_document_type.rb', line 248

def sid
    @properties['sid']
end

#to_sObject

Provide a user friendly representation



286
287
288
289
# File 'lib/twilio-ruby/rest/trusthub/v1/supporting_document_type.rb', line 286

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

#urlString

Returns The absolute URL of the Supporting Document Type resource.

Returns:

  • (String)

    The absolute URL of the Supporting Document Type resource.



272
273
274
# File 'lib/twilio-ruby/rest/trusthub/v1/supporting_document_type.rb', line 272

def url
    @properties['url']
end