Class: ThePlaidApi::AuthGetNumbers

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

Overview

An object containing identifying numbers used for making electronic transfers to and from the ‘accounts`. The identifying number type (ACH, EFT, IBAN, or BACS) used will depend on the country of the account. An account may have more than one number type. If a particular identifying number type is not used by any `accounts` for which data has been requested, the array for that type will be empty.

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(ach:, eft:, international:, bacs:, additional_properties: nil) ⇒ AuthGetNumbers

Returns a new instance of AuthGetNumbers.



53
54
55
56
57
58
59
60
61
62
63
# File 'lib/the_plaid_api/models/auth_get_numbers.rb', line 53

def initialize(ach:, eft:, international:, bacs:,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @ach = ach
  @eft = eft
  @international = international
  @bacs = bacs
  @additional_properties = additional_properties
end

Instance Attribute Details

#achArray[NumbersAch]

An array of ACH numbers identifying accounts.

Returns:



19
20
21
# File 'lib/the_plaid_api/models/auth_get_numbers.rb', line 19

def ach
  @ach
end

#bacsArray[NumbersBacs]

An array of BACS numbers identifying accounts.

Returns:



31
32
33
# File 'lib/the_plaid_api/models/auth_get_numbers.rb', line 31

def bacs
  @bacs
end

#eftArray[NumbersEft]

An array of EFT numbers identifying accounts.

Returns:



23
24
25
# File 'lib/the_plaid_api/models/auth_get_numbers.rb', line 23

def eft
  @eft
end

#internationalArray[NumbersInternational]

An array of IBAN numbers identifying accounts.

Returns:



27
28
29
# File 'lib/the_plaid_api/models/auth_get_numbers.rb', line 27

def international
  @international
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



66
67
68
69
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'lib/the_plaid_api/models/auth_get_numbers.rb', line 66

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
  ach = nil
  unless hash['ach'].nil?
    ach = []
    hash['ach'].each do |structure|
      ach << (NumbersAch.from_hash(structure) if structure)
    end
  end

  ach = nil unless hash.key?('ach')
  # Parameter is an array, so we need to iterate through it
  eft = nil
  unless hash['eft'].nil?
    eft = []
    hash['eft'].each do |structure|
      eft << (NumbersEft.from_hash(structure) if structure)
    end
  end

  eft = nil unless hash.key?('eft')
  # Parameter is an array, so we need to iterate through it
  international = nil
  unless hash['international'].nil?
    international = []
    hash['international'].each do |structure|
      international << (NumbersInternational.from_hash(structure) if structure)
    end
  end

  international = nil unless hash.key?('international')
  # Parameter is an array, so we need to iterate through it
  bacs = nil
  unless hash['bacs'].nil?
    bacs = []
    hash['bacs'].each do |structure|
      bacs << (NumbersBacs.from_hash(structure) if structure)
    end
  end

  bacs = nil unless hash.key?('bacs')

  # 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.
  AuthGetNumbers.new(ach: ach,
                     eft: eft,
                     international: international,
                     bacs: bacs,
                     additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



34
35
36
37
38
39
40
41
# File 'lib/the_plaid_api/models/auth_get_numbers.rb', line 34

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['ach'] = 'ach'
  @_hash['eft'] = 'eft'
  @_hash['international'] = 'international'
  @_hash['bacs'] = 'bacs'
  @_hash
end

.nullablesObject

An array for nullable fields



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

def self.nullables
  []
end

.optionalsObject

An array for optional fields



44
45
46
# File 'lib/the_plaid_api/models/auth_get_numbers.rb', line 44

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



134
135
136
137
138
139
# File 'lib/the_plaid_api/models/auth_get_numbers.rb', line 134

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} ach: #{@ach.inspect}, eft: #{@eft.inspect}, international:"\
  " #{@international.inspect}, bacs: #{@bacs.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



127
128
129
130
131
# File 'lib/the_plaid_api/models/auth_get_numbers.rb', line 127

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} ach: #{@ach}, eft: #{@eft}, international: #{@international}, bacs:"\
  " #{@bacs}, additional_properties: #{@additional_properties}>"
end