Class: Checkbook::Bank

Inherits:
Object
  • Object
show all
Defined in:
lib/checkbook/api/bank.rb,
lib/checkbook/models/bank.rb

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Bank

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



122
123
124
# File 'lib/checkbook/models/bank.rb', line 122

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#accountObject

Last 4 of account number



19
20
21
# File 'lib/checkbook/models/bank.rb', line 19

def 
  @account
end

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/checkbook/api/bank.rb', line 17

def api_client
  @api_client
end

#balanceObject

Indicates the current amount left in the account’s balance (only for prefunded accounts)



22
23
24
# File 'lib/checkbook/models/bank.rb', line 22

def balance
  @balance
end

#billingObject

Indicates the billing account for the user



25
26
27
# File 'lib/checkbook/models/bank.rb', line 25

def billing
  @billing
end

#dateObject

Account creation timestamp



28
29
30
# File 'lib/checkbook/models/bank.rb', line 28

def date
  @date
end

#defaultObject

Indicates the default account for the user



31
32
33
# File 'lib/checkbook/models/bank.rb', line 31

def default
  @default
end

#idObject

Unique identifier for account



34
35
36
# File 'lib/checkbook/models/bank.rb', line 34

def id
  @id
end

#nameObject

Name of the bank account



37
38
39
# File 'lib/checkbook/models/bank.rb', line 37

def name
  @name
end

#routingObject

Routing number



40
41
42
# File 'lib/checkbook/models/bank.rb', line 40

def routing
  @routing
end

#statusObject

Current status of account



43
44
45
# File 'lib/checkbook/models/bank.rb', line 43

def status
  @status
end

#typeObject

Bank account type



46
47
48
# File 'lib/checkbook/models/bank.rb', line 46

def type
  @type
end

Class Method Details

._deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
# File 'lib/checkbook/models/bank.rb', line 388

def self._deserialize(type, value)
  case type.to_sym
  when :Time
    Time.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    # models (e.g. Pet) or oneOf
    klass = ::Checkbook.const_get(type)
    klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
  end
end

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



87
88
89
# File 'lib/checkbook/models/bank.rb', line 87

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



92
93
94
# File 'lib/checkbook/models/bank.rb', line 92

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/checkbook/models/bank.rb', line 71

