Skip to content

Commit 909c756

Browse files
feat(api): add pause method to external_bank_accounts
1 parent cee6086 commit 909c756

9 files changed

Lines changed: 563 additions & 4 deletions

File tree

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 194
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-89ce5b3ff634397bdfc05a63d3103b9c767726dfc6b042883d220d08d4156c99.yml
3-
openapi_spec_hash: 867ab9ab196ad28740f46ec4e7bf7aba
4-
config_hash: 1c5c139a2aa0d1d45c063f953a9bc803
1+
configured_endpoints: 195
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-5ec638035f079f92b3493da7492f7f4f67d76e4172302a83c6808ea4e4c3a3d5.yml
3+
openapi_spec_hash: c776074e0e039540c14b61b533797be4
4+
config_hash: 5ea7ffb0f27ab810d32bf107ccc56761
Lines changed: 244 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,244 @@
1+
// File generated from our OpenAPI spec by Stainless.
2+
3+
package com.lithic.api.models
4+
5+
import com.lithic.api.core.JsonValue
6+
import com.lithic.api.core.Params
7+
import com.lithic.api.core.http.Headers
8+
import com.lithic.api.core.http.QueryParams
9+
import com.lithic.api.core.toImmutable
10+
import java.util.Objects
11+
import java.util.Optional
12+
import kotlin.jvm.optionals.getOrNull
13+
14+
/** Pause an external bank account */
15+
class ExternalBankAccountPauseParams
16+
private constructor(
17+
private val externalBankAccountToken: String?,
18+
private val additionalHeaders: Headers,
19+
private val additionalQueryParams: QueryParams,
20+
private val additionalBodyProperties: Map<String, JsonValue>,
21+
) : Params {
22+
23+
fun externalBankAccountToken(): Optional<String> = Optional.ofNullable(externalBankAccountToken)
24+
25+
/** Additional body properties to send with the request. */
26+
fun _additionalBodyProperties(): Map<String, JsonValue> = additionalBodyProperties
27+
28+
/** Additional headers to send with the request. */
29+
fun _additionalHeaders(): Headers = additionalHeaders
30+
31+
/** Additional query param to send with the request. */
32+
fun _additionalQueryParams(): QueryParams = additionalQueryParams
33+
34+
fun toBuilder() = Builder().from(this)
35+
36+
companion object {
37+
38+
@JvmStatic fun none(): ExternalBankAccountPauseParams = builder().build()
39+
40+
/**
41+
* Returns a mutable builder for constructing an instance of
42+
* [ExternalBankAccountPauseParams].
43+
*/
44+
@JvmStatic fun builder() = Builder()
45+
}
46+
47+
/** A builder for [ExternalBankAccountPauseParams]. */
48+
class Builder internal constructor() {
49+
50+
private var externalBankAccountToken: String? = null
51+
private var additionalHeaders: Headers.Builder = Headers.builder()
52+
private var additionalQueryParams: QueryParams.Builder = QueryParams.builder()
53+
private var additionalBodyProperties: MutableMap<String, JsonValue> = mutableMapOf()
54+
55+
@JvmSynthetic
56+
internal fun from(externalBankAccountPauseParams: ExternalBankAccountPauseParams) = apply {
57+
externalBankAccountToken = externalBankAccountPauseParams.externalBankAccountToken
58+
additionalHeaders = externalBankAccountPauseParams.additionalHeaders.toBuilder()
59+
additionalQueryParams = externalBankAccountPauseParams.additionalQueryParams.toBuilder()
60+
additionalBodyProperties =
61+
externalBankAccountPauseParams.additionalBodyProperties.toMutableMap()
62+
}
63+
64+
fun externalBankAccountToken(externalBankAccountToken: String?) = apply {
65+
this.externalBankAccountToken = externalBankAccountToken
66+
}
67+
68+
/**
69+
* Alias for calling [Builder.externalBankAccountToken] with
70+
* `externalBankAccountToken.orElse(null)`.
71+
*/
72+
fun externalBankAccountToken(externalBankAccountToken: Optional<String>) =
73+
externalBankAccountToken(externalBankAccountToken.getOrNull())
74+
75+
fun additionalHeaders(additionalHeaders: Headers) = apply {
76+
this.additionalHeaders.clear()
77+
putAllAdditionalHeaders(additionalHeaders)
78+
}
79+
80+
fun additionalHeaders(additionalHeaders: Map<String, Iterable<String>>) = apply {
81+
this.additionalHeaders.clear()
82+
putAllAdditionalHeaders(additionalHeaders)
83+
}
84+
85+
fun putAdditionalHeader(name: String, value: String) = apply {
86+
additionalHeaders.put(name, value)
87+
}
88+
89+
fun putAdditionalHeaders(name: String, values: Iterable<String>) = apply {
90+
additionalHeaders.put(name, values)
91+
}
92+
93+
fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply {
94+
this.additionalHeaders.putAll(additionalHeaders)
95+
}
96+
97+
fun putAllAdditionalHeaders(additionalHeaders: Map<String, Iterable<String>>) = apply {
98+
this.additionalHeaders.putAll(additionalHeaders)
99+
}
100+
101+
fun replaceAdditionalHeaders(name: String, value: String) = apply {
102+
additionalHeaders.replace(name, value)
103+
}
104+
105+
fun replaceAdditionalHeaders(name: String, values: Iterable<String>) = apply {
106+
additionalHeaders.replace(name, values)
107+
}
108+
109+
fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply {
110+
this.additionalHeaders.replaceAll(additionalHeaders)
111+
}
112+
113+
fun replaceAllAdditionalHeaders(additionalHeaders: Map<String, Iterable<String>>) = apply {
114+
this.additionalHeaders.replaceAll(additionalHeaders)
115+
}
116+
117+
fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) }
118+
119+
fun removeAllAdditionalHeaders(names: Set<String>) = apply {
120+
additionalHeaders.removeAll(names)
121+
}
122+
123+
fun additionalQueryParams(additionalQueryParams: QueryParams) = apply {
124+
this.additionalQueryParams.clear()
125+
putAllAdditionalQueryParams(additionalQueryParams)
126+
}
127+
128+
fun additionalQueryParams(additionalQueryParams: Map<String, Iterable<String>>) = apply {
129+
this.additionalQueryParams.clear()
130+
putAllAdditionalQueryParams(additionalQueryParams)
131+
}
132+
133+
fun putAdditionalQueryParam(key: String, value: String) = apply {
134+
additionalQueryParams.put(key, value)
135+
}
136+
137+
fun putAdditionalQueryParams(key: String, values: Iterable<String>) = apply {
138+
additionalQueryParams.put(key, values)
139+
}
140+
141+
fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply {
142+
this.additionalQueryParams.putAll(additionalQueryParams)
143+
}
144+
145+
fun putAllAdditionalQueryParams(additionalQueryParams: Map<String, Iterable<String>>) =
146+
apply {
147+
this.additionalQueryParams.putAll(additionalQueryParams)
148+
}
149+
150+
fun replaceAdditionalQueryParams(key: String, value: String) = apply {
151+
additionalQueryParams.replace(key, value)
152+
}
153+
154+
fun replaceAdditionalQueryParams(key: String, values: Iterable<String>) = apply {
155+
additionalQueryParams.replace(key, values)
156+
}
157+
158+
fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply {
159+
this.additionalQueryParams.replaceAll(additionalQueryParams)
160+
}
161+
162+
fun replaceAllAdditionalQueryParams(additionalQueryParams: Map<String, Iterable<String>>) =
163+
apply {
164+
this.additionalQueryParams.replaceAll(additionalQueryParams)
165+
}
166+
167+
fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) }
168+
169+
fun removeAllAdditionalQueryParams(keys: Set<String>) = apply {
170+
additionalQueryParams.removeAll(keys)
171+
}
172+
173+
fun additionalBodyProperties(additionalBodyProperties: Map<String, JsonValue>) = apply {
174+
this.additionalBodyProperties.clear()
175+
putAllAdditionalBodyProperties(additionalBodyProperties)
176+
}
177+
178+
fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply {
179+
additionalBodyProperties.put(key, value)
180+
}
181+
182+
fun putAllAdditionalBodyProperties(additionalBodyProperties: Map<String, JsonValue>) =
183+
apply {
184+
this.additionalBodyProperties.putAll(additionalBodyProperties)
185+
}
186+
187+
fun removeAdditionalBodyProperty(key: String) = apply {
188+
additionalBodyProperties.remove(key)
189+
}
190+
191+
fun removeAllAdditionalBodyProperties(keys: Set<String>) = apply {
192+
keys.forEach(::removeAdditionalBodyProperty)
193+
}
194+
195+
/**
196+
* Returns an immutable instance of [ExternalBankAccountPauseParams].
197+
*
198+
* Further updates to this [Builder] will not mutate the returned instance.
199+
*/
200+
fun build(): ExternalBankAccountPauseParams =
201+
ExternalBankAccountPauseParams(
202+
externalBankAccountToken,
203+
additionalHeaders.build(),
204+
additionalQueryParams.build(),
205+
additionalBodyProperties.toImmutable(),
206+
)
207+
}
208+
209+
fun _body(): Optional<Map<String, JsonValue>> =
210+
Optional.ofNullable(additionalBodyProperties.ifEmpty { null })
211+
212+
fun _pathParam(index: Int): String =
213+
when (index) {
214+
0 -> externalBankAccountToken ?: ""
215+
else -> ""
216+
}
217+
218+
override fun _headers(): Headers = additionalHeaders
219+
220+
override fun _queryParams(): QueryParams = additionalQueryParams
221+
222+
override fun equals(other: Any?): Boolean {
223+
if (this === other) {
224+
return true
225+
}
226+
227+
return other is ExternalBankAccountPauseParams &&
228+
externalBankAccountToken == other.externalBankAccountToken &&
229+
additionalHeaders == other.additionalHeaders &&
230+
additionalQueryParams == other.additionalQueryParams &&
231+
additionalBodyProperties == other.additionalBodyProperties
232+
}
233+
234+
override fun hashCode(): Int =
235+
Objects.hash(
236+
externalBankAccountToken,
237+
additionalHeaders,
238+
additionalQueryParams,
239+
additionalBodyProperties,
240+
)
241+
242+
override fun toString() =
243+
"ExternalBankAccountPauseParams{externalBankAccountToken=$externalBankAccountToken, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}"
244+
}

