Class: ThePlaidApi::CreditFreddieMacAsset

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

Overview

Documentation not found in the MISMO model viewer and not provided by Freddie Mac.

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(asset_detail:, asset_owners:, asset_holder:, asset_transactions:, validation_sources:, asset_holdings: SKIP, additional_properties: nil) ⇒ CreditFreddieMacAsset

Returns a new instance of CreditFreddieMacAsset.



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

def initialize(asset_detail:, asset_owners:, asset_holder:,
               asset_transactions:, validation_sources:,
               asset_holdings: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @asset_detail = asset_detail
  @asset_owners = asset_owners
  @asset_holder = asset_holder
  @asset_holdings = asset_holdings unless asset_holdings == SKIP
  @asset_transactions = asset_transactions
  @validation_sources = validation_sources
  @additional_properties = additional_properties
end

Instance Attribute Details

#asset_detailAssetDetail

Details about an asset.

Returns:



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

def asset_detail
  @asset_detail
end

#asset_holderAssetHolder

Documentation not found in the MISMO model viewer and not provided by Freddie Mac.

Returns:



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

def asset_holder
  @asset_holder
end

#asset_holdingsAssetHoldings

Documentation not found in the MISMO model viewer and not provided by Freddie Mac.

Returns:



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

def asset_holdings
  @asset_holdings
end

#asset_ownersAssetOwners

Documentation not found in the MISMO model viewer and not provided by Freddie Mac.

Returns:



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

def asset_owners
  @asset_owners
end

#asset_transactionsCreditFreddieMacAssetTransactions

Documentation not found in the MISMO model viewer and not provided by Freddie Mac.



35
36
37
# File 'lib/the_plaid_api/models/credit_freddie_mac_asset.rb', line 35

def asset_transactions
  @asset_transactions
end

#validation_sourcesValidationSources

Documentation not found in the MISMO model viewer and not provided by Freddie Mac.

Returns:



40
41
42
# File 'lib/the_plaid_api/models/credit_freddie_mac_asset.rb', line 40

def validation_sources
  @validation_sources
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
109
110
111
# File 'lib/the_plaid_api/models/credit_freddie_mac_asset.rb', line 82

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  asset_detail = AssetDetail.from_hash(hash['ASSET_DETAIL']) if hash['ASSET_DETAIL']
  asset_owners = AssetOwners.from_hash(hash['ASSET_OWNERS']) if hash['ASSET_OWNERS']
  asset_holder = AssetHolder.from_hash(hash['ASSET_HOLDER']) if hash['ASSET_HOLDER']
  if hash['ASSET_TRANSACTIONS']
    asset_transactions = CreditFreddieMacAssetTransactions.from_hash(hash['ASSET_TRANSACTIONS'])
  end
  validation_sources = ValidationSources.from_hash(hash['VALIDATION_SOURCES']) if
    hash['VALIDATION_SOURCES']
  asset_holdings = AssetHoldings.from_hash(hash['ASSET_HOLDINGS']) if hash['ASSET_HOLDINGS']

  # 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.
  CreditFreddieMacAsset.new(asset_detail: asset_detail,
                            asset_owners: asset_owners,
                            asset_holder: asset_holder,
                            asset_transactions: asset_transactions,
                            validation_sources: validation_sources,
                            asset_holdings: asset_holdings,
                            additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



43
44
45
46
47
48
49
50
51
52
# File 'lib/the_plaid_api/models/credit_freddie_mac_asset.rb', line 43

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['asset_detail'] = 'ASSET_DETAIL'
  @_hash['asset_owners'] = 'ASSET_OWNERS'
  @_hash['asset_holder'] = 'ASSET_HOLDER'
  @_hash['asset_holdings'] = 'ASSET_HOLDINGS'
  @_hash['asset_transactions'] = 'ASSET_TRANSACTIONS'
  @_hash['validation_sources'] = 'VALIDATION_SOURCES'
  @_hash
end

.nullablesObject

An array for nullable fields



62
63
64
# File 'lib/the_plaid_api/models/credit_freddie_mac_asset.rb', line 62

def self.nullables
  []
end

.optionalsObject

An array for optional fields



55
56
57
58
59
# File 'lib/the_plaid_api/models/credit_freddie_mac_asset.rb', line 55

def self.optionals
  %w[
    asset_holdings
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



123
124
125
126
127
128
129
130
# File 'lib/the_plaid_api/models/credit_freddie_mac_asset.rb', line 123

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} asset_detail: #{@asset_detail.inspect}, asset_owners:"\
  " #{@asset_owners.inspect}, asset_holder: #{@asset_holder.inspect}, asset_holdings:"\
  " #{@asset_holdings.inspect}, asset_transactions: #{@asset_transactions.inspect},"\
  " validation_sources: #{@validation_sources.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



114
115
116
117
118
119
120
# File 'lib/the_plaid_api/models/credit_freddie_mac_asset.rb', line 114

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} asset_detail: #{@asset_detail}, asset_owners: #{@asset_owners},"\
  " asset_holder: #{@asset_holder}, asset_holdings: #{@asset_holdings}, asset_transactions:"\
  " #{@asset_transactions}, validation_sources: #{@validation_sources}, additional_properties:"\
  " #{@additional_properties}>"
end