Skip to content

Commit 81c2860

Browse files
feat(client): adds support for on-demand Auth Rule Performance Reports
1 parent ae16686 commit 81c2860

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

@@ -734,3 +737,18 @@ Methods:
734737
- <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>
735738
- <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>
736739
- <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>
740+
741+
# Fraud
742+
743+
## Transactions
744+
745+
Types:
746+
747+
```python
748+
from lithic.types.fraud import TransactionRetrieveResponse, TransactionReportResponse
749+
```
750+
751+
Methods:
752+
753+
- <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>
754+
- <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,
@@ -70,6 +71,7 @@
7071
from .resources.disputes import Disputes, AsyncDisputes
7172
from .resources.payments import Payments, AsyncPayments
7273
from .resources.cards.cards import Cards, AsyncCards
74+
from .resources.fraud.fraud import Fraud, AsyncFraud
7375
from .resources.card_programs import CardPrograms, AsyncCardPrograms
7476
from .resources.events.events import Events, AsyncEvents
7577
from .resources.tokenizations import Tokenizations, AsyncTokenizations
@@ -352,6 +354,12 @@ def webhooks(self) -> webhooks.Webhooks:
352354

353355
return Webhooks(self)
354356

357+
@cached_property
358+
def fraud(self) -> Fraud:
359+
from .resources.fraud import Fraud
360+
361+
return Fraud(self)
362+
355363
@cached_property
356364
def with_raw_response(self) -> LithicWithRawResponse:
357365
return LithicWithRawResponse(self)
@@ -726,6 +734,12 @@ def funding_events(self) -> AsyncFundingEvents:
726734

727735
return AsyncFundingEvents(self)
728736

737+
@cached_property
738+
def fraud(self) -> AsyncFraud:
739+
from .resources.fraud import AsyncFraud
740+
741+
return AsyncFraud(self)
742+
729743
@cached_property
730744
def webhooks(self) -> webhooks.AsyncWebhooks:
731745
from .resources.webhooks import AsyncWebhooks
@@ -1029,6 +1043,12 @@ def funding_events(self) -> funding_events.FundingEventsWithRawResponse:
10291043

10301044
return FundingEventsWithRawResponse(self._client.funding_events)
10311045

1046+
@cached_property
1047+
def fraud(self) -> fraud.FraudWithRawResponse:
1048+
from .resources.fraud import FraudWithRawResponse
1049+
1050+
return FraudWithRawResponse(self._client.fraud)
1051+
10321052

10331053
class AsyncLithicWithRawResponse:
10341054
_client: AsyncLithic
@@ -1190,6 +1210,12 @@ def funding_events(self) -> funding_events.AsyncFundingEventsWithRawResponse:
11901210

11911211
return AsyncFundingEventsWithRawResponse(self._client.funding_events)
11921212

1213+
@cached_property
1214+
def fraud(self) -> fraud.AsyncFraudWithRawResponse:
1215+
from .resources.fraud import AsyncFraudWithRawResponse
1216+
1217+
return AsyncFraudWithRawResponse(self._client.fraud)
1218+
11931219

11941220
class LithicWithStreamedResponse:
11951221
_client: Lithic
@@ -1351,6 +1377,12 @@ def funding_events(self) -> funding_events.FundingEventsWithStreamingResponse:
13511377

13521378
return FundingEventsWithStreamingResponse(self._client.funding_events)
13531379

1380+
@cached_property
1381+
def fraud(self) -> fraud.FraudWithStreamingResponse:
1382+
from .resources.fraud import FraudWithStreamingResponse
1383+
1384+
return FraudWithStreamingResponse(self._client.fraud)
1385+
13541386

13551387
class AsyncLithicWithStreamedResponse:
13561388
_client: AsyncLithic
@@ -1512,6 +1544,12 @@ def funding_events(self) -> funding_events.AsyncFundingEventsWithStreamingRespon
15121544

15131545
return AsyncFundingEventsWithStreamingResponse(self._client.funding_events)
15141546

1547+
@cached_property
1548+
def fraud(self) -> fraud.AsyncFraudWithStreamingResponse:
1549+
from .resources.fraud import AsyncFraudWithStreamingResponse
1550+
1551+
return AsyncFraudWithStreamingResponse(self._client.fraud)
1552+
15151553

15161554
Client = Lithic
15171555

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,
@@ -355,4 +363,10 @@
355363
"AsyncFundingEventsWithRawResponse",
356364
"FundingEventsWithStreamingResponse",
357365
"AsyncFundingEventsWithStreamingResponse",
366+
"Fraud",
367+
"AsyncFraud",
368+
"FraudWithRawResponse",
369+
"AsyncFraudWithRawResponse",
370+
"FraudWithStreamingResponse",
371+
"AsyncFraudWithStreamingResponse",
358372
]

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)