Skip to content

Commit dc9becd

Browse files
feat(api): support event_streams in auth_rules list endpoint
1 parent 7c4676a commit dc9becd

File tree

8 files changed

+36
-71
lines changed

8 files changed

+36
-71
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 175
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-abe6a4f82f696099fa8ecb1cc44f08979e17d56578ae7ea68b0e9182e21df508.yml
33
openapi_spec_hash: d2ce51592a9a234c6f34a1168a31f91f
4-
config_hash: ba3fbfc99a1b8635d9e79e9e49d12952
4+
config_hash: 739714a3fead0b26ee3a3b7bc51081f6

api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ from lithic.types.auth_rules import (
9191
ConditionalOperation,
9292
ConditionalTokenizationActionParameters,
9393
ConditionalValue,
94+
EventStream,
9495
MerchantLockParameters,
9596
RuleStats,
9697
VelocityLimitParams,

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

Lines changed: 14 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
from ....pagination import SyncCursorPage, AsyncCursorPage
2626
from ...._base_client import AsyncPaginator, make_request_options
2727
from ....types.auth_rules import (
28+
EventStream,
2829
v2_list_params,
2930
v2_draft_params,
3031
v2_create_params,
@@ -33,6 +34,7 @@
3334
v2_retrieve_features_params,
3435
)
3536
from ....types.auth_rules.auth_rule import AuthRule
37+
from ....types.auth_rules.event_stream import EventStream
3638
from ....types.auth_rules.v2_retrieve_report_response import V2RetrieveReportResponse
3739
from ....types.auth_rules.v2_retrieve_features_response import V2RetrieveFeaturesResponse
3840

@@ -71,10 +73,7 @@ def create(
7173
type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT", "MERCHANT_LOCK", "CONDITIONAL_ACTION"],
7274
account_tokens: SequenceNotStr[str] | Omit = omit,
7375
business_account_tokens: SequenceNotStr[str] | Omit = omit,
74-
event_stream: Literal[
75-
"AUTHORIZATION", "THREE_DS_AUTHENTICATION", "TOKENIZATION", "ACH_CREDIT_RECEIPT", "ACH_DEBIT_RECEIPT"
76-
]
77-
| Omit = omit,
76+
event_stream: EventStream | Omit = omit,
7877
name: Optional[str] | Omit = omit,
7978
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
8079
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -125,10 +124,7 @@ def create(
125124
card_tokens: SequenceNotStr[str],
126125
parameters: v2_create_params.CardLevelRuleParameters,
127126
type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT", "MERCHANT_LOCK", "CONDITIONAL_ACTION"],
128-
event_stream: Literal[
129-
"AUTHORIZATION", "THREE_DS_AUTHENTICATION", "TOKENIZATION", "ACH_CREDIT_RECEIPT", "ACH_DEBIT_RECEIPT"
130-
]
131-
| Omit = omit,
127+
event_stream: EventStream | Omit = omit,
132128
name: Optional[str] | Omit = omit,
133129
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
134130
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -177,10 +173,7 @@ def create(
177173
parameters: v2_create_params.ProgramLevelRuleParameters,
178174
program_level: bool,
179175
type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT", "MERCHANT_LOCK", "CONDITIONAL_ACTION"],
180-
event_stream: Literal[
181-
"AUTHORIZATION", "THREE_DS_AUTHENTICATION", "TOKENIZATION", "ACH_CREDIT_RECEIPT", "ACH_DEBIT_RECEIPT"
182-
]
183-
| Omit = omit,
176+
event_stream: EventStream | Omit = omit,
184177
excluded_card_tokens: SequenceNotStr[str] | Omit = omit,
185178
name: Optional[str] | Omit = omit,
186179
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -237,10 +230,7 @@ def create(
237230
type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT", "MERCHANT_LOCK", "CONDITIONAL_ACTION"],
238231
account_tokens: SequenceNotStr[str] | Omit = omit,
239232
business_account_tokens: SequenceNotStr[str] | Omit = omit,
240-
event_stream: Literal[
241-
"AUTHORIZATION", "THREE_DS_AUTHENTICATION", "TOKENIZATION", "ACH_CREDIT_RECEIPT", "ACH_DEBIT_RECEIPT"
242-
]
243-
| Omit = omit,
233+
event_stream: EventStream | Omit = omit,
244234
name: Optional[str] | Omit = omit,
245235
card_tokens: SequenceNotStr[str] | Omit = omit,
246236
program_level: bool | Omit = omit,
@@ -489,16 +479,8 @@ def list(
489479
business_account_token: str | Omit = omit,
490480
card_token: str | Omit = omit,
491481
ending_before: str | Omit = omit,
492-
event_stream: Literal[
493-
"AUTHORIZATION", "THREE_DS_AUTHENTICATION", "TOKENIZATION", "ACH_CREDIT_RECEIPT", "ACH_DEBIT_RECEIPT"
494-
]
495-
| Omit = omit,
496-
event_streams: List[
497-
Literal[
498-
"AUTHORIZATION", "THREE_DS_AUTHENTICATION", "TOKENIZATION", "ACH_CREDIT_RECEIPT", "ACH_DEBIT_RECEIPT"
499-
]
500-
]
501-
| Omit = omit,
482+
event_stream: EventStream | Omit = omit,
483+
event_streams: List[EventStream] | Omit = omit,
502484
page_size: int | Omit = omit,
503485
scope: Literal["PROGRAM", "ACCOUNT", "BUSINESS_ACCOUNT", "CARD", "ANY"] | Omit = omit,
504486
starting_after: str | Omit = omit,
@@ -824,10 +806,7 @@ async def create(
824806
type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT", "MERCHANT_LOCK", "CONDITIONAL_ACTION"],
825807
account_tokens: SequenceNotStr[str] | Omit = omit,
826808
business_account_tokens: SequenceNotStr[str] | Omit = omit,
827-
event_stream: Literal[
828-
"AUTHORIZATION", "THREE_DS_AUTHENTICATION", "TOKENIZATION", "ACH_CREDIT_RECEIPT", "ACH_DEBIT_RECEIPT"
829-
]
830-
| Omit = omit,
809+
event_stream: EventStream | Omit = omit,
831810
name: Optional[str] | Omit = omit,
832811
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
833812
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -878,10 +857,7 @@ async def create(
878857
card_tokens: SequenceNotStr[str],
879858
parameters: v2_create_params.CardLevelRuleParameters,
880859
type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT", "MERCHANT_LOCK", "CONDITIONAL_ACTION"],
881-
event_stream: Literal[
882-
"AUTHORIZATION", "THREE_DS_AUTHENTICATION", "TOKENIZATION", "ACH_CREDIT_RECEIPT", "ACH_DEBIT_RECEIPT"
883-
]
884-
| Omit = omit,
860+
event_stream: EventStream | Omit = omit,
885861
name: Optional[str] | Omit = omit,
886862
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
887863
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -930,10 +906,7 @@ async def create(
930906
parameters: v2_create_params.ProgramLevelRuleParameters,
931907
program_level: bool,
932908
type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT", "MERCHANT_LOCK", "CONDITIONAL_ACTION"],
933-
event_stream: Literal[
934-
"AUTHORIZATION", "THREE_DS_AUTHENTICATION", "TOKENIZATION", "ACH_CREDIT_RECEIPT", "ACH_DEBIT_RECEIPT"
935-
]
936-
| Omit = omit,
909+
event_stream: EventStream | Omit = omit,
937910
excluded_card_tokens: SequenceNotStr[str] | Omit = omit,
938911
name: Optional[str] | Omit = omit,
939912
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -990,10 +963,7 @@ async def create(
990963
type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT", "MERCHANT_LOCK", "CONDITIONAL_ACTION"],
991964
account_tokens: SequenceNotStr[str] | Omit = omit,
992965
business_account_tokens: SequenceNotStr[str] | Omit = omit,
993-
event_stream: Literal[
994-
"AUTHORIZATION", "THREE_DS_AUTHENTICATION", "TOKENIZATION", "ACH_CREDIT_RECEIPT", "ACH_DEBIT_RECEIPT"
995-
]
996-
| Omit = omit,
966+
event_stream: EventStream | Omit = omit,
997967
name: Optional[str] | Omit = omit,
998968
card_tokens: SequenceNotStr[str] | Omit = omit,
999969
program_level: bool | Omit = omit,
@@ -1242,16 +1212,8 @@ def list(
12421212
business_account_token: str | Omit = omit,
12431213
card_token: str | Omit = omit,
12441214
ending_before: str | Omit = omit,
1245-
event_stream: Literal[
1246-
"AUTHORIZATION", "THREE_DS_AUTHENTICATION", "TOKENIZATION", "ACH_CREDIT_RECEIPT", "ACH_DEBIT_RECEIPT"
1247-
]
1248-
| Omit = omit,
1249-
event_streams: List[
1250-
Literal[
1251-
"AUTHORIZATION", "THREE_DS_AUTHENTICATION", "TOKENIZATION", "ACH_CREDIT_RECEIPT", "ACH_DEBIT_RECEIPT"
1252-
]
1253-
]
1254-
| Omit = omit,
1215+
event_stream: EventStream | Omit = omit,
1216+
event_streams: List[EventStream] | Omit = omit,
12551217
page_size: int | Omit = omit,
12561218
scope: Literal["PROGRAM", "ACCOUNT", "BUSINESS_ACCOUNT", "CARD", "ANY"] | Omit = omit,
12571219
starting_after: str | Omit = omit,

src/lithic/types/auth_rules/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
from .auth_rule import AuthRule as AuthRule
66
from .rule_stats import RuleStats as RuleStats
7+
from .event_stream import EventStream as EventStream
78
from .v2_list_params import V2ListParams as V2ListParams
89
from .v2_draft_params import V2DraftParams as V2DraftParams
910
from .v2_create_params import V2CreateParams as V2CreateParams

src/lithic/types/auth_rules/auth_rule.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from typing_extensions import Literal, TypeAlias
55

66
from ..._models import BaseModel
7+
from .event_stream import EventStream
78
from .velocity_limit_params import VelocityLimitParams
89
from .merchant_lock_parameters import MerchantLockParameters
910
from .conditional_block_parameters import ConditionalBlockParameters
@@ -75,9 +76,7 @@ class AuthRule(BaseModel):
7576

7677
draft_version: Optional[DraftVersion] = None
7778

78-
event_stream: Literal[
79-
"AUTHORIZATION", "THREE_DS_AUTHENTICATION", "TOKENIZATION", "ACH_CREDIT_RECEIPT", "ACH_DEBIT_RECEIPT"
80-
]
79+
event_stream: EventStream
8180
"""The event stream during which the rule will be evaluated."""
8281

8382
lithic_managed: bool
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from typing_extensions import Literal, TypeAlias
4+
5+
__all__ = ["EventStream"]
6+
7+
EventStream: TypeAlias = Literal[
8+
"AUTHORIZATION", "THREE_DS_AUTHENTICATION", "TOKENIZATION", "ACH_CREDIT_RECEIPT", "ACH_DEBIT_RECEIPT"
9+
]

src/lithic/types/auth_rules/v2_create_params.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from typing_extensions import Literal, Required, TypeAlias, TypedDict
77

88
from ..._types import SequenceNotStr
9+
from .event_stream import EventStream
910
from .velocity_limit_params_param import VelocityLimitParamsParam
1011
from .merchant_lock_parameters_param import MerchantLockParametersParam
1112
from .conditional_block_parameters_param import ConditionalBlockParametersParam
@@ -49,9 +50,7 @@ class AccountLevelRule(TypedDict, total=False):
4950
business_account_tokens: SequenceNotStr[str]
5051
"""Business Account tokens to which the Auth Rule applies."""
5152

52-
event_stream: Literal[
53-
"AUTHORIZATION", "THREE_DS_AUTHENTICATION", "TOKENIZATION", "ACH_CREDIT_RECEIPT", "ACH_DEBIT_RECEIPT"
54-
]
53+
event_stream: EventStream
5554
"""The event stream during which the rule will be evaluated."""
5655

5756
name: Optional[str]
@@ -90,9 +89,7 @@ class CardLevelRule(TypedDict, total=False):
9089
ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
9190
"""
9291

93-
event_stream: Literal[
94-
"AUTHORIZATION", "THREE_DS_AUTHENTICATION", "TOKENIZATION", "ACH_CREDIT_RECEIPT", "ACH_DEBIT_RECEIPT"
95-
]
92+
event_stream: EventStream
9693
"""The event stream during which the rule will be evaluated."""
9794

9895
name: Optional[str]
@@ -131,9 +128,7 @@ class ProgramLevelRule(TypedDict, total=False):
131128
ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
132129
"""
133130

134-
event_stream: Literal[
135-
"AUTHORIZATION", "THREE_DS_AUTHENTICATION", "TOKENIZATION", "ACH_CREDIT_RECEIPT", "ACH_DEBIT_RECEIPT"
136-
]
131+
event_stream: EventStream
137132
"""The event stream during which the rule will be evaluated."""
138133

139134
excluded_card_tokens: SequenceNotStr[str]

src/lithic/types/auth_rules/v2_list_params.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
from typing import List
66
from typing_extensions import Literal, TypedDict
77

8+
from .event_stream import EventStream
9+
810
__all__ = ["V2ListParams"]
911

1012

@@ -24,17 +26,13 @@ class V2ListParams(TypedDict, total=False):
2426
Used to retrieve the previous page of results before this item.
2527
"""
2628

27-
event_stream: Literal[
28-
"AUTHORIZATION", "THREE_DS_AUTHENTICATION", "TOKENIZATION", "ACH_CREDIT_RECEIPT", "ACH_DEBIT_RECEIPT"
29-
]
29+
event_stream: EventStream
3030
"""Deprecated: Use event_streams instead.
3131
3232
Only return Auth rules that are executed during the provided event stream.
3333
"""
3434

35-
event_streams: List[
36-
Literal["AUTHORIZATION", "THREE_DS_AUTHENTICATION", "TOKENIZATION", "ACH_CREDIT_RECEIPT", "ACH_DEBIT_RECEIPT"]
37-
]
35+
event_streams: List[EventStream]
3836
"""
3937
Only return Auth rules that are executed during any of the provided event
4038
streams. If event_streams and event_stream are specified, the values will be

0 commit comments

Comments
 (0)