Class: ThePlaidApi::WalletListResponse
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ThePlaidApi::WalletListResponse
- Defined in:
- lib/the_plaid_api/models/wallet_list_response.rb
Overview
WalletListResponse defines the response schema for ‘/wallet/list`
Instance Attribute Summary collapse
-
#next_cursor ⇒ String
Cursor used for fetching e-wallets created before the latest e-wallet provided in this response.
-
#request_id ⇒ String
A unique identifier for the request, which can be used for troubleshooting.
-
#wallets ⇒ Array[Wallet]
An array of e-wallets.
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(wallets:, request_id:, next_cursor: SKIP, additional_properties: nil) ⇒ WalletListResponse
constructor
A new instance of WalletListResponse.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#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(wallets:, request_id:, next_cursor: SKIP, additional_properties: nil) ⇒ WalletListResponse
Returns a new instance of WalletListResponse.
48 49 50 51 52 53 54 55 56 57 |
# File 'lib/the_plaid_api/models/wallet_list_response.rb', line 48 def initialize(wallets:, request_id:, next_cursor: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @wallets = wallets @next_cursor = next_cursor unless next_cursor == SKIP @request_id = request_id @additional_properties = additional_properties end |
Instance Attribute Details
#next_cursor ⇒ String
Cursor used for fetching e-wallets created before the latest e-wallet provided in this response
19 20 21 |
# File 'lib/the_plaid_api/models/wallet_list_response.rb', line 19 def next_cursor @next_cursor end |
#request_id ⇒ String
A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive.
25 26 27 |
# File 'lib/the_plaid_api/models/wallet_list_response.rb', line 25 def request_id @request_id end |
#wallets ⇒ Array[Wallet]
An array of e-wallets
14 15 16 |
# File 'lib/the_plaid_api/models/wallet_list_response.rb', line 14 def wallets @wallets end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
60 61 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 |
# File 'lib/the_plaid_api/models/wallet_list_response.rb', line 60 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 wallets = nil unless hash['wallets'].nil? wallets = [] hash['wallets'].each do |structure| wallets << (Wallet.from_hash(structure) if structure) end end wallets = nil unless hash.key?('wallets') request_id = hash.key?('request_id') ? hash['request_id'] : nil next_cursor = hash.key?('next_cursor') ? hash['next_cursor'] : SKIP # 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. WalletListResponse.new(wallets: wallets, request_id: request_id, next_cursor: next_cursor, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
28 29 30 31 32 33 34 |
# File 'lib/the_plaid_api/models/wallet_list_response.rb', line 28 def self.names @_hash = {} if @_hash.nil? @_hash['wallets'] = 'wallets' @_hash['next_cursor'] = 'next_cursor' @_hash['request_id'] = 'request_id' @_hash end |
.nullables ⇒ Object
An array for nullable fields
44 45 46 |
# File 'lib/the_plaid_api/models/wallet_list_response.rb', line 44 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
37 38 39 40 41 |
# File 'lib/the_plaid_api/models/wallet_list_response.rb', line 37 def self.optionals %w[ next_cursor ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
99 100 101 102 103 |
# File 'lib/the_plaid_api/models/wallet_list_response.rb', line 99 def inspect class_name = self.class.name.split('::').last "<#{class_name} wallets: #{@wallets.inspect}, next_cursor: #{@next_cursor.inspect},"\ " request_id: #{@request_id.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
92 93 94 95 96 |
# File 'lib/the_plaid_api/models/wallet_list_response.rb', line 92 def to_s class_name = self.class.name.split('::').last "<#{class_name} wallets: #{@wallets}, next_cursor: #{@next_cursor}, request_id:"\ " #{@request_id}, additional_properties: #{@additional_properties}>" end |