Skip to content

Commit 66d5cd0

Browse files
feat(client): adds support for on-demand Auth Rule Performance Reports
1 parent 60e1dd1 commit 66d5cd0

100 files changed

Lines changed: 8887 additions & 2171 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 162
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-67859c948e3b903a317f4bd14135c7ee44254d2760068117bab34b7c4058be71.yml
3-
openapi_spec_hash: 23a4716c6168e96f040ac8575582d075
4-
config_hash: 227ad54062905d4ae964b24cef0505b0
1+
configured_endpoints: 165
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-a0d3bcd9c54616729a7e43847e3134205e0695d78f357cc7a25c2775b588dbbd.yml
3+
openapi_spec_hash: 36c423c286ca426f7510b27fadbdd66f
4+
config_hash: 56632a1c934324aa46c1e5c610c2de85

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
@@ -24,6 +24,7 @@ import com.lithic.api.services.blocking.EventService
2424
import com.lithic.api.services.blocking.ExternalBankAccountService
2525
import com.lithic.api.services.blocking.ExternalPaymentService
2626
import com.lithic.api.services.blocking.FinancialAccountService
27+
import com.lithic.api.services.blocking.FraudService
2728
import com.lithic.api.services.blocking.FundingEventService
2829
import com.lithic.api.services.blocking.ManagementOperationService
2930
import com.lithic.api.services.blocking.PaymentService
@@ -127,6 +128,8 @@ interface LithicClient {
127128

128129
fun fundingEvents(): FundingEventService
129130

131+
fun fraud(): FraudService
132+
130133
/** Status of api */
131134
fun apiStatus(): ApiStatus = apiStatus(ClientApiStatusParams.none())
132135

@@ -219,6 +222,8 @@ interface LithicClient {
219222

220223
fun fundingEvents(): FundingEventService.WithRawResponse
221224

225+
fun fraud(): FraudService.WithRawResponse
226+
222227
/**
223228
* Returns a raw HTTP response for `get /v1/status`, but is otherwise the same as
224229
* [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
@@ -23,6 +23,7 @@ import com.lithic.api.services.async.EventServiceAsync
2323
import com.lithic.api.services.async.ExternalBankAccountServiceAsync
2424
import com.lithic.api.services.async.ExternalPaymentServiceAsync
2525
import com.lithic.api.services.async.FinancialAccountServiceAsync
26+
import com.lithic.api.services.async.FraudServiceAsync
2627
import com.lithic.api.services.async.FundingEventServiceAsync
2728
import com.lithic.api.services.async.ManagementOperationServiceAsync
2829
import com.lithic.api.services.async.PaymentServiceAsync
@@ -127,6 +128,8 @@ interface LithicClientAsync {
127128

128129
fun fundingEvents(): FundingEventServiceAsync
129130

131+
fun fraud(): FraudServiceAsync
132+
130133
/** Status of api */
131134
fun apiStatus(): CompletableFuture<ApiStatus> = apiStatus(ClientApiStatusParams.none())
132135

@@ -222,6 +225,8 @@ interface LithicClientAsync {
222225

223226
fun fundingEvents(): FundingEventServiceAsync.WithRawResponse
224227

228+
fun fraud(): FraudServiceAsync.WithRawResponse
229+
225230
/**
226231
* Returns a raw HTTP response for `get /v1/status`, but is otherwise the same as
227232
* [LithicClientAsync.apiStatus].

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ import com.lithic.api.services.async.ExternalPaymentServiceAsync
4949
import com.lithic.api.services.async.ExternalPaymentServiceAsyncImpl
5050
import com.lithic.api.services.async.FinancialAccountServiceAsync
5151
import com.lithic.api.services.async.FinancialAccountServiceAsyncImpl
52+
import com.lithic.api.services.async.FraudServiceAsync
53+
import com.lithic.api.services.async.FraudServiceAsyncImpl
5254
import com.lithic.api.services.async.FundingEventServiceAsync
5355
import com.lithic.api.services.async.FundingEventServiceAsyncImpl
5456
import com.lithic.api.services.async.ManagementOperationServiceAsync
@@ -195,6 +197,10 @@ class LithicClientAsyncImpl(private val clientOptions: ClientOptions) : LithicCl
195197
FundingEventServiceAsyncImpl(clientOptionsWithUserAgent)
196198
}
197199

200+
private val fraud: FraudServiceAsync by lazy {
201+
FraudServiceAsyncImpl(clientOptionsWithUserAgent)
202+
}
203+
198204
override fun sync(): LithicClient = sync
199205

200206
override fun withRawResponse(): LithicClientAsync.WithRawResponse = withRawResponse
@@ -257,6 +263,8 @@ class LithicClientAsyncImpl(private val clientOptions: ClientOptions) : LithicCl
257263

258264
override fun fundingEvents(): FundingEventServiceAsync = fundingEvents
259265

266+
override fun fraud(): FraudServiceAsync = fraud
267+
260268
override fun apiStatus(
261269
params: ClientApiStatusParams,
262270
requestOptions: RequestOptions,
@@ -376,6 +384,10 @@ class LithicClientAsyncImpl(private val clientOptions: ClientOptions) : LithicCl
376384
FundingEventServiceAsyncImpl.WithRawResponseImpl(clientOptions)
377385
}
378386

387+
private val fraud: FraudServiceAsync.WithRawResponse by lazy {
388+
FraudServiceAsyncImpl.WithRawResponseImpl(clientOptions)
389+
}
390+
379391
override fun withOptions(
380392
modifier: Consumer<ClientOptions.Builder>
381393
): LithicClientAsync.WithRawResponse =
@@ -443,6 +455,8 @@ class LithicClientAsyncImpl(private val clientOptions: ClientOptions) : LithicCl
443455

444456
override fun fundingEvents(): FundingEventServiceAsync.WithRawResponse = fundingEvents
445457

458+
override fun fraud(): FraudServiceAsync.WithRawResponse = fraud
459+
446460
private val apiStatusHandler: Handler<ApiStatus> =
447461
jsonHandler<ApiStatus>(clientOptions.jsonMapper).withErrorHandler(errorHandler)
448462

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ import com.lithic.api.services.blocking.ExternalPaymentService
4949
import com.lithic.api.services.blocking.ExternalPaymentServiceImpl
5050
import com.lithic.api.services.blocking.FinancialAccountService
5151
import com.lithic.api.services.blocking.FinancialAccountServiceImpl
52+
import com.lithic.api.services.blocking.FraudService
53+
import com.lithic.api.services.blocking.FraudServiceImpl
5254
import com.lithic.api.services.blocking.FundingEventService
5355
import com.lithic.api.services.blocking.FundingEventServiceImpl
5456
import com.lithic.api.services.blocking.ManagementOperationService
@@ -180,6 +182,8 @@ class LithicClientImpl(private val clientOptions: ClientOptions) : LithicClient
180182
FundingEventServiceImpl(clientOptionsWithUserAgent)
181183
}
182184

185+
private val fraud: FraudService by lazy { FraudServiceImpl(clientOptionsWithUserAgent) }
186+
183187
override fun async(): LithicClientAsync = async
184188

185189
override fun withRawResponse(): LithicClient.WithRawResponse = withRawResponse
@@ -241,6 +245,8 @@ class LithicClientImpl(private val clientOptions: ClientOptions) : LithicClient
241245

242246
override fun fundingEvents(): FundingEventService = fundingEvents
243247

248+
override fun fraud(): FraudService = fraud
249+
244250
override fun apiStatus(
245251
params: ClientApiStatusParams,
246252
requestOptions: RequestOptions,
@@ -360,6 +366,10 @@ class LithicClientImpl(private val clientOptions: ClientOptions) : LithicClient
360366
FundingEventServiceImpl.WithRawResponseImpl(clientOptions)
361367
}
362368

369+
private val fraud: FraudService.WithRawResponse by lazy {
370+
FraudServiceImpl.WithRawResponseImpl(clientOptions)
371+
}
372+
363373
override fun withOptions(
364374
modifier: Consumer<ClientOptions.Builder>
365375
): LithicClient.WithRawResponse =
@@ -426,6 +436,8 @@ class LithicClientImpl(private val clientOptions: ClientOptions) : LithicClient
426436

427437
override fun fundingEvents(): FundingEventService.WithRawResponse = fundingEvents
428438

439+
override fun fraud(): FraudService.WithRawResponse = fraud
440+
429441
private val apiStatusHandler: Handler<ApiStatus> =
430442
jsonHandler<ApiStatus>(clientOptions.jsonMapper).withErrorHandler(errorHandler)
431443

lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2BacktestCreateParams.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ import kotlin.jvm.optionals.getOrNull
3636
* backtest reports on-demand through the
3737
* `/v2/auth_rules/{auth_rule_token}/backtests/{auth_rule_backtest_token}` endpoint.
3838
*
39-
* Lithic currently supports backtesting for `CONDITIONAL_BLOCK` rules. Backtesting for
40-
* `VELOCITY_LIMIT` rules is generally not supported. In specific cases (i.e. where Lithic has
41-
* pre-calculated the requested velocity metrics for historical transactions), a backtest may be
42-
* feasible. However, such cases are uncommon and customers should not anticipate support for
39+
* Lithic currently supports backtesting for `CONDITIONAL_BLOCK` / `CONDITIONAL_3DS_ACTION` rules.
40+
* Backtesting for `VELOCITY_LIMIT` rules is generally not supported. In specific cases (i.e. where
41+
* Lithic has pre-calculated the requested velocity metrics for historical transactions), a backtest
42+
* may be feasible. However, such cases are uncommon and customers should not anticipate support for
4343
* velocity backtests under most configurations. If a historical transaction does not feature the
4444
* required inputs to evaluate the rule, then it will not be included in the final backtest report.
4545
*/

lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2ReportParams.kt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ import java.util.Optional
1212
import kotlin.jvm.optionals.getOrNull
1313

1414
/**
15-
* Requests a performance report of an Auth rule to be asynchronously generated. Reports can only be
16-
* run on rules in draft or active mode and will included approved and declined statistics as well
17-
* as examples. The generated report will be delivered asynchronously through a webhook with
18-
* `event_type` = `auth_rules.performance_report.created`. See the docs on setting up
15+
* This endpoint is deprecated and will be removed in the future. Requests a performance report of
16+
* an Auth rule to be asynchronously generated. Reports can only be run on rules in draft or active
17+
* mode and will included approved and declined statistics as well as examples. The generated report
18+
* will be delivered asynchronously through a webhook with `event_type` =
19+
* `auth_rules.performance_report.created`. See the docs on setting up
1920
* [webhook subscriptions](https://docs.lithic.com/docs/events-api).
2021
*
2122
* Reports are generated based on data collected by Lithic's processing system in the trailing week.
@@ -55,6 +56,7 @@ import kotlin.jvm.optionals.getOrNull
5556
* processing systems have processed the transaction, and when a transaction will be included in the
5657
* report.
5758
*/
59+
@Deprecated("deprecated")
5860
class AuthRuleV2ReportParams
5961
private constructor(
6062
private val authRuleToken: String?,

0 commit comments

Comments
 (0)