Class: ThePlaidApi::AssetReportItem
- Defined in:
- lib/the_plaid_api/models/asset_report_item.rb
Overview
A representation of an Item within an Asset Report.
Instance Attribute Summary collapse
-
#accounts ⇒ Array[AccountAssets]
Data about each of the accounts open on the Item.
-
#date_last_updated ⇒ DateTime
The date and time when this Item’s data was last retrieved from the financial institution, in [ISO 8601](wikipedia.org/wiki/ISO_8601) format.
-
#institution_id ⇒ String
The id of the financial institution associated with the Item.
-
#institution_name ⇒ String
The full financial institution name associated with the Item.
-
#item_id ⇒ String
The ‘item_id` of the Item associated with this webhook, warning, or error.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(item_id:, institution_name:, institution_id:, date_last_updated:, accounts:, additional_properties: nil) ⇒ AssetReportItem
constructor
A new instance of AssetReportItem.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_date_last_updated ⇒ Object
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(item_id:, institution_name:, institution_id:, date_last_updated:, accounts:, additional_properties: nil) ⇒ AssetReportItem
Returns a new instance of AssetReportItem.
56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/the_plaid_api/models/asset_report_item.rb', line 56 def initialize(item_id:, institution_name:, institution_id:, date_last_updated:, accounts:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @item_id = item_id @institution_name = institution_name @institution_id = institution_id @date_last_updated = date_last_updated @accounts = accounts @additional_properties = additional_properties end |
Instance Attribute Details
#accounts ⇒ Array[AccountAssets]
Data about each of the accounts open on the Item.
33 34 35 |
# File 'lib/the_plaid_api/models/asset_report_item.rb', line 33 def accounts @accounts end |
#date_last_updated ⇒ DateTime
The date and time when this Item’s data was last retrieved from the financial institution, in [ISO 8601](wikipedia.org/wiki/ISO_8601) format.
29 30 31 |
# File 'lib/the_plaid_api/models/asset_report_item.rb', line 29 def date_last_updated @date_last_updated end |
#institution_id ⇒ String
The id of the financial institution associated with the Item.
23 24 25 |
# File 'lib/the_plaid_api/models/asset_report_item.rb', line 23 def institution_id @institution_id end |
#institution_name ⇒ String
The full financial institution name associated with the Item.
19 20 21 |
# File 'lib/the_plaid_api/models/asset_report_item.rb', line 19 def institution_name @institution_name end |
#item_id ⇒ String
The ‘item_id` of the Item associated with this webhook, warning, or error
15 16 17 |
# File 'lib/the_plaid_api/models/asset_report_item.rb', line 15 def item_id @item_id end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 95 96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/the_plaid_api/models/asset_report_item.rb', line 70 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. item_id = hash.key?('item_id') ? hash['item_id'] : nil institution_name = hash.key?('institution_name') ? hash['institution_name'] : nil institution_id = hash.key?('institution_id') ? hash['institution_id'] : nil date_last_updated = if hash.key?('date_last_updated') (DateTimeHelper.from_rfc3339(hash['date_last_updated']) if hash['date_last_updated']) end # Parameter is an array, so we need to iterate through it accounts = nil unless hash['accounts'].nil? accounts = [] hash['accounts'].each do |structure| accounts << (AccountAssets.from_hash(structure) if structure) end end accounts = nil unless hash.key?('accounts') # 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. AssetReportItem.new(item_id: item_id, institution_name: institution_name, institution_id: institution_id, date_last_updated: date_last_updated, accounts: accounts, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
36 37 38 39 40 41 42 43 44 |
# File 'lib/the_plaid_api/models/asset_report_item.rb', line 36 def self.names @_hash = {} if @_hash.nil? @_hash['item_id'] = 'item_id' @_hash['institution_name'] = 'institution_name' @_hash['institution_id'] = 'institution_id' @_hash['date_last_updated'] = 'date_last_updated' @_hash['accounts'] = 'accounts' @_hash end |
.nullables ⇒ Object
An array for nullable fields
52 53 54 |
# File 'lib/the_plaid_api/models/asset_report_item.rb', line 52 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
47 48 49 |
# File 'lib/the_plaid_api/models/asset_report_item.rb', line 47 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
122 123 124 125 126 127 128 |
# File 'lib/the_plaid_api/models/asset_report_item.rb', line 122 def inspect class_name = self.class.name.split('::').last "<#{class_name} item_id: #{@item_id.inspect}, institution_name:"\ " #{@institution_name.inspect}, institution_id: #{@institution_id.inspect},"\ " date_last_updated: #{@date_last_updated.inspect}, accounts: #{@accounts.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_custom_date_last_updated ⇒ Object
109 110 111 |
# File 'lib/the_plaid_api/models/asset_report_item.rb', line 109 def to_custom_date_last_updated DateTimeHelper.to_rfc3339(date_last_updated) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
114 115 116 117 118 119 |
# File 'lib/the_plaid_api/models/asset_report_item.rb', line 114 def to_s class_name = self.class.name.split('::').last "<#{class_name} item_id: #{@item_id}, institution_name: #{@institution_name},"\ " institution_id: #{@institution_id}, date_last_updated: #{@date_last_updated}, accounts:"\ " #{@accounts}, additional_properties: #{@additional_properties}>" end |