Class: ThePlaidApi::CraPartnerInsightsFicoResults

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

Overview

The calculated UltraFICO scores returned as part of the Partner Insights 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(lender_application_id:, ultrafico_score_results:, report_characteristics: SKIP, additional_properties: nil) ⇒ CraPartnerInsightsFicoResults

Returns a new instance of CraPartnerInsightsFicoResults.



50
51
52
53
54
55
56
57
58
59
# File 'lib/the_plaid_api/models/cra_partner_insights_fico_results.rb', line 50

def initialize(lender_application_id:, ultrafico_score_results:,
               report_characteristics: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @lender_application_id = lender_application_id
  @ultrafico_score_results = ultrafico_score_results
  @report_characteristics = report_characteristics unless report_characteristics == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#lender_application_idString

Client-generated identifier that uniquely identifies the FICO Application across FICO systems.

Returns:

  • (String)


16
17
18
# File 'lib/the_plaid_api/models/cra_partner_insights_fico_results.rb', line 16

def lender_application_id
  @lender_application_id
end

#report_characteristicsCraPartnerInsightsFicoReportCharacteristics

Report characteristics returned by FICO describing the banking data used to generate the UltraFICO score.



25
26
27
# File 'lib/the_plaid_api/models/cra_partner_insights_fico_results.rb', line 25

def report_characteristics
  @report_characteristics
end

#ultrafico_score_resultsArray[CraPartnerInsightsUltraFicoScoreResult]

UltraFICO scoring results, one per provided base FICO score request.



20
21
22
# File 'lib/the_plaid_api/models/cra_partner_insights_fico_results.rb', line 20

def ultrafico_score_results
  @ultrafico_score_results
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/the_plaid_api/models/cra_partner_insights_fico_results.rb', line 62

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  lender_application_id =
    hash.key?('lender_application_id') ? hash['lender_application_id'] : nil
  # Parameter is an array, so we need to iterate through it
  ultrafico_score_results = nil
  unless hash['ultrafico_score_results'].nil?
    ultrafico_score_results = []
    hash['ultrafico_score_results'].each do |structure|
      ultrafico_score_results << (CraPartnerInsightsUltraFicoScoreResult.from_hash(structure) if structure)
    end
  end

  ultrafico_score_results = nil unless hash.key?('ultrafico_score_results')
  if hash['report_characteristics']
    report_characteristics = CraPartnerInsightsFicoReportCharacteristics.from_hash(hash['report_characteristics'])
  end

  # 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.
  CraPartnerInsightsFicoResults.new(lender_application_id: lender_application_id,
                                    ultrafico_score_results: ultrafico_score_results,
                                    report_characteristics: report_characteristics,
                                    additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



28
29
30
31
32
33
34
# File 'lib/the_plaid_api/models/cra_partner_insights_fico_results.rb', line 28

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['lender_application_id'] = 'lender_application_id'
  @_hash['ultrafico_score_results'] = 'ultrafico_score_results'
  @_hash['report_characteristics'] = 'report_characteristics'
  @_hash
end

.nullablesObject

An array for nullable fields



44
45
46
47
48
# File 'lib/the_plaid_api/models/cra_partner_insights_fico_results.rb', line 44

def self.nullables
  %w[
    report_characteristics
  ]
end

.optionalsObject

An array for optional fields



37
38
39
40
41
# File 'lib/the_plaid_api/models/cra_partner_insights_fico_results.rb', line 37

def self.optionals
  %w[
    report_characteristics
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



105
106
107
108
109
110
# File 'lib/the_plaid_api/models/cra_partner_insights_fico_results.rb', line 105

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} lender_application_id: #{@lender_application_id.inspect},"\
  " ultrafico_score_results: #{@ultrafico_score_results.inspect}, report_characteristics:"\
  " #{@report_characteristics.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



97
98
99
100
101
102
# File 'lib/the_plaid_api/models/cra_partner_insights_fico_results.rb', line 97

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} lender_application_id: #{@lender_application_id}, ultrafico_score_results:"\
  " #{@ultrafico_score_results}, report_characteristics: #{@report_characteristics},"\
  " additional_properties: #{@additional_properties}>"
end