Skip to content

Commit 8f79c34

Browse files
feat(client): adds support for on-demand Auth Rule Performance Reports
1 parent eb21b79 commit 8f79c34

Some content is hidden

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

44 files changed

+2015
-321
lines changed

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 161
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: 164
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

api.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ from lithic.types.auth_rules import (
8383
AuthRuleCondition,
8484
ConditionalAttribute,
8585
ConditionalBlockParameters,
86+
RuleStats,
8687
VelocityLimitParams,
8788
VelocityLimitParamsPeriodWindow,
8889
V2CreateResponse,
@@ -93,6 +94,7 @@ from lithic.types.auth_rules import (
9394
V2DraftResponse,
9495
V2PromoteResponse,
9596
V2ReportResponse,
97+
V2RetrieveReportResponse,
9698
)
9799
```
98100

@@ -107,6 +109,7 @@ Methods:
107109
- <code title="post /v2/auth_rules/{auth_rule_token}/draft">client.auth_rules.v2.<a href="./src/lithic/resources/auth_rules/v2/v2.py">draft</a>(auth_rule_token, \*\*<a href="src/lithic/types/auth_rules/v2_draft_params.py">params</a>) -> <a href="./src/lithic/types/auth_rules/v2_draft_response.py">V2DraftResponse</a></code>
108110
- <code title="post /v2/auth_rules/{auth_rule_token}/promote">client.auth_rules.v2.<a href="./src/lithic/resources/auth_rules/v2/v2.py">promote</a>(auth_rule_token) -> <a href="./src/lithic/types/auth_rules/v2_promote_response.py">V2PromoteResponse</a></code>
109111
- <code title="post /v2/auth_rules/{auth_rule_token}/report">client.auth_rules.v2.<a href="./src/lithic/resources/auth_rules/v2/v2.py">report</a>(auth_rule_token) -> <a href="./src/lithic/types/auth_rules/v2_report_response.py">V2ReportResponse</a></code>
112+
- <code title="get /v2/auth_rules/{auth_rule_token}/report">client.auth_rules.v2.<a href="./src/lithic/resources/auth_rules/v2/v2.py">retrieve_report</a>(auth_rule_token, \*\*<a href="src/lithic/types/auth_rules/v2_retrieve_report_params.py">params</a>) -> <a href="./src/lithic/types/auth_rules/v2_retrieve_report_response.py">V2RetrieveReportResponse</a></code>
110113

111114
### Backtests
112115

@@ -723,3 +726,18 @@ Methods:
723726
- <code title="get /v1/funding_events/{funding_event_token}">client.funding_events.<a href="./src/lithic/resources/funding_events.py">retrieve</a>(funding_event_token) -> <a href="./src/lithic/types/funding_event_retrieve_response.py">FundingEventRetrieveResponse</a></code>
724727
- <code title="get /v1/funding_events">client.funding_events.<a href="./src/lithic/resources/funding_events.py">list</a>(\*\*<a href="src/lithic/types/funding_event_list_params.py">params</a>) -> <a href="./src/lithic/types/funding_event_list_response.py">SyncCursorPage[FundingEventListResponse]</a></code>
725728
- <code title="get /v1/funding_events/{funding_event_token}/details">client.funding_events.<a href="./src/lithic/resources/funding_events.py">retrieve_details</a>(funding_event_token) -> <a href="./src/lithic/types/funding_event_retrieve_details_response.py">FundingEventRetrieveDetailsResponse</a></code>
729+
730+
# Fraud
731+
732+
## Transactions
733+
734+
Types:
735+
736+
```python
737+
from lithic.types.fraud import TransactionRetrieveResponse, TransactionReportResponse
738+
```
739+
740+
Methods:
741+
742+
- <code title="get /v1/fraud/transactions/{transaction_token}">client.fraud.transactions.<a href="./src/lithic/resources/fraud/transactions.py">retrieve</a>(transaction_token) -> <a href="./src/lithic/types/fraud/transaction_retrieve_response.py">TransactionRetrieveResponse</a></code>
743+
- <code title="post /v1/fraud/transactions/{transaction_token}">client.fraud.transactions.<a href="./src/lithic/resources/fraud/transactions.py">report</a>(transaction_token, \*\*<a href="src/lithic/types/fraud/transaction_report_params.py">params</a>) -> <a href="./src/lithic/types/fraud/transaction_report_response.py">TransactionReportResponse</a></code>

src/lithic/_client.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
if TYPE_CHECKING:
4040
from .resources import (
4141
cards,
42+
fraud,
4243
events,
4344
reports,
4445
accounts,
@@ -69,6 +70,7 @@
6970
from .resources.disputes import Disputes, AsyncDisputes
7071
from .resources.payments import Payments, AsyncPayments
7172
from .resources.cards.cards import Cards, AsyncCards
73+
from .resources.fraud.fraud import Fraud, AsyncFraud
7274
from .resources.card_programs import CardPrograms, AsyncCardPrograms
7375
from .resources.events.events import Events, AsyncEvents
7476
from .resources.tokenizations import Tokenizations, AsyncTokenizations
@@ -345,6 +347,12 @@ def funding_events(self) -> FundingEvents:
345347

346348
return FundingEvents(self)
347349

350+
@cached_property
351+
def fraud(self) -> Fraud:
352+
from .resources.fraud import Fraud
353+
354+
return Fraud(self)
355+
348356
@cached_property
349357
def with_raw_response(self) -> LithicWithRawResponse:
350358
return LithicWithRawResponse(self)
@@ -719,6 +727,12 @@ def funding_events(self) -> AsyncFundingEvents:
719727

720728
return AsyncFundingEvents(self)
721729

730+
@cached_property
731+
def fraud(self) -> AsyncFraud:
732+
from .resources.fraud import AsyncFraud
733+
734+
return AsyncFraud(self)
735+
722736
@cached_property
723737
def with_raw_response(self) -> AsyncLithicWithRawResponse:
724738
return AsyncLithicWithRawResponse(self)
@@ -1016,6 +1030,12 @@ def funding_events(self) -> funding_events.FundingEventsWithRawResponse:
10161030

10171031
return FundingEventsWithRawResponse(self._client.funding_events)
10181032

1033+
@cached_property
1034+
def fraud(self) -> fraud.FraudWithRawResponse:
1035+
from .resources.fraud import FraudWithRawResponse
1036+
1037+
return FraudWithRawResponse(self._client.fraud)
1038+
10191039

10201040
class AsyncLithicWithRawResponse:
10211041
_client: AsyncLithic
@@ -1177,6 +1197,12 @@ def funding_events(self) -> funding_events.AsyncFundingEventsWithRawResponse:
11771197

11781198
return AsyncFundingEventsWithRawResponse(self._client.funding_events)
11791199

1200+
@cached_property
1201+
def fraud(self) -> fraud.AsyncFraudWithRawResponse:
1202+
from .resources.fraud import AsyncFraudWithRawResponse
1203+
1204+
return AsyncFraudWithRawResponse(self._client.fraud)
1205+
11801206

11811207
class LithicWithStreamedResponse:
11821208
_client: Lithic
@@ -1338,6 +1364,12 @@ def funding_events(self) -> funding_events.FundingEventsWithStreamingResponse:
13381364

13391365
return FundingEventsWithStreamingResponse(self._client.funding_events)
13401366

1367+
@cached_property
1368+
def fraud(self) -> fraud.FraudWithStreamingResponse:
1369+
from .resources.fraud import FraudWithStreamingResponse
1370+
1371+
return FraudWithStreamingResponse(self._client.fraud)
1372+
13411373

13421374
class AsyncLithicWithStreamedResponse:
13431375
_client: AsyncLithic
@@ -1499,6 +1531,12 @@ def funding_events(self) -> funding_events.AsyncFundingEventsWithStreamingRespon
14991531

15001532
return AsyncFundingEventsWithStreamingResponse(self._client.funding_events)
15011533

1534+
@cached_property
1535+
def fraud(self) -> fraud.AsyncFraudWithStreamingResponse:
1536+
from .resources.fraud import AsyncFraudWithStreamingResponse
1537+
1538+
return AsyncFraudWithStreamingResponse(self._client.fraud)
1539+
15021540

15031541
Client = Lithic
15041542

src/lithic/resources/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@
88
CardsWithStreamingResponse,
99
AsyncCardsWithStreamingResponse,
1010
)
11+
from .fraud import (
12+
Fraud,
13+
AsyncFraud,
14+
FraudWithRawResponse,
15+
AsyncFraudWithRawResponse,
16+
FraudWithStreamingResponse,
17+
AsyncFraudWithStreamingResponse,
18+
)
1119
from .events import (
1220
Events,
1321
AsyncEvents,
@@ -352,4 +360,10 @@
352360
"AsyncFundingEventsWithRawResponse",
353361
"FundingEventsWithStreamingResponse",
354362
"AsyncFundingEventsWithStreamingResponse",
363+
"Fraud",
364+
"AsyncFraud",
365+
"FraudWithRawResponse",
366+
"AsyncFraudWithRawResponse",
367+
"FraudWithStreamingResponse",
368+
"AsyncFraudWithStreamingResponse",
355369
]

src/lithic/resources/auth_rules/v2/backtests.py

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,14 @@ def create(
7272
`/v2/auth_rules/{auth_rule_token}/backtests/{auth_rule_backtest_token}`
7373
endpoint.
7474
75-
Lithic currently supports backtesting for `CONDITIONAL_BLOCK` rules. Backtesting
76-
for `VELOCITY_LIMIT` rules is generally not supported. In specific cases (i.e.
77-
where Lithic has pre-calculated the requested velocity metrics for historical
78-
transactions), a backtest may be feasible. However, such cases are uncommon and
79-
customers should not anticipate support for velocity backtests under most
80-
configurations. If a historical transaction does not feature the required inputs
81-
to evaluate the rule, then it will not be included in the final backtest report.
75+
Lithic currently supports backtesting for `CONDITIONAL_BLOCK` /
76+
`CONDITIONAL_3DS_ACTION` rules. Backtesting for `VELOCITY_LIMIT` rules is
77+
generally not supported. In specific cases (i.e. where Lithic has pre-calculated
78+
the requested velocity metrics for historical transactions), a backtest may be
79+
feasible. However, such cases are uncommon and customers should not anticipate
80+
support for velocity backtests under most configurations. If a historical
81+
transaction does not feature the required inputs to evaluate the rule, then it
82+
will not be included in the final backtest report.
8283
8384
Args:
8485
end: The end time of the backtest.
@@ -217,13 +218,14 @@ async def create(
217218
`/v2/auth_rules/{auth_rule_token}/backtests/{auth_rule_backtest_token}`
218219
endpoint.
219220
220-
Lithic currently supports backtesting for `CONDITIONAL_BLOCK` rules. Backtesting
221-
for `VELOCITY_LIMIT` rules is generally not supported. In specific cases (i.e.
222-
where Lithic has pre-calculated the requested velocity metrics for historical
223-
transactions), a backtest may be feasible. However, such cases are uncommon and
224-
customers should not anticipate support for velocity backtests under most
225-
configurations. If a historical transaction does not feature the required inputs
226-
to evaluate the rule, then it will not be included in the final backtest report.
221+
Lithic currently supports backtesting for `CONDITIONAL_BLOCK` /
222+
`CONDITIONAL_3DS_ACTION` rules. Backtesting for `VELOCITY_LIMIT` rules is
223+
generally not supported. In specific cases (i.e. where Lithic has pre-calculated
224+
the requested velocity metrics for historical transactions), a backtest may be
225+
feasible. However, such cases are uncommon and customers should not anticipate
226+
support for velocity backtests under most configurations. If a historical
227+
transaction does not feature the required inputs to evaluate the rule, then it
228+
will not be included in the final backtest report.
227229
228230
Args:
229231
end: The end time of the backtest.

0 commit comments

Comments
 (0)