Class: ThePlaidApi::CraVerificationReport

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/the_plaid_api/models/cra_verification_report.rb

Overview

Contains data for the CRA Home Lending Report.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(report_id:, gse_reference_id: SKIP, client_report_id: SKIP, voa: SKIP, employment_refresh: SKIP, additional_properties: nil) ⇒ CraVerificationReport

Returns a new instance of CraVerificationReport.



66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/the_plaid_api/models/cra_verification_report.rb', line 66

def initialize(report_id:, gse_reference_id: SKIP, client_report_id: SKIP,
               voa: SKIP, employment_refresh: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @report_id = report_id
  @gse_reference_id = gse_reference_id unless gse_reference_id == SKIP
  @client_report_id = client_report_id unless client_report_id == SKIP
  @voa = voa unless voa == SKIP
  @employment_refresh = employment_refresh unless employment_refresh == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#client_report_idString

Client-generated identifier, which can be used by lenders to track loan applications.

Returns:

  • (String)


26
27
28
# File 'lib/the_plaid_api/models/cra_verification_report.rb', line 26

def client_report_id
  @client_report_id
end

#employment_refreshCraEmploymentRefreshReport

An object representing an Employment Refresh Report.



34
35
36
# File 'lib/the_plaid_api/models/cra_verification_report.rb', line 34

def employment_refresh
  @employment_refresh
end

#gse_reference_idString

A unique token that can be shared with GSEs in order to provide them access to the report. This is automatically created during report generation when GSE options are specified.

Returns:

  • (String)


21
22
23
# File 'lib/the_plaid_api/models/cra_verification_report.rb', line 21

def gse_reference_id
  @gse_reference_id
end

#report_idString

The unique identifier associated with the Home Lending Report object. This ID will be the same as the Base Report ID.

Returns:

  • (String)


15
16
17
# File 'lib/the_plaid_api/models/cra_verification_report.rb', line 15

def report_id
  @report_id
end

#voaCraVoaReport

An object representing a VOA report.

Returns:



30
31
32
# File 'lib/the_plaid_api/models/cra_verification_report.rb', line 30

def voa
  @voa
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/the_plaid_api/models/cra_verification_report.rb', line 81

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  report_id = hash.key?('report_id') ? hash['report_id'] : nil
  gse_reference_id =
    hash.key?('gse_reference_id') ? hash['gse_reference_id'] : SKIP
  client_report_id =
    hash.key?('client_report_id') ? hash['client_report_id'] : SKIP
  voa = CraVoaReport.from_hash(hash['voa']) if hash['voa']
  employment_refresh = CraEmploymentRefreshReport.from_hash(hash['employment_refresh']) if
    hash['employment_refresh']

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  CraVerificationReport.new(report_id: report_id,
                            gse_reference_id: gse_reference_id,
                            client_report_id: client_report_id,
                            voa: voa,
                            employment_refresh: employment_refresh,
                            additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



37
38
39
40
41
42
43
44
45
# File 'lib/the_plaid_api/models/cra_verification_report.rb', line 37

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['report_id'] = 'report_id'
  @_hash['gse_reference_id'] = 'gse_reference_id'
  @_hash['client_report_id'] = 'client_report_id'
  @_hash['voa'] = 'voa'
  @_hash['employment_refresh'] = 'employment_refresh'
  @_hash
end

.nullablesObject

An array for nullable fields



58
59
60
61
62
63
64
# File 'lib/the_plaid_api/models/cra_verification_report.rb', line 58

def self.nullables
  %w[
    client_report_id
    voa
    employment_refresh
  ]
end

.optionalsObject

An array for optional fields



48
49
50
51
52
53
54
55
# File 'lib/the_plaid_api/models/cra_verification_report.rb', line 48

def self.optionals
  %w[
    gse_reference_id
    client_report_id
    voa
    employment_refresh
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



119
120
121
122
123
124
125
# File 'lib/the_plaid_api/models/cra_verification_report.rb', line 119

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} report_id: #{@report_id.inspect}, gse_reference_id:"\
  " #{@gse_reference_id.inspect}, client_report_id: #{@client_report_id.inspect}, voa:"\
  " #{@voa.inspect}, employment_refresh: #{@employment_refresh.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



111
112
113
114
115
116
# File 'lib/the_plaid_api/models/cra_verification_report.rb', line 111

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} report_id: #{@report_id}, gse_reference_id: #{@gse_reference_id},"\
  " client_report_id: #{@client_report_id}, voa: #{@voa}, employment_refresh:"\
  " #{@employment_refresh}, additional_properties: #{@additional_properties}>"
end