Skip to content

Commit 3878cb3

Browse files
feat(api): add set_verification_method to external_bank_accounts
1 parent 8abc734 commit 3878cb3

12 files changed

Lines changed: 327 additions & 2 deletions

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 190
1+
configured_endpoints: 191
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-28c9b43d3182bf0e1c9635f6100e4995a744724db1edd635cfd3fc7702ced68c.yml
33
openapi_spec_hash: aba00a65f877c5095499d9d1a66b5e5f
4-
config_hash: 5eca052bb23d273fa970eac3127dd919
4+
config_hash: ac8326134e692f3f3bdec82396bbec80

lib/lithic.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@
271271
require_relative "lithic/models/external_bank_account_retry_prenote_params"
272272
require_relative "lithic/models/external_bank_accounts/micro_deposit_create_params"
273273
require_relative "lithic/models/external_bank_accounts/micro_deposit_create_response"
274+
require_relative "lithic/models/external_bank_account_set_verification_method_params"
274275
require_relative "lithic/models/external_bank_account_unpause_params"
275276
require_relative "lithic/models/external_bank_account_updated_webhook_event"
276277
require_relative "lithic/models/external_bank_account_update_params"

lib/lithic/models.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,9 @@ module Lithic
300300

301301
ExternalBankAccounts = Lithic::Models::ExternalBankAccounts
302302

303+
ExternalBankAccountSetVerificationMethodParams =
304+
Lithic::Models::ExternalBankAccountSetVerificationMethodParams
305+
303306
ExternalBankAccountUnpauseParams = Lithic::Models::ExternalBankAccountUnpauseParams
304307

305308
ExternalBankAccountUpdatedWebhookEvent = Lithic::Models::ExternalBankAccountUpdatedWebhookEvent
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# frozen_string_literal: true
2+
3+
module Lithic
4+
module Models
5+
# @see Lithic::Resources::ExternalBankAccounts#set_verification_method
6+
class ExternalBankAccountSetVerificationMethodParams < Lithic::Internal::Type::BaseModel
7+
extend Lithic::Internal::Type::RequestParameters::Converter
8+
include Lithic::Internal::Type::RequestParameters
9+
10+
# @!attribute external_bank_account_token
11+
#
12+
# @return [String]
13+
required :external_bank_account_token, String
14+
15+
# @!attribute verification_method
16+
# The verification method to set for the external bank account
17+
#
18+
# @return [Symbol, Lithic::Models::ExternalBankAccountSetVerificationMethodParams::VerificationMethod]
19+
required :verification_method,
20+
enum: -> { Lithic::ExternalBankAccountSetVerificationMethodParams::VerificationMethod }
21+
22+
# @!attribute financial_account_token
23+
# The financial account token of the operating account to fund the micro deposits.
24+
# Required when verification_method is MICRO_DEPOSIT or PRENOTE.
25+
#
26+
# @return [String, nil]
27+
optional :financial_account_token, String
28+
29+
# @!method initialize(external_bank_account_token:, verification_method:, financial_account_token: nil, request_options: {})
30+
# Some parameter documentations has been truncated, see
31+
# {Lithic::Models::ExternalBankAccountSetVerificationMethodParams} for more
32+
# details.
33+
#
34+
# @param external_bank_account_token [String]
35+
#
36+
# @param verification_method [Symbol, Lithic::Models::ExternalBankAccountSetVerificationMethodParams::VerificationMethod] The verification method to set for the external bank account
37+
#
38+
# @param financial_account_token [String] The financial account token of the operating account to fund the micro deposits.
39+
#
40+
# @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}]
41+
42+
# The verification method to set for the external bank account
43+
module VerificationMethod
44+
extend Lithic::Internal::Type::Enum
45+
46+
MICRO_DEPOSIT = :MICRO_DEPOSIT
47+
PRENOTE = :PRENOTE
48+
EXTERNALLY_VERIFIED = :EXTERNALLY_VERIFIED
49+
50+
# @!method self.values
51+
# @return [Array<Symbol>]
52+
end
53+
end
54+
end
55+
end

lib/lithic/resources/external_bank_accounts.rb

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,37 @@ def retry_prenote(external_bank_account_token, params = {})
176176
)
177177
end
178178