def self.attribute_map
  {
    :'account' => :'account',
    :'balance' => :'balance',
    :'billing' => :'billing',
    :'date' => :'date',
    :'default' => :'default',
    :'id' => :'id',
    :'name' => :'name',
    :'routing' => :'routing',
    :'status' => :'status',
    :'type' => :'type'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
# File 'lib/checkbook/models/bank.rb', line 364

def self.build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  transformed_hash = {}
  openapi_types.each_pair do |key, type|
    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = nil
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[attribute_map[key]].is_a?(Array)
        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
      end
    elsif !attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
    end
  end
  new(transformed_hash)
end

.openapi_nullableObject

List of attributes with nullable: true



113
114
115
116
117
118
# File 'lib/checkbook/models/bank.rb', line 113

def self.openapi_nullable
  Set.new([
    :'balance',
    :'name',
  ])
end

.openapi_typesObject

Attribute type mapping.



97
98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/checkbook/models/bank.rb', line 97

def self.openapi_types
  {
    :'account' => :'String',
    :'balance' => :'Float',
    :'billing' => :'Boolean',
    :'date' => :'String',
    :'default' => :'Boolean',
    :'id' => :'String',
    :'name' => :'String',
    :'routing' => :'String',
    :'status' => :'String',
    :'type' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



334
335
336
337
338
339
340
341
342
343
344
345
346
347
# File 'lib/checkbook/models/bank.rb', line 334

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
       == o. &&
      balance == o.balance &&
      billing == o.billing &&
      date == o.date &&
      default == o.default &&
      id == o.id &&
      name == o.name &&
      routing == o.routing &&
      status == o.status &&
      type == o.type
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



459
460
461
462
463
464
465
466
467
468
469
470
471
# File 'lib/checkbook/models/bank.rb', line 459

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#delete_bank(bank_id, opts = {}) ⇒ nil

Remove bank account Remove the specified bank account

Parameters:

  • bank_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


27
28
29
30
# File 'lib/checkbook/api/bank.rb', line 27

def delete_bank(bank_id, opts = {})
  delete_bank_with_http_info(bank_id, opts)
  nil
end

#delete_bank_with_http_info(bank_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Remove bank account Remove the specified bank account

Parameters:

  • bank_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/checkbook/api/bank.rb', line 37

def delete_bank_with_http_info(bank_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: Bank.delete_bank ...'
  end
  # verify the required parameter 'bank_id' is set
  if @api_client.config.client_side_validation && bank_id.nil?
    fail ArgumentError, "Missing the required parameter 'bank_id' when calling Bank.delete_bank"
  end
  # resource path
  local_var_path = '/v3/account/bank/{bank_id}'.sub('{' + 'bank_id' + '}', CGI.escape(bank_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"Bank.delete_bank",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: Bank#delete_bank\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


351
352
353
# File 'lib/checkbook/models/bank.rb', line 351

def eql?(o)
  self == o
end

#get_bank_institutions(opts = {}) ⇒ GetInstitutionsResponse

Get institutions Return a list of our supported institutions for instant account verification

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



89
90
91
92
# File 'lib/checkbook/api/bank.rb', line 89

def get_bank_institutions(opts = {})
  data, _status_code, _headers = get_bank_institutions_with_http_info(opts)
  data
end

#get_bank_institutions_with_http_info(opts = {}) ⇒ Array<(GetInstitutionsResponse, Integer, Hash)>

Get institutions Return a list of our supported institutions for instant account verification

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetInstitutionsResponse, Integer, Hash)>)

    GetInstitutionsResponse data, response status code and response headers



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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# File 'lib/checkbook/api/bank.rb', line 98

def get_bank_institutions_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: Bank.get_bank_institutions ...'
  end
  # resource path
  local_var_path = '/v3/account/bank/institutions'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetInstitutionsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"Bank.get_bank_institutions",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: Bank#get_bank_institutions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_banks(opts = {}) ⇒ GetBanksResponse

Get bank accounts Get the bank accounts for a user

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



146
147
148
149
# File 'lib/checkbook/api/bank.rb', line 146

def get_banks(opts = {})
  data, _status_code, _headers = get_banks_with_http_info(opts)
  data
end

#get_banks_with_http_info(opts = {}) ⇒ Array<(GetBanksResponse, Integer, Hash)>

Get bank accounts Get the bank accounts for a user

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetBanksResponse, Integer, Hash)>)

    GetBanksResponse data, response status code and response headers



155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
# File 'lib/checkbook/api/bank.rb', line 155

def get_banks_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: Bank.get_banks ...'
  end
  # resource path
  local_var_path = '/v3/account/bank'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetBanksResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"Bank.get_banks",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: Bank#get_banks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



357
358
359
# File 'lib/checkbook/models/bank.rb', line 357

def hash
  [, balance, billing, date, default, id, name, routing, status, type].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
# File 'lib/checkbook/models/bank.rb', line 195

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  if @account.nil?
    invalid_properties.push('invalid value for "account", account cannot be nil.')
  end

  if @billing.nil?
    invalid_properties.push('invalid value for "billing", billing cannot be nil.')
  end

  if @date.nil?
    invalid_properties.push('invalid value for "date", date cannot be nil.')
  end

  if @default.nil?
    invalid_properties.push('invalid value for "default", default cannot be nil.')
  end

  if @id.nil?
    invalid_properties.push('invalid value for "id", id cannot be nil.')
  end

  if @routing.nil?
    invalid_properties.push('invalid value for "routing", routing cannot be nil.')
  end

  if @status.nil?
    invalid_properties.push('invalid value for "status", status cannot be nil.')
  end

  if @type.nil?
    invalid_properties.push('invalid value for "type", type cannot be nil.')
  end

  invalid_properties
end

#post_bank(create_bank_request, opts = {}) ⇒ CreateBankResponse

Add bank account Add a new bank account

Parameters:

  • create_bank_request (CreateBankRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



204
205
206
207
# File 'lib/checkbook/api/bank.rb', line 204

def post_bank(create_bank_request, opts = {})
  data, _status_code, _headers = post_bank_with_http_info(create_bank_request, opts)
  data
end

#post_bank_iav(post_bank_iav_request, opts = {}) ⇒ IAVLoginResponse

Add bank account with IAV Add a new bank account with instant account verification

Parameters:

  • post_bank_iav_request (PostBankIavRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



272
273
274
275
# File 'lib/checkbook/api/bank.rb', line 272

def post_bank_iav(post_bank_iav_request, opts = {})
  data, _status_code, _headers = post_bank_iav_with_http_info(post_bank_iav_request, opts)
  data
end

#post_bank_iav_with_http_info(post_bank_iav_request, opts = {}) ⇒ Array<(IAVLoginResponse, Integer, Hash)>

Add bank account with IAV Add a new bank account with instant account verification

Parameters:

  • post_bank_iav_request (PostBankIavRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(IAVLoginResponse, Integer, Hash)>)

    IAVLoginResponse data, response status code and response headers



282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
# File 'lib/checkbook/api/bank.rb', line 282

def post_bank_iav_with_http_info(post_bank_iav_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: Bank.post_bank_iav ...'
  end
  # verify the required parameter 'post_bank_iav_request' is set
  if @api_client.config.client_side_validation && post_bank_iav_request.nil?
    fail ArgumentError, "Missing the required parameter 'post_bank_iav_request' when calling Bank.post_bank_iav"
  end
  # resource path
  local_var_path = '/v3/account/bank/iav'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(post_bank_iav_request)

  # return_type
  return_type = opts[:debug_return_type] || 'IAVLoginResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"Bank.post_bank_iav",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: Bank#post_bank_iav\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_bank_plaid(iav_plaid_request, opts = {}) ⇒ IAVPlaidResponse

Retrieve bank account with Plaid Retrieve the bank account(s) associated with the Plaid token. > [!NOTE] > **Common Errors** > > - **‘User login is required`** or **`Token Expired`**: The specified Plaid processor token has expired and a new token is required.

Parameters:

  • iav_plaid_request (IAVPlaidRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



340
341
342
343
# File 'lib/checkbook/api/bank.rb', line 340

def post_bank_plaid(iav_plaid_request, opts = {})
  data, _status_code, _headers = post_bank_plaid_with_http_info(iav_plaid_request, opts)
  data
end

#post_bank_plaid_with_http_info(iav_plaid_request, opts = {}) ⇒ Array<(IAVPlaidResponse, Integer, Hash)>

Retrieve bank account with Plaid Retrieve the bank account(s) associated with the Plaid token. &gt; [!NOTE] &gt; **Common Errors** &gt; &gt; - **&#x60;User login is required&#x60;** or **&#x60;Token Expired&#x60;**: The specified Plaid processor token has expired and a new token is required.

Parameters:

  • iav_plaid_request (IAVPlaidRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(IAVPlaidResponse, Integer, Hash)>)

    IAVPlaidResponse data, response status code and response headers



350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
# File 'lib/checkbook/api/bank.rb', line 350

def post_bank_plaid_with_http_info(iav_plaid_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: Bank.post_bank_plaid ...'
  end
  # verify the required parameter 'iav_plaid_request' is set
  if @api_client.config.client_side_validation && iav_plaid_request.nil?
    fail ArgumentError, "Missing the required parameter 'iav_plaid_request' when calling Bank.post_bank_plaid"
  end
  # resource path
  local_var_path = '/v3/account/bank/iav/plaid'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(iav_plaid_request)

  # return_type
  return_type = opts[:debug_return_type] || 'IAVPlaidResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"Bank.post_bank_plaid",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: Bank#post_bank_plaid\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_bank_release(bank_release_request, opts = {}) ⇒ nil

Release micro-deposits Release the micro-deposits for a bank account

Parameters:

  • bank_release_request (BankReleaseRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


408
409
410
411
# File 'lib/checkbook/api/bank.rb', line 408

def post_bank_release(bank_release_request, opts = {})
  post_bank_release_with_http_info(bank_release_request, opts)
  nil
end

#post_bank_release_with_http_info(bank_release_request, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Release micro-deposits Release the micro-deposits for a bank account

Parameters:

  • bank_release_request (BankReleaseRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
# File 'lib/checkbook/api/bank.rb', line 418

def post_bank_release_with_http_info(bank_release_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: Bank.post_bank_release ...'
  end
  # verify the required parameter 'bank_release_request' is set
  if @api_client.config.client_side_validation && bank_release_request.nil?
    fail ArgumentError, "Missing the required parameter 'bank_release_request' when calling Bank.post_bank_release"
  end
  # resource path
  local_var_path = '/v3/account/bank/release'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(bank_release_request)

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"Bank.post_bank_release",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: Bank#post_bank_release\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_bank_verify(bank_verify_request, opts = {}) ⇒ nil

Verify micro-deposits Verify the micro-deposits for a bank account

Parameters:

  • bank_verify_request (BankVerifyRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


476
477
478
479
# File 'lib/checkbook/api/bank.rb', line 476

def post_bank_verify(bank_verify_request, opts = {})
  post_bank_verify_with_http_info(bank_verify_request, opts)
  nil
end

#post_bank_verify_with_http_info(bank_verify_request, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Verify micro-deposits Verify the micro-deposits for a bank account

Parameters:

  • bank_verify_request (BankVerifyRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
# File 'lib/checkbook/api/bank.rb', line 486

def post_bank_verify_with_http_info(bank_verify_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: Bank.post_bank_verify ...'
  end
  # verify the required parameter 'bank_verify_request' is set
  if @api_client.config.client_side_validation && bank_verify_request.nil?
    fail ArgumentError, "Missing the required parameter 'bank_verify_request' when calling Bank.post_bank_verify"
  end
  # resource path
  local_var_path = '/v3/account/bank/verify'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(bank_verify_request)

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"Bank.post_bank_verify",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: Bank#post_bank_verify\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_bank_with_http_info(create_bank_request, opts = {}) ⇒ Array<(CreateBankResponse, Integer, Hash)>

Add bank account Add a new bank account

Parameters:

  • create_bank_request (CreateBankRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CreateBankResponse, Integer, Hash)>)

    CreateBankResponse data, response status code and response headers



214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
# File 'lib/checkbook/api/bank.rb', line 214

def post_bank_with_http_info(create_bank_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: Bank.post_bank ...'
  end
  # verify the required parameter 'create_bank_request' is set
  if @api_client.config.client_side_validation && create_bank_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_bank_request' when calling Bank.post_bank"
  end
  # resource path
  local_var_path = '/v3/account/bank'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(create_bank_request)

  # return_type
  return_type = opts[:debug_return_type] || 'CreateBankResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"Bank.post_bank",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: Bank#post_bank\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#put_bank(bank_id, update_bank_request, opts = {}) ⇒ nil

Update bank account Update an existing bank account

Parameters:

  • bank_id (String)
  • update_bank_request (UpdateBankRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


545
546
547
548
# File 'lib/checkbook/api/bank.rb', line 545

def put_bank(bank_id, update_bank_request, opts = {})
  put_bank_with_http_info(bank_id, update_bank_request, opts)
  nil
end

#put_bank_with_http_info(bank_id, update_bank_request, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Update bank account Update an existing bank account

Parameters:

  • bank_id (String)
  • update_bank_request (UpdateBankRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
# File 'lib/checkbook/api/bank.rb', line 556

def put_bank_with_http_info(bank_id, update_bank_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: Bank.put_bank ...'
  end
  # verify the required parameter 'bank_id' is set
  if @api_client.config.client_side_validation && bank_id.nil?
    fail ArgumentError, "Missing the required parameter 'bank_id' when calling Bank.put_bank"
  end
  # verify the required parameter 'update_bank_request' is set
  if @api_client.config.client_side_validation && update_bank_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_bank_request' when calling Bank.put_bank"
  end
  # resource path
  local_var_path = '/v3/account/bank/{bank_id}'.sub('{' + 'bank_id' + '}', CGI.escape(bank_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(update_bank_request)

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"Bank.put_bank",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: Bank#put_bank\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



435
436
437
# File 'lib/checkbook/models/bank.rb', line 435

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



441
442
443
444
445
446
447
448
449
450
451
452
453
# File 'lib/checkbook/models/bank.rb', line 441

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



429
430
431
# File 'lib/checkbook/models/bank.rb', line 429

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
# File 'lib/checkbook/models/bank.rb', line 235

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if @account.nil?
  return false if @billing.nil?
  return false if @date.nil?
  return false if @default.nil?
  return false if @id.nil?
  return false if @routing.nil?
  return false if @status.nil?
  status_validator = EnumAttributeValidator.new('String', ["PENDING", "VERIFIED", "DEPOSIT_ONLY"])
  return false unless status_validator.valid?(@status)
  return false if @type.nil?
  type_validator = EnumAttributeValidator.new('String', ["CHECKING", "SAVINGS", "BUSINESS"])
  return false unless type_validator.valid?(@type)
  true
end