Skip to content

Commit 8c85abd

Browse files
1 parent 9fa853d commit 8c85abd

36 files changed

Lines changed: 23794 additions & 18 deletions

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 167
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-aa089e65735b8884f8cb391b39b9a0b295819e438bf976c98cc6150628ca5488.yml
3-
openapi_spec_hash: 719876533d1496e9192c7a734a78c736
4-
config_hash: e9a46eb8acb9dc2c236f3e1958a1c4dd
1+
configured_endpoints: 169
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-529662462c00af160f74568fe26dbe576cf1fdc9f427e11bb1939bd8acdcb43f.yml
3+
openapi_spec_hash: a98631dfc66716d41ada4ddb199f7028
4+
config_hash: 2d501901f343d00775037fcec4121983

lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClient.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import com.lithic.api.core.RequestOptions
88
import com.lithic.api.core.http.HttpResponseFor
99
import com.lithic.api.models.ApiStatus
1010
import com.lithic.api.models.ClientApiStatusParams
11+
import com.lithic.api.services.blocking.AccountActivityService
1112
import com.lithic.api.services.blocking.AccountHolderService
1213
import com.lithic.api.services.blocking.AccountService
1314
import com.lithic.api.services.blocking.AggregateBalanceService
@@ -133,6 +134,8 @@ interface LithicClient {
133134

134135
fun networkPrograms(): NetworkProgramService
135136

137+
fun accountActivity(): AccountActivityService
138+
136139
/** Status of api */
137140
fun apiStatus(): ApiStatus = apiStatus(ClientApiStatusParams.none())
138141

@@ -229,6 +232,8 @@ interface LithicClient {
229232

230233
fun networkPrograms(): NetworkProgramService.WithRawResponse
231234

235+
fun accountActivity(): AccountActivityService.WithRawResponse
236+
232237
/**
233238
* Returns a raw HTTP response for `get /v1/status`, but is otherwise the same as
234239
* [LithicClient.apiStatus].

lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClientAsync.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import com.lithic.api.core.RequestOptions
77
import com.lithic.api.core.http.HttpResponseFor
88
import com.lithic.api.models.ApiStatus
99
import com.lithic.api.models.ClientApiStatusParams
10+
import com.lithic.api.services.async.AccountActivityServiceAsync
1011
import com.lithic.api.services.async.AccountHolderServiceAsync
1112
import com.lithic.api.services.async.AccountServiceAsync
1213
import com.lithic.api.services.async.AggregateBalanceServiceAsync
@@ -133,6 +134,8 @@ interface LithicClientAsync {
133134

134135
fun networkPrograms(): NetworkProgramServiceAsync
135136

137+
fun accountActivity(): AccountActivityServiceAsync
138+
136139
/** Status of api */
137140
fun apiStatus(): CompletableFuture<ApiStatus> = apiStatus(ClientApiStatusParams.none())
138141

@@ -232,6 +235,8 @@ interface LithicClientAsync {
232235

233236
fun networkPrograms(): NetworkProgramServiceAsync.WithRawResponse
234237

238+
fun accountActivity(): AccountActivityServiceAsync.WithRawResponse
239+
235240
/**
236241
* Returns a raw HTTP response for `get /v1/status`, but is otherwise the same as
237242
* [LithicClientAsync.apiStatus].

lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClientAsyncImpl.kt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ import com.lithic.api.core.http.parseable
1717
import com.lithic.api.core.prepareAsync
1818
import com.lithic.api.models.ApiStatus
1919
import com.lithic.api.models.ClientApiStatusParams
20+
import com.lithic.api.services.async.AccountActivityServiceAsync
21+
import com.lithic.api.services.async.AccountActivityServiceAsyncImpl
2022
import com.lithic.api.services.async.AccountHolderServiceAsync
2123
import com.lithic.api.services.async.AccountHolderServiceAsyncImpl
2224
import com.lithic.api.services.async.AccountServiceAsync
@@ -207,6 +209,10 @@ class LithicClientAsyncImpl(private val clientOptions: ClientOptions) : LithicCl
207209
NetworkProgramServiceAsyncImpl(clientOptionsWithUserAgent)
208210
}
209211

212+
private val accountActivity: AccountActivityServiceAsync by lazy {
213+
AccountActivityServiceAsyncImpl(clientOptionsWithUserAgent)
214+
}
215+
210216
override fun sync(): LithicClient = sync
211217

212218
override fun withRawResponse(): LithicClientAsync.WithRawResponse = withRawResponse
@@ -273,6 +279,8 @@ class LithicClientAsyncImpl(private val clientOptions: ClientOptions) : LithicCl
273279

274280
override fun networkPrograms(): NetworkProgramServiceAsync = networkPrograms
275281

282+
override fun accountActivity(): AccountActivityServiceAsync = accountActivity
283+
276284
override fun apiStatus(
277285
params: ClientApiStatusParams,
278286
requestOptions: RequestOptions,
@@ -401,6 +409,10 @@ class LithicClientAsyncImpl(private val clientOptions: ClientOptions) : LithicCl
401409
NetworkProgramServiceAsyncImpl.WithRawResponseImpl(clientOptions)
402410
}
403411

412+
private val accountActivity: AccountActivityServiceAsync.WithRawResponse by lazy {
413+
AccountActivityServiceAsyncImpl.WithRawResponseImpl(clientOptions)
414+
}
415+
404416
override fun withOptions(
405417
modifier: Consumer<ClientOptions.Builder>
406418
): LithicClientAsync.WithRawResponse =
@@ -472,6 +484,9 @@ class LithicClientAsyncImpl(private val clientOptions: ClientOptions) : LithicCl
472484

473485
override fun networkPrograms(): NetworkProgramServiceAsync.WithRawResponse = networkPrograms
474486

487+
override fun accountActivity(): AccountActivityServiceAsync.WithRawResponse =
488+
accountActivity
489+
475490
private val apiStatusHandler: Handler<ApiStatus> =
476491
jsonHandler<ApiStatus>(clientOptions.jsonMapper)
477492

lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClientImpl.kt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ import com.lithic.api.core.http.parseable
1717
import com.lithic.api.core.prepare
1818
import com.lithic.api.models.ApiStatus
1919
import com.lithic.api.models.ClientApiStatusParams
20+
import com.lithic.api.services.blocking.AccountActivityService
21+
import com.lithic.api.services.blocking.AccountActivityServiceImpl
2022
import com.lithic.api.services.blocking.AccountHolderService
2123
import com.lithic.api.services.blocking.AccountHolderServiceImpl
2224
import com.lithic.api.services.blocking.AccountService
@@ -190,6 +192,10 @@ class LithicClientImpl(private val clientOptions: ClientOptions) : LithicClient
190192
NetworkProgramServiceImpl(clientOptionsWithUserAgent)
191193
}
192194

195+
private val accountActivity: AccountActivityService by lazy {
196+
AccountActivityServiceImpl(clientOptionsWithUserAgent)
197+
}
198+
193199
override fun async(): LithicClientAsync = async
194200

195201
override fun withRawResponse(): LithicClient.WithRawResponse = withRawResponse
@@ -255,6 +261,8 @@ class LithicClientImpl(private val clientOptions: ClientOptions) : LithicClient
255261

256262
override fun networkPrograms(): NetworkProgramService = networkPrograms
257263

264+
override fun accountActivity(): AccountActivityService = accountActivity
265+
258266
override fun apiStatus(
259267
params: ClientApiStatusParams,
260268
requestOptions: RequestOptions,
@@ -383,6 +391,10 @@ class LithicClientImpl(private val clientOptions: ClientOptions) : LithicClient
383391
NetworkProgramServiceImpl.WithRawResponseImpl(clientOptions)
384392
}
385393

394+
private val accountActivity: AccountActivityService.WithRawResponse by lazy {
395+
AccountActivityServiceImpl.WithRawResponseImpl(clientOptions)
396+
}
397+
386398
override fun withOptions(
387399
modifier: Consumer<ClientOptions.Builder>
388400
): LithicClient.WithRawResponse =
@@ -453,6 +465,8 @@ class LithicClientImpl(private val clientOptions: ClientOptions) : LithicClient
453465

454466
override fun networkPrograms(): NetworkProgramService.WithRawResponse = networkPrograms
455467

468+
override fun accountActivity(): AccountActivityService.WithRawResponse = accountActivity
469+
456470
private val apiStatusHandler: Handler<ApiStatus> =
457471
jsonHandler<ApiStatus>(clientOptions.jsonMapper)
458472

Lines changed: 210 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,210 @@
1+
// File generated from our OpenAPI spec by Stainless.
2+
3+
package com.lithic.api.models
4+
5+
import com.lithic.api.core.AutoPager
6+
import com.lithic.api.core.Page
7+
import com.lithic.api.core.checkRequired
8+
import com.lithic.api.services.blocking.AccountActivityService
9+
import java.util.Objects
10+
import java.util.Optional
11+
import kotlin.jvm.optionals.getOrNull
12+
13+
/** @see AccountActivityService.list */
14+
class AccountActivityListPage
15+
private constructor(
16+
private val service: AccountActivityService,
17+
private val params: AccountActivityListParams,
18+
private val response: AccountActivityListPageResponse,
19+
) : Page<AccountActivityListResponse> {
20+
21+
/**
22+
* Delegates to [AccountActivityListPageResponse], but gracefully handles missing data.
23+
*
24+
* @see AccountActivityListPageResponse.data
25+
*/
26+
fun data(): List<AccountActivityListResponse> =
27+
response._data().getOptional("data").getOrNull() ?: emptyList()
28+
29+
/**
30+
* Delegates to [AccountActivityListPageResponse], but gracefully handles missing data.
31+
*
32+
* @see AccountActivityListPageResponse.hasMore
33+
*/
34+
fun hasMore(): Optional<Boolean> = response._hasMore().getOptional("has_more")
35+
36+
override fun items(): List<AccountActivityListResponse> = data()
37+
38+
override fun hasNextPage(): Boolean = items().isNotEmpty()
39+
40+
fun nextPageParams(): AccountActivityListParams =
41+
if (params.endingBefore().isPresent) {
42+
params
43+
.toBuilder()
44+
.endingBefore(
45+
items()
46+
.first()
47+
.accept(
48+
object : AccountActivityListResponse.Visitor<Optional<String>> {
49+
override fun visitFinancialTransaction(
50+
financialTransaction:
51+
AccountActivityListResponse.FinancialTransaction
52+
): Optional<String> =
53+
financialTransaction._token().getOptional("token")
54+
55+
override fun visitBookTransferTransaction(
56+
bookTransferTransaction:
57+
AccountActivityListResponse.BookTransferTransaction
58+
): Optional<String> =
59+
bookTransferTransaction._token().getOptional("token")
60+
61+
override fun visitCardTransaction(
62+
cardTransaction: AccountActivityListResponse.CardTransaction
63+
): Optional<String> = cardTransaction._token().getOptional("token")
64+
65+
override fun visitPaymentTransaction(
66+
paymentTransaction:
67+
AccountActivityListResponse.PaymentTransaction
68+
): Optional<String> =
69+
paymentTransaction._token().getOptional("token")
70+
71+
override fun visitExternalPayment(
72+
externalPayment: ExternalPayment
73+
): Optional<String> = externalPayment._token().getOptional("token")
74+
75+
override fun visitManagementOperationTransaction(
76+
managementOperationTransaction: ManagementOperationTransaction
77+
): Optional<String> =
78+
managementOperationTransaction._token().getOptional("token")
79+
}
80+
)
81+
)
82+
.build()
83+
} else {
84+
params
85+
.toBuilder()
86+
.startingAfter(
87+
items()
88+
.last()
89+
.accept(
90+
object : AccountActivityListResponse.Visitor<Optional<String>> {
91+
override fun visitFinancialTransaction(
92+
financialTransaction:
93+
AccountActivityListResponse.FinancialTransaction
94+
): Optional<String> =
95+
financialTransaction._token().getOptional("token")
96+
97+
override fun visitBookTransferTransaction(
98+
bookTransferTransaction:
99+
AccountActivityListResponse.BookTransferTransaction
100+
): Optional<String> =
101+
bookTransferTransaction._token().getOptional("token")
102+
103+
override fun visitCardTransaction(
104+
cardTransaction: AccountActivityListResponse.CardTransaction
105+
): Optional<String> = cardTransaction._token().getOptional("token")
106+
107+
override fun visitPaymentTransaction(
108+
paymentTransaction:
109+
AccountActivityListResponse.PaymentTransaction
110+
): Optional<String> =
111+
paymentTransaction._token().getOptional("token")
112+
113+
override fun visitExternalPayment(
114+
externalPayment: ExternalPayment
115+
): Optional<String> = externalPayment._token().getOptional("token")
116+
117+
override fun visitManagementOperationTransaction(
118+
managementOperationTransaction: ManagementOperationTransaction
119+
): Optional<String> =
120+
managementOperationTransaction._token().getOptional("token")
121+
}
122+
)
123+
)
124+
.build()
125+
}
126+
127+
override fun nextPage(): AccountActivityListPage = service.list(nextPageParams())
128+
129+
fun autoPager(): AutoPager<AccountActivityListResponse> = AutoPager.from(this)
130+
131+
/** The parameters that were used to request this page. */
132+
fun params(): AccountActivityListParams = params
133+
134+
/** The response that this page was parsed from. */
135+
fun response(): AccountActivityListPageResponse = response
136+
137+
fun toBuilder() = Builder().from(this)
138+
139+
companion object {
140+
141+
/**
142+
* Returns a mutable builder for constructing an instance of [AccountActivityListPage].
143+
*
144+
* The following fields are required:
145+
* ```java
146+
* .service()
147+
* .params()
148+
* .response()
149+
* ```
150+
*/
151+
@JvmStatic fun builder() = Builder()
152+
}
153+
154+
/** A builder for [AccountActivityListPage]. */
155+
class Builder internal constructor() {
156+
157+
private var service: AccountActivityService? = null
158+
private var params: AccountActivityListParams? = null
159+
private var response: AccountActivityListPageResponse? = null
160+
161+
@JvmSynthetic
162+
internal fun from(accountActivityListPage: AccountActivityListPage) = apply {
163+
service = accountActivityListPage.service
164+
params = accountActivityListPage.params
165+
response = accountActivityListPage.response
166+
}
167+
168+
fun service(service: AccountActivityService) = apply { this.service = service }
169+
170+
/** The parameters that were used to request this page. */
171+
fun params(params: AccountActivityListParams) = apply { this.params = params }
172+
173+
/** The response that this page was parsed from. */
174+
fun response(response: AccountActivityListPageResponse) = apply { this.response = response }
175+
176+
/**
177+
* Returns an immutable instance of [AccountActivityListPage].
178+
*
179+
* Further updates to this [Builder] will not mutate the returned instance.
180+
*
181+
* The following fields are required:
182+
* ```java
183+
* .service()
184+
* .params()
185+
* .response()
186+
* ```
187+
*
188+
* @throws IllegalStateException if any required field is unset.
189+
*/
190+
fun build(): AccountActivityListPage =
191+
AccountActivityListPage(
192+
checkRequired("service", service),
193+
checkRequired("params", params),
194+
checkRequired("response", response),
195+
)
196+
}
197+
198+
override fun equals(other: Any?): Boolean {
199+
if (this === other) {
200+
return true
201+
}
202+
203+
return /* spotless:off */ other is AccountActivityListPage && service == other.service && params == other.params && response == other.response /* spotless:on */
204+
}
205+
206+
override fun hashCode(): Int = /* spotless:off */ Objects.hash(service, params, response) /* spotless:on */
207+
208+
override fun toString() =
209+
"AccountActivityListPage{service=$service, params=$params, response=$response}"
210+
}

0 commit comments

Comments
 (0)