diff --git a/.release-please-manifest.json b/.release-please-manifest.json index d34cd697..47dd76c1 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.83.0" + ".": "0.84.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 8d78762c..d831e60e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1 +1 @@ -configured_endpoints: 152 +configured_endpoints: 153 diff --git a/CHANGELOG.md b/CHANGELOG.md index 4dc8439b..e43a2d28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.84.0 (2025-01-28) + +Full Changelog: [v0.83.0...v0.84.0](https://github.com/lithic-com/lithic-python/compare/v0.83.0...v0.84.0) + +### Features + +* **api:** adds additional request types for updating an Auth Rule ([#685](https://github.com/lithic-com/lithic-python/issues/685)) ([ed36107](https://github.com/lithic-com/lithic-python/commit/ed36107a5fa860fa1a87dfb73d58966759624b29)) + ## 0.83.0 (2025-01-24) Full Changelog: [v0.82.0...v0.83.0](https://github.com/lithic-com/lithic-python/compare/v0.82.0...v0.83.0) diff --git a/api.md b/api.md index 04131b90..cce3a50e 100644 --- a/api.md +++ b/api.md @@ -100,6 +100,7 @@ Methods: - client.auth_rules.v2.retrieve(auth_rule_token) -> V2RetrieveResponse - client.auth_rules.v2.update(auth_rule_token, \*\*params) -> V2UpdateResponse - client.auth_rules.v2.list(\*\*params) -> SyncCursorPage[V2ListResponse] +- client.auth_rules.v2.delete(auth_rule_token) -> None - client.auth_rules.v2.apply(auth_rule_token, \*\*params) -> V2ApplyResponse - client.auth_rules.v2.draft(auth_rule_token, \*\*params) -> V2DraftResponse - client.auth_rules.v2.promote(auth_rule_token) -> V2PromoteResponse diff --git a/pyproject.toml b/pyproject.toml index 50b0f9ab..edb049dd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "lithic" -version = "0.83.0" +version = "0.84.0" description = "The official Python library for the lithic API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/lithic/_version.py b/src/lithic/_version.py index 8b510cb6..c83f7b7a 100644 --- a/src/lithic/_version.py +++ b/src/lithic/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "lithic" -__version__ = "0.83.0" # x-release-please-version +__version__ = "0.84.0" # x-release-please-version diff --git a/src/lithic/resources/auth_rules/v2/v2.py b/src/lithic/resources/auth_rules/v2/v2.py index c91af684..f2539db9 100644 --- a/src/lithic/resources/auth_rules/v2/v2.py +++ b/src/lithic/resources/auth_rules/v2/v2.py @@ -8,7 +8,7 @@ import httpx from .... import _legacy_response -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven from ...._utils import ( required_args, maybe_transform, @@ -87,7 +87,7 @@ def create( name: Auth Rule Name - parameters: Parameters for the current version of the Auth Rule + parameters: Parameters for the Auth Rule type: The type of Auth Rule @@ -124,7 +124,7 @@ def create( name: Auth Rule Name - parameters: Parameters for the current version of the Auth Rule + parameters: Parameters for the Auth Rule type: The type of Auth Rule @@ -164,7 +164,7 @@ def create( name: Auth Rule Name - parameters: Parameters for the current version of the Auth Rule + parameters: Parameters for the Auth Rule type: The type of Auth Rule @@ -228,7 +228,7 @@ def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> V2RetrieveResponse: """ - Fetches an authorization rule by its token + Fetches a V2 authorization rule by its token Args: extra_headers: Send extra headers @@ -249,10 +249,12 @@ def retrieve( cast_to=V2RetrieveResponse, ) + @overload def update( self, auth_rule_token: str, *, + account_tokens: List[str] | NotGiven = NOT_GIVEN, name: Optional[str] | NotGiven = NOT_GIVEN, state: Literal["INACTIVE"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -263,9 +265,15 @@ def update( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> V2UpdateResponse: """ - Updates an authorization rule's properties + Updates a V2 authorization rule's properties + + If `account_tokens`, `card_tokens`, `program_level`, or `excluded_card_tokens` + is provided, this will replace existing associations with the provided list of + entities. Args: + account_tokens: Account tokens to which the Auth Rule applies. + name: Auth Rule Name state: The desired state of the Auth Rule. @@ -282,14 +290,126 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @overload + def update( + self, + auth_rule_token: str, + *, + card_tokens: List[str] | NotGiven = NOT_GIVEN, + name: Optional[str] | NotGiven = NOT_GIVEN, + state: Literal["INACTIVE"] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> V2UpdateResponse: + """ + Updates a V2 authorization rule's properties + + If `account_tokens`, `card_tokens`, `program_level`, or `excluded_card_tokens` + is provided, this will replace existing associations with the provided list of + entities. + + Args: + card_tokens: Card tokens to which the Auth Rule applies. + + name: Auth Rule Name + + state: The desired state of the Auth Rule. + + Note that only deactivating an Auth Rule through this endpoint is supported at + this time. If you need to (re-)activate an Auth Rule the /promote endpoint + should be used to promote a draft to the currently active version. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def update( + self, + auth_rule_token: str, + *, + excluded_card_tokens: List[str] | NotGiven = NOT_GIVEN, + name: Optional[str] | NotGiven = NOT_GIVEN, + program_level: bool | NotGiven = NOT_GIVEN, + state: Literal["INACTIVE"] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> V2UpdateResponse: + """ + Updates a V2 authorization rule's properties + + If `account_tokens`, `card_tokens`, `program_level`, or `excluded_card_tokens` + is provided, this will replace existing associations with the provided list of + entities. + + Args: + excluded_card_tokens: Card tokens to which the Auth Rule does not apply. + + name: Auth Rule Name + + program_level: Whether the Auth Rule applies to all authorizations on the card program. + + state: The desired state of the Auth Rule. + + Note that only deactivating an Auth Rule through this endpoint is supported at + this time. If you need to (re-)activate an Auth Rule the /promote endpoint + should be used to promote a draft to the currently active version. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + def update( + self, + auth_rule_token: str, + *, + account_tokens: List[str] | NotGiven = NOT_GIVEN, + name: Optional[str] | NotGiven = NOT_GIVEN, + state: Literal["INACTIVE"] | NotGiven = NOT_GIVEN, + card_tokens: List[str] | NotGiven = NOT_GIVEN, + excluded_card_tokens: List[str] | NotGiven = NOT_GIVEN, + program_level: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> V2UpdateResponse: if not auth_rule_token: raise ValueError(f"Expected a non-empty value for `auth_rule_token` but received {auth_rule_token!r}") return self._patch( f"/v2/auth_rules/{auth_rule_token}", body=maybe_transform( { + "account_tokens": account_tokens, "name": name, "state": state, + "card_tokens": card_tokens, + "excluded_card_tokens": excluded_card_tokens, + "program_level": program_level, }, v2_update_params.V2UpdateParams, ), @@ -360,6 +480,39 @@ def list( model=V2ListResponse, ) + def delete( + self, + auth_rule_token: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> None: + """ + Deletes a V2 authorization rule + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not auth_rule_token: + raise ValueError(f"Expected a non-empty value for `auth_rule_token` but received {auth_rule_token!r}") + return self._delete( + f"/v2/auth_rules/{auth_rule_token}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=NoneType, + ) + @overload def apply( self, @@ -374,11 +527,10 @@ def apply( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> V2ApplyResponse: """ - Associates an authorization rules with a card program, the provided account(s) + Associates a V2 authorization rule with a card program, the provided account(s) or card(s). - This endpoint will replace any existing associations with the provided list of - entities. + Prefer using the `PATCH` method for this operation. Args: account_tokens: Account tokens to which the Auth Rule applies. @@ -407,11 +559,10 @@ def apply( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> V2ApplyResponse: """ - Associates an authorization rules with a card program, the provided account(s) + Associates a V2 authorization rule with a card program, the provided account(s) or card(s). - This endpoint will replace any existing associations with the provided list of - entities. + Prefer using the `PATCH` method for this operation. Args: card_tokens: Card tokens to which the Auth Rule applies. @@ -441,11 +592,10 @@ def apply( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> V2ApplyResponse: """ - Associates an authorization rules with a card program, the provided account(s) + Associates a V2 authorization rule with a card program, the provided account(s) or card(s). - This endpoint will replace any existing associations with the provided list of - entities. + Prefer using the `PATCH` method for this operation. Args: program_level: Whether the Auth Rule applies to all authorizations on the card program. @@ -510,14 +660,13 @@ def draft( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> V2DraftResponse: """ - Creates a new draft version of an authorization rules that will be ran in shadow - mode. + Creates a new draft version of a rule that will be ran in shadow mode. This can also be utilized to reset the draft parameters, causing a draft version to no longer be ran in shadow mode. Args: - parameters: Parameters for the current version of the Auth Rule + parameters: Parameters for the Auth Rule extra_headers: Send extra headers @@ -550,7 +699,7 @@ def promote( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> V2PromoteResponse: """ - Promotes a draft version of an authorization rule to the currently active + Promotes the draft version of an authorization rule to the currently active version such that it is enforced in the authorization stream. Args: @@ -703,7 +852,7 @@ async def create( name: Auth Rule Name - parameters: Parameters for the current version of the Auth Rule + parameters: Parameters for the Auth Rule type: The type of Auth Rule @@ -740,7 +889,7 @@ async def create( name: Auth Rule Name - parameters: Parameters for the current version of the Auth Rule + parameters: Parameters for the Auth Rule type: The type of Auth Rule @@ -780,7 +929,7 @@ async def create( name: Auth Rule Name - parameters: Parameters for the current version of the Auth Rule + parameters: Parameters for the Auth Rule type: The type of Auth Rule @@ -844,7 +993,7 @@ async def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> V2RetrieveResponse: """ - Fetches an authorization rule by its token + Fetches a V2 authorization rule by its token Args: extra_headers: Send extra headers @@ -865,10 +1014,55 @@ async def retrieve( cast_to=V2RetrieveResponse, ) + @overload + async def update( + self, + auth_rule_token: str, + *, + account_tokens: List[str] | NotGiven = NOT_GIVEN, + name: Optional[str] | NotGiven = NOT_GIVEN, + state: Literal["INACTIVE"] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> V2UpdateResponse: + """ + Updates a V2 authorization rule's properties + + If `account_tokens`, `card_tokens`, `program_level`, or `excluded_card_tokens` + is provided, this will replace existing associations with the provided list of + entities. + + Args: + account_tokens: Account tokens to which the Auth Rule applies. + + name: Auth Rule Name + + state: The desired state of the Auth Rule. + + Note that only deactivating an Auth Rule through this endpoint is supported at + this time. If you need to (re-)activate an Auth Rule the /promote endpoint + should be used to promote a draft to the currently active version. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload async def update( self, auth_rule_token: str, *, + card_tokens: List[str] | NotGiven = NOT_GIVEN, name: Optional[str] | NotGiven = NOT_GIVEN, state: Literal["INACTIVE"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -879,9 +1073,15 @@ async def update( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> V2UpdateResponse: """ - Updates an authorization rule's properties + Updates a V2 authorization rule's properties + + If `account_tokens`, `card_tokens`, `program_level`, or `excluded_card_tokens` + is provided, this will replace existing associations with the provided list of + entities. Args: + card_tokens: Card tokens to which the Auth Rule applies. + name: Auth Rule Name state: The desired state of the Auth Rule. @@ -898,14 +1098,83 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @overload + async def update( + self, + auth_rule_token: str, + *, + excluded_card_tokens: List[str] | NotGiven = NOT_GIVEN, + name: Optional[str] | NotGiven = NOT_GIVEN, + program_level: bool | NotGiven = NOT_GIVEN, + state: Literal["INACTIVE"] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> V2UpdateResponse: + """ + Updates a V2 authorization rule's properties + + If `account_tokens`, `card_tokens`, `program_level`, or `excluded_card_tokens` + is provided, this will replace existing associations with the provided list of + entities. + + Args: + excluded_card_tokens: Card tokens to which the Auth Rule does not apply. + + name: Auth Rule Name + + program_level: Whether the Auth Rule applies to all authorizations on the card program. + + state: The desired state of the Auth Rule. + + Note that only deactivating an Auth Rule through this endpoint is supported at + this time. If you need to (re-)activate an Auth Rule the /promote endpoint + should be used to promote a draft to the currently active version. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + async def update( + self, + auth_rule_token: str, + *, + account_tokens: List[str] | NotGiven = NOT_GIVEN, + name: Optional[str] | NotGiven = NOT_GIVEN, + state: Literal["INACTIVE"] | NotGiven = NOT_GIVEN, + card_tokens: List[str] | NotGiven = NOT_GIVEN, + excluded_card_tokens: List[str] | NotGiven = NOT_GIVEN, + program_level: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> V2UpdateResponse: if not auth_rule_token: raise ValueError(f"Expected a non-empty value for `auth_rule_token` but received {auth_rule_token!r}") return await self._patch( f"/v2/auth_rules/{auth_rule_token}", body=await async_maybe_transform( { + "account_tokens": account_tokens, "name": name, "state": state, + "card_tokens": card_tokens, + "excluded_card_tokens": excluded_card_tokens, + "program_level": program_level, }, v2_update_params.V2UpdateParams, ), @@ -976,6 +1245,39 @@ def list( model=V2ListResponse, ) + async def delete( + self, + auth_rule_token: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> None: + """ + Deletes a V2 authorization rule + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not auth_rule_token: + raise ValueError(f"Expected a non-empty value for `auth_rule_token` but received {auth_rule_token!r}") + return await self._delete( + f"/v2/auth_rules/{auth_rule_token}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=NoneType, + ) + @overload async def apply( self, @@ -990,11 +1292,10 @@ async def apply( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> V2ApplyResponse: """ - Associates an authorization rules with a card program, the provided account(s) + Associates a V2 authorization rule with a card program, the provided account(s) or card(s). - This endpoint will replace any existing associations with the provided list of - entities. + Prefer using the `PATCH` method for this operation. Args: account_tokens: Account tokens to which the Auth Rule applies. @@ -1023,11 +1324,10 @@ async def apply( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> V2ApplyResponse: """ - Associates an authorization rules with a card program, the provided account(s) + Associates a V2 authorization rule with a card program, the provided account(s) or card(s). - This endpoint will replace any existing associations with the provided list of - entities. + Prefer using the `PATCH` method for this operation. Args: card_tokens: Card tokens to which the Auth Rule applies. @@ -1057,11 +1357,10 @@ async def apply( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> V2ApplyResponse: """ - Associates an authorization rules with a card program, the provided account(s) + Associates a V2 authorization rule with a card program, the provided account(s) or card(s). - This endpoint will replace any existing associations with the provided list of - entities. + Prefer using the `PATCH` method for this operation. Args: program_level: Whether the Auth Rule applies to all authorizations on the card program. @@ -1126,14 +1425,13 @@ async def draft( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> V2DraftResponse: """ - Creates a new draft version of an authorization rules that will be ran in shadow - mode. + Creates a new draft version of a rule that will be ran in shadow mode. This can also be utilized to reset the draft parameters, causing a draft version to no longer be ran in shadow mode. Args: - parameters: Parameters for the current version of the Auth Rule + parameters: Parameters for the Auth Rule extra_headers: Send extra headers @@ -1166,7 +1464,7 @@ async def promote( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> V2PromoteResponse: """ - Promotes a draft version of an authorization rule to the currently active + Promotes the draft version of an authorization rule to the currently active version such that it is enforced in the authorization stream. Args: @@ -1288,6 +1586,9 @@ def __init__(self, v2: V2) -> None: self.list = _legacy_response.to_raw_response_wrapper( v2.list, ) + self.delete = _legacy_response.to_raw_response_wrapper( + v2.delete, + ) self.apply = _legacy_response.to_raw_response_wrapper( v2.apply, ) @@ -1322,6 +1623,9 @@ def __init__(self, v2: AsyncV2) -> None: self.list = _legacy_response.async_to_raw_response_wrapper( v2.list, ) + self.delete = _legacy_response.async_to_raw_response_wrapper( + v2.delete, + ) self.apply = _legacy_response.async_to_raw_response_wrapper( v2.apply, ) @@ -1356,6 +1660,9 @@ def __init__(self, v2: V2) -> None: self.list = to_streamed_response_wrapper( v2.list, ) + self.delete = to_streamed_response_wrapper( + v2.delete, + ) self.apply = to_streamed_response_wrapper( v2.apply, ) @@ -1390,6 +1697,9 @@ def __init__(self, v2: AsyncV2) -> None: self.list = async_to_streamed_response_wrapper( v2.list, ) + self.delete = async_to_streamed_response_wrapper( + v2.delete, + ) self.apply = async_to_streamed_response_wrapper( v2.apply, ) diff --git a/src/lithic/types/auth_rules/v2_apply_response.py b/src/lithic/types/auth_rules/v2_apply_response.py index 3373531e..153c3d2b 100644 --- a/src/lithic/types/auth_rules/v2_apply_response.py +++ b/src/lithic/types/auth_rules/v2_apply_response.py @@ -14,7 +14,7 @@ class CurrentVersion(BaseModel): parameters: CurrentVersionParameters - """Parameters for the current version of the Auth Rule""" + """Parameters for the Auth Rule""" version: int """ @@ -28,7 +28,7 @@ class CurrentVersion(BaseModel): class DraftVersion(BaseModel): parameters: DraftVersionParameters - """Parameters for the current version of the Auth Rule""" + """Parameters for the Auth Rule""" version: int """ diff --git a/src/lithic/types/auth_rules/v2_create_params.py b/src/lithic/types/auth_rules/v2_create_params.py index debec500..dff961f4 100644 --- a/src/lithic/types/auth_rules/v2_create_params.py +++ b/src/lithic/types/auth_rules/v2_create_params.py @@ -27,7 +27,7 @@ class CreateAuthRuleRequestAccountTokens(TypedDict, total=False): """Auth Rule Name""" parameters: CreateAuthRuleRequestAccountTokensParameters - """Parameters for the current version of the Auth Rule""" + """Parameters for the Auth Rule""" type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT"] """The type of Auth Rule""" @@ -46,7 +46,7 @@ class CreateAuthRuleRequestCardTokens(TypedDict, total=False): """Auth Rule Name""" parameters: CreateAuthRuleRequestCardTokensParameters - """Parameters for the current version of the Auth Rule""" + """Parameters for the Auth Rule""" type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT"] """The type of Auth Rule""" @@ -66,7 +66,7 @@ class CreateAuthRuleRequestProgramLevel(TypedDict, total=False): """Auth Rule Name""" parameters: CreateAuthRuleRequestProgramLevelParameters - """Parameters for the current version of the Auth Rule""" + """Parameters for the Auth Rule""" type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT"] """The type of Auth Rule""" diff --git a/src/lithic/types/auth_rules/v2_create_response.py b/src/lithic/types/auth_rules/v2_create_response.py index 19dbf95b..b2078622 100644 --- a/src/lithic/types/auth_rules/v2_create_response.py +++ b/src/lithic/types/auth_rules/v2_create_response.py @@ -14,7 +14,7 @@ class CurrentVersion(BaseModel): parameters: CurrentVersionParameters - """Parameters for the current version of the Auth Rule""" + """Parameters for the Auth Rule""" version: int """ @@ -28,7 +28,7 @@ class CurrentVersion(BaseModel): class DraftVersion(BaseModel): parameters: DraftVersionParameters - """Parameters for the current version of the Auth Rule""" + """Parameters for the Auth Rule""" version: int """ diff --git a/src/lithic/types/auth_rules/v2_draft_params.py b/src/lithic/types/auth_rules/v2_draft_params.py index e9fbc503..5d7a5559 100644 --- a/src/lithic/types/auth_rules/v2_draft_params.py +++ b/src/lithic/types/auth_rules/v2_draft_params.py @@ -13,7 +13,7 @@ class V2DraftParams(TypedDict, total=False): parameters: Optional[Parameters] - """Parameters for the current version of the Auth Rule""" + """Parameters for the Auth Rule""" Parameters: TypeAlias = Union[ConditionalBlockParametersParam, VelocityLimitParamsParam] diff --git a/src/lithic/types/auth_rules/v2_draft_response.py b/src/lithic/types/auth_rules/v2_draft_response.py index 4bdabd23..4226de04 100644 --- a/src/lithic/types/auth_rules/v2_draft_response.py +++ b/src/lithic/types/auth_rules/v2_draft_response.py @@ -14,7 +14,7 @@ class CurrentVersion(BaseModel): parameters: CurrentVersionParameters - """Parameters for the current version of the Auth Rule""" + """Parameters for the Auth Rule""" version: int """ @@ -28,7 +28,7 @@ class CurrentVersion(BaseModel): class DraftVersion(BaseModel): parameters: DraftVersionParameters - """Parameters for the current version of the Auth Rule""" + """Parameters for the Auth Rule""" version: int """ diff --git a/src/lithic/types/auth_rules/v2_list_response.py b/src/lithic/types/auth_rules/v2_list_response.py index 3336fed9..d1039175 100644 --- a/src/lithic/types/auth_rules/v2_list_response.py +++ b/src/lithic/types/auth_rules/v2_list_response.py @@ -14,7 +14,7 @@ class CurrentVersion(BaseModel): parameters: CurrentVersionParameters - """Parameters for the current version of the Auth Rule""" + """Parameters for the Auth Rule""" version: int """ @@ -28,7 +28,7 @@ class CurrentVersion(BaseModel): class DraftVersion(BaseModel): parameters: DraftVersionParameters - """Parameters for the current version of the Auth Rule""" + """Parameters for the Auth Rule""" version: int """ diff --git a/src/lithic/types/auth_rules/v2_promote_response.py b/src/lithic/types/auth_rules/v2_promote_response.py index ff79c7d0..53c27487 100644 --- a/src/lithic/types/auth_rules/v2_promote_response.py +++ b/src/lithic/types/auth_rules/v2_promote_response.py @@ -14,7 +14,7 @@ class CurrentVersion(BaseModel): parameters: CurrentVersionParameters - """Parameters for the current version of the Auth Rule""" + """Parameters for the Auth Rule""" version: int """ @@ -28,7 +28,7 @@ class CurrentVersion(BaseModel): class DraftVersion(BaseModel): parameters: DraftVersionParameters - """Parameters for the current version of the Auth Rule""" + """Parameters for the Auth Rule""" version: int """ diff --git a/src/lithic/types/auth_rules/v2_retrieve_response.py b/src/lithic/types/auth_rules/v2_retrieve_response.py index 6b04411d..c4793dcc 100644 --- a/src/lithic/types/auth_rules/v2_retrieve_response.py +++ b/src/lithic/types/auth_rules/v2_retrieve_response.py @@ -14,7 +14,7 @@ class CurrentVersion(BaseModel): parameters: CurrentVersionParameters - """Parameters for the current version of the Auth Rule""" + """Parameters for the Auth Rule""" version: int """ @@ -28,7 +28,7 @@ class CurrentVersion(BaseModel): class DraftVersion(BaseModel): parameters: DraftVersionParameters - """Parameters for the current version of the Auth Rule""" + """Parameters for the Auth Rule""" version: int """ diff --git a/src/lithic/types/auth_rules/v2_update_params.py b/src/lithic/types/auth_rules/v2_update_params.py index 0ebf71ca..042cf558 100644 --- a/src/lithic/types/auth_rules/v2_update_params.py +++ b/src/lithic/types/auth_rules/v2_update_params.py @@ -2,16 +2,54 @@ from __future__ import annotations -from typing import Optional -from typing_extensions import Literal, TypedDict +from typing import List, Union, Optional +from typing_extensions import Literal, TypeAlias, TypedDict -__all__ = ["V2UpdateParams"] +__all__ = ["V2UpdateParams", "AccountLevelRule", "CardLevelRule", "ProgramLevelRule"] -class V2UpdateParams(TypedDict, total=False): +class AccountLevelRule(TypedDict, total=False): + account_tokens: List[str] + """Account tokens to which the Auth Rule applies.""" + + name: Optional[str] + """Auth Rule Name""" + + state: Literal["INACTIVE"] + """The desired state of the Auth Rule. + + Note that only deactivating an Auth Rule through this endpoint is supported at + this time. If you need to (re-)activate an Auth Rule the /promote endpoint + should be used to promote a draft to the currently active version. + """ + + +class CardLevelRule(TypedDict, total=False): + card_tokens: List[str] + """Card tokens to which the Auth Rule applies.""" + + name: Optional[str] + """Auth Rule Name""" + + state: Literal["INACTIVE"] + """The desired state of the Auth Rule. + + Note that only deactivating an Auth Rule through this endpoint is supported at + this time. If you need to (re-)activate an Auth Rule the /promote endpoint + should be used to promote a draft to the currently active version. + """ + + +class ProgramLevelRule(TypedDict, total=False): + excluded_card_tokens: List[str] + """Card tokens to which the Auth Rule does not apply.""" + name: Optional[str] """Auth Rule Name""" + program_level: bool + """Whether the Auth Rule applies to all authorizations on the card program.""" + state: Literal["INACTIVE"] """The desired state of the Auth Rule. @@ -19,3 +57,6 @@ class V2UpdateParams(TypedDict, total=False): this time. If you need to (re-)activate an Auth Rule the /promote endpoint should be used to promote a draft to the currently active version. """ + + +V2UpdateParams: TypeAlias = Union[AccountLevelRule, CardLevelRule, ProgramLevelRule] diff --git a/src/lithic/types/auth_rules/v2_update_response.py b/src/lithic/types/auth_rules/v2_update_response.py index 5bda15ed..e5a5456f 100644 --- a/src/lithic/types/auth_rules/v2_update_response.py +++ b/src/lithic/types/auth_rules/v2_update_response.py @@ -14,7 +14,7 @@ class CurrentVersion(BaseModel): parameters: CurrentVersionParameters - """Parameters for the current version of the Auth Rule""" + """Parameters for the Auth Rule""" version: int """ @@ -28,7 +28,7 @@ class CurrentVersion(BaseModel): class DraftVersion(BaseModel): parameters: DraftVersionParameters - """Parameters for the current version of the Auth Rule""" + """Parameters for the Auth Rule""" version: int """ diff --git a/src/lithic/types/auth_rules/velocity_limit_params.py b/src/lithic/types/auth_rules/velocity_limit_params.py index 413a34e2..cc7a4589 100644 --- a/src/lithic/types/auth_rules/velocity_limit_params.py +++ b/src/lithic/types/auth_rules/velocity_limit_params.py @@ -31,7 +31,8 @@ class VelocityLimitParams(BaseModel): period: Union[int, VelocityLimitParamsPeriodWindow] """The size of the trailing window to calculate Spend Velocity over in seconds. - The minimum value is 10 seconds, and the maximum value is 2678400 seconds. + The minimum value is 10 seconds, and the maximum value is 2678400 seconds (31 + days). """ scope: Literal["CARD", "ACCOUNT"] diff --git a/src/lithic/types/auth_rules/velocity_limit_params_param.py b/src/lithic/types/auth_rules/velocity_limit_params_param.py index 3599c9d6..0893ffe1 100644 --- a/src/lithic/types/auth_rules/velocity_limit_params_param.py +++ b/src/lithic/types/auth_rules/velocity_limit_params_param.py @@ -32,7 +32,8 @@ class VelocityLimitParamsParam(TypedDict, total=False): period: Required[Union[int, VelocityLimitParamsPeriodWindow]] """The size of the trailing window to calculate Spend Velocity over in seconds. - The minimum value is 10 seconds, and the maximum value is 2678400 seconds. + The minimum value is 10 seconds, and the maximum value is 2678400 seconds (31 + days). """ scope: Required[Literal["CARD", "ACCOUNT"]] diff --git a/tests/api_resources/auth_rules/test_v2.py b/tests/api_resources/auth_rules/test_v2.py index c105059b..0f7e7bb6 100644 --- a/tests/api_resources/auth_rules/test_v2.py +++ b/tests/api_resources/auth_rules/test_v2.py @@ -214,23 +214,72 @@ def test_path_params_retrieve(self, client: Lithic) -> None: ) @parametrize - def test_method_update(self, client: Lithic) -> None: + def test_method_update_overload_1(self, client: Lithic) -> None: v2 = client.auth_rules.v2.update( auth_rule_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) assert_matches_type(V2UpdateResponse, v2, path=["response"]) @parametrize - def test_method_update_with_all_params(self, client: Lithic) -> None: + def test_method_update_with_all_params_overload_1(self, client: Lithic) -> None: v2 = client.auth_rules.v2.update( auth_rule_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_tokens=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + name="name", + state="INACTIVE", + ) + assert_matches_type(V2UpdateResponse, v2, path=["response"]) + + @parametrize + def test_raw_response_update_overload_1(self, client: Lithic) -> None: + response = client.auth_rules.v2.with_raw_response.update( + auth_rule_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + v2 = response.parse() + assert_matches_type(V2UpdateResponse, v2, path=["response"]) + + @parametrize + def test_streaming_response_update_overload_1(self, client: Lithic) -> None: + with client.auth_rules.v2.with_streaming_response.update( + auth_rule_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + v2 = response.parse() + assert_matches_type(V2UpdateResponse, v2, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_update_overload_1(self, client: Lithic) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `auth_rule_token` but received ''"): + client.auth_rules.v2.with_raw_response.update( + auth_rule_token="", + ) + + @parametrize + def test_method_update_overload_2(self, client: Lithic) -> None: + v2 = client.auth_rules.v2.update( + auth_rule_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + assert_matches_type(V2UpdateResponse, v2, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_2(self, client: Lithic) -> None: + v2 = client.auth_rules.v2.update( + auth_rule_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + card_tokens=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], name="name", state="INACTIVE", ) assert_matches_type(V2UpdateResponse, v2, path=["response"]) @parametrize - def test_raw_response_update(self, client: Lithic) -> None: + def test_raw_response_update_overload_2(self, client: Lithic) -> None: response = client.auth_rules.v2.with_raw_response.update( auth_rule_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) @@ -241,7 +290,7 @@ def test_raw_response_update(self, client: Lithic) -> None: assert_matches_type(V2UpdateResponse, v2, path=["response"]) @parametrize - def test_streaming_response_update(self, client: Lithic) -> None: + def test_streaming_response_update_overload_2(self, client: Lithic) -> None: with client.auth_rules.v2.with_streaming_response.update( auth_rule_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) as response: @@ -254,7 +303,56 @@ def test_streaming_response_update(self, client: Lithic) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_update(self, client: Lithic) -> None: + def test_path_params_update_overload_2(self, client: Lithic) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `auth_rule_token` but received ''"): + client.auth_rules.v2.with_raw_response.update( + auth_rule_token="", + ) + + @parametrize + def test_method_update_overload_3(self, client: Lithic) -> None: + v2 = client.auth_rules.v2.update( + auth_rule_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + assert_matches_type(V2UpdateResponse, v2, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_3(self, client: Lithic) -> None: + v2 = client.auth_rules.v2.update( + auth_rule_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + excluded_card_tokens=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + name="name", + program_level=True, + state="INACTIVE", + ) + assert_matches_type(V2UpdateResponse, v2, path=["response"]) + + @parametrize + def test_raw_response_update_overload_3(self, client: Lithic) -> None: + response = client.auth_rules.v2.with_raw_response.update( + auth_rule_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + v2 = response.parse() + assert_matches_type(V2UpdateResponse, v2, path=["response"]) + + @parametrize + def test_streaming_response_update_overload_3(self, client: Lithic) -> None: + with client.auth_rules.v2.with_streaming_response.update( + auth_rule_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + v2 = response.parse() + assert_matches_type(V2UpdateResponse, v2, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_update_overload_3(self, client: Lithic) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `auth_rule_token` but received ''"): client.auth_rules.v2.with_raw_response.update( auth_rule_token="", @@ -296,6 +394,44 @@ def test_streaming_response_list(self, client: Lithic) -> None: assert cast(Any, response.is_closed) is True + @parametrize + def test_method_delete(self, client: Lithic) -> None: + v2 = client.auth_rules.v2.delete( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + assert v2 is None + + @parametrize + def test_raw_response_delete(self, client: Lithic) -> None: + response = client.auth_rules.v2.with_raw_response.delete( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + v2 = response.parse() + assert v2 is None + + @parametrize + def test_streaming_response_delete(self, client: Lithic) -> None: + with client.auth_rules.v2.with_streaming_response.delete( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + v2 = response.parse() + assert v2 is None + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_delete(self, client: Lithic) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `auth_rule_token` but received ''"): + client.auth_rules.v2.with_raw_response.delete( + "", + ) + @parametrize def test_method_apply_overload_1(self, client: Lithic) -> None: v2 = client.auth_rules.v2.apply( @@ -752,23 +888,72 @@ async def test_path_params_retrieve(self, async_client: AsyncLithic) -> None: ) @parametrize - async def test_method_update(self, async_client: AsyncLithic) -> None: + async def test_method_update_overload_1(self, async_client: AsyncLithic) -> None: v2 = await async_client.auth_rules.v2.update( auth_rule_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) assert_matches_type(V2UpdateResponse, v2, path=["response"]) @parametrize - async def test_method_update_with_all_params(self, async_client: AsyncLithic) -> None: + async def test_method_update_with_all_params_overload_1(self, async_client: AsyncLithic) -> None: v2 = await async_client.auth_rules.v2.update( auth_rule_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_tokens=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + name="name", + state="INACTIVE", + ) + assert_matches_type(V2UpdateResponse, v2, path=["response"]) + + @parametrize + async def test_raw_response_update_overload_1(self, async_client: AsyncLithic) -> None: + response = await async_client.auth_rules.v2.with_raw_response.update( + auth_rule_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + v2 = response.parse() + assert_matches_type(V2UpdateResponse, v2, path=["response"]) + + @parametrize + async def test_streaming_response_update_overload_1(self, async_client: AsyncLithic) -> None: + async with async_client.auth_rules.v2.with_streaming_response.update( + auth_rule_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + v2 = await response.parse() + assert_matches_type(V2UpdateResponse, v2, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_update_overload_1(self, async_client: AsyncLithic) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `auth_rule_token` but received ''"): + await async_client.auth_rules.v2.with_raw_response.update( + auth_rule_token="", + ) + + @parametrize + async def test_method_update_overload_2(self, async_client: AsyncLithic) -> None: + v2 = await async_client.auth_rules.v2.update( + auth_rule_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + assert_matches_type(V2UpdateResponse, v2, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_2(self, async_client: AsyncLithic) -> None: + v2 = await async_client.auth_rules.v2.update( + auth_rule_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + card_tokens=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], name="name", state="INACTIVE", ) assert_matches_type(V2UpdateResponse, v2, path=["response"]) @parametrize - async def test_raw_response_update(self, async_client: AsyncLithic) -> None: + async def test_raw_response_update_overload_2(self, async_client: AsyncLithic) -> None: response = await async_client.auth_rules.v2.with_raw_response.update( auth_rule_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) @@ -779,7 +964,7 @@ async def test_raw_response_update(self, async_client: AsyncLithic) -> None: assert_matches_type(V2UpdateResponse, v2, path=["response"]) @parametrize - async def test_streaming_response_update(self, async_client: AsyncLithic) -> None: + async def test_streaming_response_update_overload_2(self, async_client: AsyncLithic) -> None: async with async_client.auth_rules.v2.with_streaming_response.update( auth_rule_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) as response: @@ -792,7 +977,56 @@ async def test_streaming_response_update(self, async_client: AsyncLithic) -> Non assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_update(self, async_client: AsyncLithic) -> None: + async def test_path_params_update_overload_2(self, async_client: AsyncLithic) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `auth_rule_token` but received ''"): + await async_client.auth_rules.v2.with_raw_response.update( + auth_rule_token="", + ) + + @parametrize + async def test_method_update_overload_3(self, async_client: AsyncLithic) -> None: + v2 = await async_client.auth_rules.v2.update( + auth_rule_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + assert_matches_type(V2UpdateResponse, v2, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_3(self, async_client: AsyncLithic) -> None: + v2 = await async_client.auth_rules.v2.update( + auth_rule_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + excluded_card_tokens=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + name="name", + program_level=True, + state="INACTIVE", + ) + assert_matches_type(V2UpdateResponse, v2, path=["response"]) + + @parametrize + async def test_raw_response_update_overload_3(self, async_client: AsyncLithic) -> None: + response = await async_client.auth_rules.v2.with_raw_response.update( + auth_rule_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + v2 = response.parse() + assert_matches_type(V2UpdateResponse, v2, path=["response"]) + + @parametrize + async def test_streaming_response_update_overload_3(self, async_client: AsyncLithic) -> None: + async with async_client.auth_rules.v2.with_streaming_response.update( + auth_rule_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + v2 = await response.parse() + assert_matches_type(V2UpdateResponse, v2, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_update_overload_3(self, async_client: AsyncLithic) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `auth_rule_token` but received ''"): await async_client.auth_rules.v2.with_raw_response.update( auth_rule_token="", @@ -834,6 +1068,44 @@ async def test_streaming_response_list(self, async_client: AsyncLithic) -> None: assert cast(Any, response.is_closed) is True + @parametrize + async def test_method_delete(self, async_client: AsyncLithic) -> None: + v2 = await async_client.auth_rules.v2.delete( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + assert v2 is None + + @parametrize + async def test_raw_response_delete(self, async_client: AsyncLithic) -> None: + response = await async_client.auth_rules.v2.with_raw_response.delete( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + v2 = response.parse() + assert v2 is None + + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncLithic) -> None: + async with async_client.auth_rules.v2.with_streaming_response.delete( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + v2 = await response.parse() + assert v2 is None + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_delete(self, async_client: AsyncLithic) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `auth_rule_token` but received ''"): + await async_client.auth_rules.v2.with_raw_response.delete( + "", + ) + @parametrize async def test_method_apply_overload_1(self, async_client: AsyncLithic) -> None: v2 = await async_client.auth_rules.v2.apply(