lithic-java-core/src/main/kotlin/com/lithic/api/services/async/ExternalBankAccountServiceAsync.kt

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import com.lithic.api.models.ExternalBankAccountCreateParams
1010
import com.lithic.api.models.ExternalBankAccountCreateResponse
1111
import com.lithic.api.models.ExternalBankAccountListPageAsync
1212
import com.lithic.api.models.ExternalBankAccountListParams
13+
import com.lithic.api.models.ExternalBankAccountPauseParams
1314
import com.lithic.api.models.ExternalBankAccountRetrieveParams
1415
import com.lithic.api.models.ExternalBankAccountRetrieveResponse
1516
import com.lithic.api.models.ExternalBankAccountRetryMicroDepositsParams
@@ -217,6 +218,45 @@ interface ExternalBankAccountServiceAsync {
217218
fun list(requestOptions: RequestOptions): CompletableFuture<ExternalBankAccountListPageAsync> =
218219
list(ExternalBankAccountListParams.none(), requestOptions)
219220

221+
/** Pause an external bank account */
222+
fun pause(externalBankAccountToken: String): CompletableFuture<ExternalBankAccount> =
223+
pause(externalBankAccountToken, ExternalBankAccountPauseParams.none())
224+
225+
/** @see pause */
226+
fun pause(
227+
externalBankAccountToken: String,
228+
params: ExternalBankAccountPauseParams = ExternalBankAccountPauseParams.none(),
229+
requestOptions: RequestOptions = RequestOptions.none(),
230+
): CompletableFuture<ExternalBankAccount> =
231+
pause(
232+
params.toBuilder().externalBankAccountToken(externalBankAccountToken).build(),
233+
requestOptions,
234+
)
235+
236+
/** @see pause */
237+
fun pause(
238+
externalBankAccountToken: String,
239+
params: ExternalBankAccountPauseParams = ExternalBankAccountPauseParams.none(),
240+
): CompletableFuture<ExternalBankAccount> =
241+
pause(externalBankAccountToken, params, RequestOptions.none())
242+
243+
/** @see pause */
244+
fun pause(
245+
params: ExternalBankAccountPauseParams,
246+
requestOptions: RequestOptions = RequestOptions.none(),
247+
): CompletableFuture<ExternalBankAccount>
248+
249+
/** @see pause */
250+
fun pause(params: ExternalBankAccountPauseParams): CompletableFuture<ExternalBankAccount> =
251+
pause(params, RequestOptions.none())
252+
253+
/** @see pause */
254+
fun pause(
255+
externalBankAccountToken: String,
256+
requestOptions: RequestOptions,
257+
): CompletableFuture<ExternalBankAccount> =
258+
pause(externalBankAccountToken, ExternalBankAccountPauseParams.none(), requestOptions)
259+
220260
/** Retry external bank account micro deposit verification. */
221261
fun retryMicroDeposits(
222262
externalBankAccountToken: String
@@ -604,6 +644,53 @@ interface ExternalBankAccountServiceAsync {
604644
): CompletableFuture<HttpResponseFor<ExternalBankAccountListPageAsync>> =
605645
list(ExternalBankAccountListParams.none(), requestOptions)
606646

647+
/**
648+
* Returns a raw HTTP response for `post
649+
* /v1/external_bank_accounts/{external_bank_account_token}/pause`, but is otherwise the
650+
* same as [ExternalBankAccountServiceAsync.pause].
651+
*/
652+
fun pause(
653+
externalBankAccountToken: String
654+
): CompletableFuture<HttpResponseFor<ExternalBankAccount>> =
655+
pause(externalBankAccountToken, ExternalBankAccountPauseParams.none())
656+
657+
/** @see pause */
658+
fun pause(
659+
externalBankAccountToken: String,
660+
params: ExternalBankAccountPauseParams = ExternalBankAccountPauseParams.none(),
661+
requestOptions: RequestOptions = RequestOptions.none(),
662+
): CompletableFuture<HttpResponseFor<ExternalBankAccount>> =
663+
pause(
664+
params.toBuilder().externalBankAccountToken(externalBankAccountToken).build(),
665+
requestOptions,
666+
)
667+
668+
/** @see pause */
669+
fun pause(
670+
externalBankAccountToken: String,
671+
params: ExternalBankAccountPauseParams = ExternalBankAccountPauseParams.none(),
672+
): CompletableFuture<HttpResponseFor<ExternalBankAccount>> =
673+
pause(externalBankAccountToken, params, RequestOptions.none())
674+
675+
/** @see pause */
676+
fun pause(
677+
params: ExternalBankAccountPauseParams,
678+
requestOptions: RequestOptions = RequestOptions.none(),
679+
): CompletableFuture<HttpResponseFor<ExternalBankAccount>>
680+
681+
/** @see pause */
682+
fun pause(
683+
params: ExternalBankAccountPauseParams
684+
): CompletableFuture<HttpResponseFor<ExternalBankAccount>> =
685+
pause(params, RequestOptions.none())
686+
687+
/** @see pause */
688+
fun pause(
689+
externalBankAccountToken: String,
690+
requestOptions: RequestOptions,
691+
): CompletableFuture<HttpResponseFor<ExternalBankAccount>> =
692+
pause(externalBankAccountToken, ExternalBankAccountPauseParams.none(), requestOptions)
693+
607694
/**
608695
* Returns a raw HTTP response for `post
609696
* /v1/external_bank_accounts/{external_bank_account_token}/retry_micro_deposits`, but is

0 commit comments

Comments
 (0)