179+
# Some parameter documentations has been truncated, see
180+
# {Lithic::Models::ExternalBankAccountSetVerificationMethodParams} for more
181+
# details.
182+
#
183+
# Update the verification method for an external bank account. Verification method
184+
# can only be updated if the `verification_state` is `PENDING`.
185+
#
186+
# @overload set_verification_method(external_bank_account_token, verification_method:, financial_account_token: nil, request_options: {})
187+
#
188+
# @param external_bank_account_token [String]
189+
#
190+
# @param verification_method [Symbol, Lithic::Models::ExternalBankAccountSetVerificationMethodParams::VerificationMethod] The verification method to set for the external bank account
191+
#
192+
# @param financial_account_token [String] The financial account token of the operating account to fund the micro deposits.
193+
#
194+
# @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil]
195+
#
196+
# @return [Lithic::Models::ExternalBankAccount]
197+
#
198+
# @see Lithic::Models::ExternalBankAccountSetVerificationMethodParams
199+
def set_verification_method(external_bank_account_token, params)
200+
parsed, options = Lithic::ExternalBankAccountSetVerificationMethodParams.dump_request(params)
201+
@client.request(
202+
method: :post,
203+
path: ["v1/external_bank_accounts/%1$s/set_verification_method", external_bank_account_token],
204+
body: parsed,
205+
model: Lithic::ExternalBankAccount,
206+
options: options
207+
)
208+
end
209+
179210
# Unpause an external bank account
180211
#
181212
# @overload unpause(external_bank_account_token, request_options: {})

rbi/lithic/models.rbi

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,9 @@ module Lithic
288288

289289
ExternalBankAccounts = Lithic::Models::ExternalBankAccounts
290290

291+
ExternalBankAccountSetVerificationMethodParams =
292+
Lithic::Models::ExternalBankAccountSetVerificationMethodParams
293+
291294
ExternalBankAccountUnpauseParams =
292295
Lithic::Models::ExternalBankAccountUnpauseParams
293296

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# typed: strong
2+
3+
module Lithic
4+
module Models
5+
class ExternalBankAccountSetVerificationMethodParams < Lithic::Internal::Type::BaseModel
6+
extend Lithic::Internal::Type::RequestParameters::Converter
7+
include Lithic::Internal::Type::RequestParameters
8+
9+
OrHash =
10+
T.type_alias do
11+
T.any(
12+
Lithic::ExternalBankAccountSetVerificationMethodParams,
13+
Lithic::Internal::AnyHash
14+
)
15+
end
16+
17+
sig { returns(String) }
18+
attr_accessor :external_bank_account_token
19+
20+
# The verification method to set for the external bank account
21+
sig do
22+
returns(
23+
Lithic::ExternalBankAccountSetVerificationMethodParams::VerificationMethod::OrSymbol
24+
)
25+
end
26+
attr_accessor :verification_method
27+
28+
# The financial account token of the operating account to fund the micro deposits.
29+
# Required when verification_method is MICRO_DEPOSIT or PRENOTE.
30+
sig { returns(T.nilable(String)) }
31+
attr_reader :financial_account_token
32+
33+
sig { params(financial_account_token: String).void }
34+
attr_writer :financial_account_token
35+
36+
sig do
37+
params(
38+
external_bank_account_token: String,
39+
verification_method:
40+
Lithic::ExternalBankAccountSetVerificationMethodParams::VerificationMethod::OrSymbol,
41+
financial_account_token: String,
42+
request_options: Lithic::RequestOptions::OrHash
43+
).returns(T.attached_class)
44+
end
45+
def self.new(
46+
external_bank_account_token:,
47+
# The verification method to set for the external bank account
48+
verification_method:,
49+
# The financial account token of the operating account to fund the micro deposits.
50+
# Required when verification_method is MICRO_DEPOSIT or PRENOTE.
51+
financial_account_token: nil,
52+
request_options: {}
53+
)
54+
end
55+
56+
sig do
57+
override.returns(
58+
{
59+
external_bank_account_token: String,
60+
verification_method:
61+
Lithic::ExternalBankAccountSetVerificationMethodParams::VerificationMethod::OrSymbol,
62+
financial_account_token: String,
63+
request_options: Lithic::RequestOptions
64+
}
65+
)
66+
end
67+
def to_hash
68+
end
69+
70+
# The verification method to set for the external bank account
71+
module VerificationMethod
72+
extend Lithic::Internal::Type::Enum
73+
74+
TaggedSymbol =
75+
T.type_alias do
76+
T.all(
77+
Symbol,
78+
Lithic::ExternalBankAccountSetVerificationMethodParams::VerificationMethod
79+
)
80+
end
81+
OrSymbol = T.type_alias { T.any(Symbol, String) }
82+
83+
MICRO_DEPOSIT =
84+
T.let(
85+
:MICRO_DEPOSIT,
86+
Lithic::ExternalBankAccountSetVerificationMethodParams::VerificationMethod::TaggedSymbol
87+
)
88+
PRENOTE =
89+
T.let(
90+
:PRENOTE,
91+
Lithic::ExternalBankAccountSetVerificationMethodParams::VerificationMethod::TaggedSymbol
92+
)
93+
EXTERNALLY_VERIFIED =
94+
T.let(
95+
:EXTERNALLY_VERIFIED,
96+
Lithic::ExternalBankAccountSetVerificationMethodParams::VerificationMethod::TaggedSymbol
97+
)
98+
99+
sig do
100+
override.returns(
101+
T::Array[
102+
Lithic::ExternalBankAccountSetVerificationMethodParams::VerificationMethod::TaggedSymbol
103+
]
104+
)
105+
end
106+
def self.values
107+
end
108+
end
109+
end
110+
end
111+
end

