Class: ThePlaidApi::CraVoaReportItem
- Defined in:
- lib/the_plaid_api/models/cra_voa_report_item.rb
Overview
A representation of an Item within a VOA report.
Instance Attribute Summary collapse
-
#accounts ⇒ Array[CraVoaReportAccount]
Data about each of the accounts open on the Item.
-
#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.
-
#last_update_time ⇒ 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.
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(accounts:, institution_name:, institution_id:, item_id:, last_update_time:, additional_properties: nil) ⇒ CraVoaReportItem
constructor
A new instance of CraVoaReportItem.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_last_update_time ⇒ 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(accounts:, institution_name:, institution_id:, item_id:, last_update_time:, additional_properties: nil) ⇒ CraVoaReportItem
Returns a new instance of CraVoaReportItem.
56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/the_plaid_api/models/cra_voa_report_item.rb', line 56 def initialize(accounts:, institution_name:, institution_id:, item_id:, last_update_time:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @accounts = accounts @institution_name = institution_name @institution_id = institution_id @item_id = item_id @last_update_time = last_update_time @additional_properties = additional_properties end |
Instance Attribute Details
#accounts ⇒ Array[CraVoaReportAccount]
Data about each of the accounts open on the Item.
15 16 17 |
# File 'lib/the_plaid_api/models/cra_voa_report_item.rb', line 15 def accounts @accounts end |
#institution_id ⇒ String
The id of the financial institution associated with the Item.
23 24 25 |
# File 'lib/the_plaid_api/models/cra_voa_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/cra_voa_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
27 28 29 |
# File 'lib/the_plaid_api/models/cra_voa_report_item.rb', line 27 def item_id @item_id end |
#last_update_time ⇒ 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.
33 34 35 |
# File 'lib/the_plaid_api/models/cra_voa_report_item.rb', line 33 def last_update_time @last_update_time 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/cra_voa_report_item.rb', line 70 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. # Parameter is an array, so we need to iterate through it accounts = nil unless hash['accounts'].nil? accounts = [] hash['accounts'].each do |structure| accounts << (CraVoaReportAccount.from_hash(structure) if structure) end end accounts = nil unless hash.key?('accounts') institution_name = hash.key?('institution_name') ? hash['institution_name'] : nil institution_id = hash.key?('institution_id') ? hash['institution_id'] : nil item_id = hash.key?('item_id') ? hash['item_id'] : nil last_update_time = if hash.key?('last_update_time') (DateTimeHelper.from_rfc3339(hash['last_update_time']) if hash['last_update_time']) 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. CraVoaReportItem.new(accounts: accounts, institution_name: institution_name, institution_id: institution_id, item_id: item_id, last_update_time: last_update_time, 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/cra_voa_report_item.rb', line 36 def self.names @_hash = {} if @_hash.nil? @_hash['accounts'] = 'accounts' @_hash['institution_name'] = 'institution_name' @_hash['institution_id'] = 'institution_id' @_hash['item_id'] = 'item_id' @_hash['last_update_time'] = 'last_update_time' @_hash end |
.nullables ⇒ Object
An array for nullable fields
52 53 54 |
# File 'lib/the_plaid_api/models/cra_voa_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/cra_voa_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/cra_voa_report_item.rb', line 122 def inspect class_name = self.class.name.split('::').last "<#{class_name} accounts: #{@accounts.inspect}, institution_name:"\ " #{@institution_name.inspect}, institution_id: #{@institution_id.inspect}, item_id:"\ " #{@item_id.inspect}, last_update_time: #{@last_update_time.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_custom_last_update_time ⇒ Object
109 110 111 |
# File 'lib/the_plaid_api/models/cra_voa_report_item.rb', line 109 def to_custom_last_update_time DateTimeHelper.to_rfc3339(last_update_time) 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/cra_voa_report_item.rb', line 114 def to_s class_name = self.class.name.split('::').last "<#{class_name} accounts: #{@accounts}, institution_name: #{@institution_name},"\ " institution_id: #{@institution_id}, item_id: #{@item_id}, last_update_time:"\ " #{@last_update_time}, additional_properties: #{@additional_properties}>" end |