Class: ThePlaidApi::StatementsListResponse

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

Overview

StatementsListResponse defines the response schema for ‘/statements/list`

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(accounts:, institution_id:, institution_name:, item_id:, request_id:, additional_properties: nil) ⇒ StatementsListResponse

Returns a new instance of StatementsListResponse.



58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/the_plaid_api/models/statements_list_response.rb', line 58

def initialize(accounts:, institution_id:, institution_name:, item_id:,
               request_id:, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @accounts = accounts
  @institution_id = institution_id
  @institution_name = institution_name
  @item_id = item_id
  @request_id = request_id
  @additional_properties = additional_properties
end

Instance Attribute Details

#accountsArray[StatementsAccount]

TODO: Write general description for this method

Returns:



14
15
16
# File 'lib/the_plaid_api/models/statements_list_response.rb', line 14

def accounts
  @accounts
end

#institution_idString

The Plaid Institution ID associated with the Item.

Returns:

  • (String)


18
19
20
# File 'lib/the_plaid_api/models/statements_list_response.rb', line 18

def institution_id
  @institution_id
end

#institution_nameString

The name of the institution associated with the Item.

Returns:

  • (String)


22
23
24
# File 'lib/the_plaid_api/models/statements_list_response.rb', line 22

def institution_name
  @institution_name
end

#item_idString

The Plaid Item ID. The ‘item_id` is always unique; linking the same account at the same institution twice will result in two Items with different `item_id` values. Like all Plaid identifiers, the `item_id` is case-sensitive.

Returns:

  • (String)


29
30
31
# File 'lib/the_plaid_api/models/statements_list_response.rb', line 29

def item_id
  @item_id
end

#request_idString

A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive.

Returns:

  • (String)


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

def request_id
  @request_id
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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/statements_list_response.rb', line 72

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 << (StatementsAccount.from_hash(structure) if structure)
    end
  end

  accounts = nil unless hash.key?('accounts')
  institution_id =
    hash.key?('institution_id') ? hash['institution_id'] : nil
  institution_name =
    hash.key?('institution_name') ? hash['institution_name'] : nil
  item_id = hash.key?('item_id') ? hash['item_id'] : nil
  request_id = hash.key?('request_id') ? hash['request_id'] : nil

  # 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.
  StatementsListResponse.new(accounts: accounts,
                             institution_id: institution_id,
                             institution_name: institution_name,
                             item_id: item_id,
                             request_id: request_id,
                             additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



38
39
40
41
42
43
44
45
46
# File 'lib/the_plaid_api/models/statements_list_response.rb', line 38

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['accounts'] = 'accounts'
  @_hash['institution_id'] = 'institution_id'
  @_hash['institution_name'] = 'institution_name'
  @_hash['item_id'] = 'item_id'
  @_hash['request_id'] = 'request_id'
  @_hash
end

.nullablesObject

An array for nullable fields



54
55
56
# File 'lib/the_plaid_api/models/statements_list_response.rb', line 54

def self.nullables
  []
end

.optionalsObject

An array for optional fields



49
50
51
# File 'lib/the_plaid_api/models/statements_list_response.rb', line 49

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



118
119
120
121
122
123
# File 'lib/the_plaid_api/models/statements_list_response.rb', line 118

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} accounts: #{@accounts.inspect}, institution_id: #{@institution_id.inspect},"\
  " institution_name: #{@institution_name.inspect}, item_id: #{@item_id.inspect}, request_id:"\
  " #{@request_id.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



110
111
112
113
114
115
# File 'lib/the_plaid_api/models/statements_list_response.rb', line 110

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} accounts: #{@accounts}, institution_id: #{@institution_id},"\
  " institution_name: #{@institution_name}, item_id: #{@item_id}, request_id: #{@request_id},"\
  " additional_properties: #{@additional_properties}>"
end