rbi/lithic/resources/external_bank_accounts.rbi

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,28 @@ module Lithic
146146
)
147147
end
148148

149+
# Update the verification method for an external bank account. Verification method
150+
# can only be updated if the `verification_state` is `PENDING`.
151+
sig do
152+
params(
153+
external_bank_account_token: String,
154+
verification_method:
155+
Lithic::ExternalBankAccountSetVerificationMethodParams::VerificationMethod::OrSymbol,
156+
financial_account_token: String,
157+
request_options: Lithic::RequestOptions::OrHash
158+
).returns(Lithic::ExternalBankAccount)
159+
end
160+
def set_verification_method(
161+
external_bank_account_token,
162+
# The verification method to set for the external bank account
163+
verification_method:,
164+
# The financial account token of the operating account to fund the micro deposits.
165+
# Required when verification_method is MICRO_DEPOSIT or PRENOTE.
166+
financial_account_token: nil,
167+
request_options: {}
168+
)
169+
end
170+
149171
# Unpause an external bank account
150172
sig do
151173
params(

sig/lithic/models.rbs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,8 @@ module Lithic
251251

252252
module ExternalBankAccounts = Lithic::Models::ExternalBankAccounts
253253

254+
class ExternalBankAccountSetVerificationMethodParams = Lithic::Models::ExternalBankAccountSetVerificationMethodParams
255+
254256
class ExternalBankAccountUnpauseParams = Lithic::Models::ExternalBankAccountUnpauseParams
255257

256258
class ExternalBankAccountUpdatedWebhookEvent = Lithic::Models::ExternalBankAccountUpdatedWebhookEvent
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
module Lithic
2+
module Models
3+
type external_bank_account_set_verification_method_params =
4+
{
5+
external_bank_account_token: String,
6+
verification_method: Lithic::Models::ExternalBankAccountSetVerificationMethodParams::verification_method,
7+
financial_account_token: String
8+
}
9+
& Lithic::Internal::Type::request_parameters
10+
11+
class ExternalBankAccountSetVerificationMethodParams < Lithic::Internal::Type::BaseModel
12+
extend Lithic::Internal::Type::RequestParameters::Converter
13+
include Lithic::Internal::Type::RequestParameters
14+
15+
attr_accessor external_bank_account_token: String
16+
17+
attr_accessor verification_method: Lithic::Models::ExternalBankAccountSetVerificationMethodParams::verification_method
18+
19+
attr_reader financial_account_token: String?
20+
21+
def financial_account_token=: (String) -> String
22+
23+
def initialize: (
24+
external_bank_account_token: String,
25+
verification_method: Lithic::Models::ExternalBankAccountSetVerificationMethodParams::verification_method,
26+
?financial_account_token: String,
27+
?request_options: Lithic::request_opts
28+
) -> void
29+
30+
def to_hash: -> {
31+
external_bank_account_token: String,
32+
verification_method: Lithic::Models::ExternalBankAccountSetVerificationMethodParams::verification_method,
33+
financial_account_token: String,
34+
request_options: Lithic::RequestOptions
35+
}
36+
37+
type verification_method =
38+
:MICRO_DEPOSIT | :PRENOTE | :EXTERNALLY_VERIFIED
39+
40+
module VerificationMethod
41+
extend Lithic::Internal::Type::Enum
42+
43+
MICRO_DEPOSIT: :MICRO_DEPOSIT
44+
PRENOTE: :PRENOTE
45+
EXTERNALLY_VERIFIED: :EXTERNALLY_VERIFIED
46+
47+
def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountSetVerificationMethodParams::verification_method]
48+
end
49+
end
50+
end
51+
end

0 commit comments

Comments
 (0)