From b8f48c2c07fc10aa924e5c7f729596312749fbe8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Apr 2025 16:23:25 +0000 Subject: [PATCH 1/6] chore(internal): minor formatting changes --- src/lithic/types/credit_products/extended_credit.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/lithic/types/credit_products/extended_credit.py b/src/lithic/types/credit_products/extended_credit.py index ea070193..9de5c563 100644 --- a/src/lithic/types/credit_products/extended_credit.py +++ b/src/lithic/types/credit_products/extended_credit.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from ..._models import BaseModel __all__ = ["ExtendedCredit"] From 0e3086d630295afedb1f2925cee8ef660ff90853 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Apr 2025 17:55:48 +0000 Subject: [PATCH 2/6] chore(ci): run on more branches and use depot runners --- .github/workflows/ci.yml | 18 +++++++++--------- .github/workflows/publish-pypi.yml | 2 +- .github/workflows/release-doctor.yml | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 11ee3b31..268ba611 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,18 +1,18 @@ name: CI on: push: - branches: - - main - pull_request: - branches: - - main - - next + branches-ignore: + - 'generated' + - 'codegen/**' + - 'integrated/**' + - 'stl-preview-head/**' + - 'stl-preview-base/**' jobs: lint: timeout-minutes: 10 name: lint - runs-on: ubuntu-latest + runs-on: depot-ubuntu-24.04 steps: - uses: actions/checkout@v4 @@ -33,7 +33,7 @@ jobs: test: timeout-minutes: 10 name: test - runs-on: ubuntu-latest + runs-on: depot-ubuntu-24.04 steps: - uses: actions/checkout@v4 @@ -54,7 +54,7 @@ jobs: examples: timeout-minutes: 10 name: examples - runs-on: ubuntu-latest + runs-on: depot-ubuntu-24.04 if: github.repository == 'lithic-com/lithic-python' steps: diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index b7160d6a..2ee03d83 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -11,7 +11,7 @@ on: jobs: publish: name: publish - runs-on: ubuntu-latest + runs-on: depot-ubuntu-24.04 steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index 82eba48b..0dcdf14c 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -8,7 +8,7 @@ on: jobs: release_doctor: name: release doctor - runs-on: ubuntu-latest + runs-on: depot-ubuntu-24.04 if: github.repository == 'lithic-com/lithic-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') steps: From 3c98e4af4ca05552fcfa4181917cdd7cd3f27b30 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Apr 2025 20:02:10 +0000 Subject: [PATCH 3/6] chore(ci): only use depot for staging repos --- .github/workflows/ci.yml | 6 +++--- .github/workflows/publish-pypi.yml | 2 +- .github/workflows/release-doctor.yml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 268ba611..5933e3b2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: lint: timeout-minutes: 10 name: lint - runs-on: depot-ubuntu-24.04 + runs-on: ${{ github.repository == 'stainless-sdks/lithic-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} steps: - uses: actions/checkout@v4 @@ -33,7 +33,7 @@ jobs: test: timeout-minutes: 10 name: test - runs-on: depot-ubuntu-24.04 + runs-on: ${{ github.repository == 'stainless-sdks/lithic-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} steps: - uses: actions/checkout@v4 @@ -54,7 +54,7 @@ jobs: examples: timeout-minutes: 10 name: examples - runs-on: depot-ubuntu-24.04 + runs-on: ${{ github.repository == 'stainless-sdks/lithic-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: github.repository == 'lithic-com/lithic-python' steps: diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index 2ee03d83..b7160d6a 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -11,7 +11,7 @@ on: jobs: publish: name: publish - runs-on: depot-ubuntu-24.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index 0dcdf14c..82eba48b 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -8,7 +8,7 @@ on: jobs: release_doctor: name: release doctor - runs-on: depot-ubuntu-24.04 + runs-on: ubuntu-latest if: github.repository == 'lithic-com/lithic-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') steps: From 0f144611e50f58ad31d3a8d7cc508f46be86c698 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Apr 2025 22:12:07 +0000 Subject: [PATCH 4/6] chore: broadly detect json family of content-type headers --- src/lithic/_legacy_response.py | 2 +- src/lithic/_response.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lithic/_legacy_response.py b/src/lithic/_legacy_response.py index 93436bcf..d3758f2b 100644 --- a/src/lithic/_legacy_response.py +++ b/src/lithic/_legacy_response.py @@ -297,7 +297,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: # split is required to handle cases where additional information is included # in the response, e.g. application/json; charset=utf-8 content_type, *_ = response.headers.get("content-type", "*").split(";") - if content_type != "application/json": + if not content_type.endswith("json"): if is_basemodel(cast_to): try: data = response.json() diff --git a/src/lithic/_response.py b/src/lithic/_response.py index 44110a9d..083b08df 100644 --- a/src/lithic/_response.py +++ b/src/lithic/_response.py @@ -237,7 +237,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: # split is required to handle cases where additional information is included # in the response, e.g. application/json; charset=utf-8 content_type, *_ = response.headers.get("content-type", "*").split(";") - if content_type != "application/json": + if not content_type.endswith("json"): if is_basemodel(cast_to): try: data = response.json() From 649c467ede30d36ab20edb8df90afb7a9c69b8eb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 29 Apr 2025 17:32:32 +0000 Subject: [PATCH 5/6] feat(api): adds new merchant lock Auth Rule - Add `SERVICE` as a new Financial Transaction event type - Add `scope` query parameter when retrieving AuthRules --- .stats.yml | 4 +- src/lithic/resources/auth_rules/v2/v2.py | 24 ++-- src/lithic/resources/book_transfers.py | 2 + src/lithic/resources/cards/cards.py | 8 +- .../types/auth_rules/v2_apply_response.py | 83 +++++++++++- .../types/auth_rules/v2_create_params.py | 118 ++++++++++++++++-- .../types/auth_rules/v2_create_response.py | 83 +++++++++++- .../types/auth_rules/v2_draft_params.py | 45 ++++++- .../types/auth_rules/v2_draft_response.py | 83 +++++++++++- src/lithic/types/auth_rules/v2_list_params.py | 5 +- .../types/auth_rules/v2_list_response.py | 83 +++++++++++- .../types/auth_rules/v2_promote_response.py | 83 +++++++++++- .../types/auth_rules/v2_retrieve_response.py | 83 +++++++++++- .../types/auth_rules/v2_update_response.py | 83 +++++++++++- .../types/book_transfer_create_params.py | 1 + .../statements/statement_line_items.py | 1 + src/lithic/types/financial_transaction.py | 1 + tests/api_resources/auth_rules/test_v2.py | 2 + 18 files changed, 738 insertions(+), 54 deletions(-) diff --git a/.stats.yml b/.stats.yml index a758eb12..234afcf7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 156 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-569e7dcb415398515370989172038db711642cd3b0bd7559bfd2b94e325a6086.yml -openapi_spec_hash: ce1dae8c6eb50d4490e75357c5e520a7 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-d44845cfc597e545a51450a62b2185d7a1ce76a3f9ac71145c3e74f99397d42a.yml +openapi_spec_hash: 3339f9fd912f2eb8ba5efc3c73f5d030 config_hash: e9de93b19060a153a852f7c03f235162 diff --git a/src/lithic/resources/auth_rules/v2/v2.py b/src/lithic/resources/auth_rules/v2/v2.py index 3992a077..52f73ea6 100644 --- a/src/lithic/resources/auth_rules/v2/v2.py +++ b/src/lithic/resources/auth_rules/v2/v2.py @@ -67,7 +67,7 @@ def create( account_tokens: List[str], name: Optional[str] | NotGiven = NOT_GIVEN, parameters: v2_create_params.CreateAuthRuleRequestAccountTokensParameters | NotGiven = NOT_GIVEN, - type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT"] | NotGiven = NOT_GIVEN, + type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT", "MERCHANT_LOCK"] | 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, @@ -104,7 +104,7 @@ def create( card_tokens: List[str], name: Optional[str] | NotGiven = NOT_GIVEN, parameters: v2_create_params.CreateAuthRuleRequestCardTokensParameters | NotGiven = NOT_GIVEN, - type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT"] | NotGiven = NOT_GIVEN, + type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT", "MERCHANT_LOCK"] | 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, @@ -142,7 +142,7 @@ def create( excluded_card_tokens: List[str] | NotGiven = NOT_GIVEN, name: Optional[str] | NotGiven = NOT_GIVEN, parameters: v2_create_params.CreateAuthRuleRequestProgramLevelParameters | NotGiven = NOT_GIVEN, - type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT"] | NotGiven = NOT_GIVEN, + type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT", "MERCHANT_LOCK"] | 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, @@ -181,7 +181,7 @@ def create( account_tokens: List[str] | NotGiven = NOT_GIVEN, name: Optional[str] | NotGiven = NOT_GIVEN, parameters: v2_create_params.CreateAuthRuleRequestAccountTokensParameters | NotGiven = NOT_GIVEN, - type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT"] | NotGiven = NOT_GIVEN, + type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT", "MERCHANT_LOCK"] | NotGiven = NOT_GIVEN, card_tokens: List[str] | NotGiven = NOT_GIVEN, program_level: bool | NotGiven = NOT_GIVEN, excluded_card_tokens: List[str] | NotGiven = NOT_GIVEN, @@ -422,6 +422,7 @@ def list( card_token: str | NotGiven = NOT_GIVEN, ending_before: str | NotGiven = NOT_GIVEN, page_size: int | NotGiven = NOT_GIVEN, + scope: Literal["PROGRAM", "ACCOUNT", "CARD"] | NotGiven = NOT_GIVEN, starting_after: str | 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. @@ -443,6 +444,8 @@ def list( page_size: Page size (for pagination). + scope: Only return Authorization Rules that are bound to the provided scope; + starting_after: A cursor representing an item's token after which a page of results should begin. Used to retrieve the next page of results after this item. @@ -468,6 +471,7 @@ def list( "card_token": card_token, "ending_before": ending_before, "page_size": page_size, + "scope": scope, "starting_after": starting_after, }, v2_list_params.V2ListParams, @@ -832,7 +836,7 @@ async def create( account_tokens: List[str], name: Optional[str] | NotGiven = NOT_GIVEN, parameters: v2_create_params.CreateAuthRuleRequestAccountTokensParameters | NotGiven = NOT_GIVEN, - type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT"] | NotGiven = NOT_GIVEN, + type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT", "MERCHANT_LOCK"] | 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, @@ -869,7 +873,7 @@ async def create( card_tokens: List[str], name: Optional[str] | NotGiven = NOT_GIVEN, parameters: v2_create_params.CreateAuthRuleRequestCardTokensParameters | NotGiven = NOT_GIVEN, - type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT"] | NotGiven = NOT_GIVEN, + type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT", "MERCHANT_LOCK"] | 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, @@ -907,7 +911,7 @@ async def create( excluded_card_tokens: List[str] | NotGiven = NOT_GIVEN, name: Optional[str] | NotGiven = NOT_GIVEN, parameters: v2_create_params.CreateAuthRuleRequestProgramLevelParameters | NotGiven = NOT_GIVEN, - type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT"] | NotGiven = NOT_GIVEN, + type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT", "MERCHANT_LOCK"] | 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, @@ -946,7 +950,7 @@ async def create( account_tokens: List[str] | NotGiven = NOT_GIVEN, name: Optional[str] | NotGiven = NOT_GIVEN, parameters: v2_create_params.CreateAuthRuleRequestAccountTokensParameters | NotGiven = NOT_GIVEN, - type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT"] | NotGiven = NOT_GIVEN, + type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT", "MERCHANT_LOCK"] | NotGiven = NOT_GIVEN, card_tokens: List[str] | NotGiven = NOT_GIVEN, program_level: bool | NotGiven = NOT_GIVEN, excluded_card_tokens: List[str] | NotGiven = NOT_GIVEN, @@ -1187,6 +1191,7 @@ def list( card_token: str | NotGiven = NOT_GIVEN, ending_before: str | NotGiven = NOT_GIVEN, page_size: int | NotGiven = NOT_GIVEN, + scope: Literal["PROGRAM", "ACCOUNT", "CARD"] | NotGiven = NOT_GIVEN, starting_after: str | 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. @@ -1208,6 +1213,8 @@ def list( page_size: Page size (for pagination). + scope: Only return Authorization Rules that are bound to the provided scope; + starting_after: A cursor representing an item's token after which a page of results should begin. Used to retrieve the next page of results after this item. @@ -1233,6 +1240,7 @@ def list( "card_token": card_token, "ending_before": ending_before, "page_size": page_size, + "scope": scope, "starting_after": starting_after, }, v2_list_params.V2ListParams, diff --git a/src/lithic/resources/book_transfers.py b/src/lithic/resources/book_transfers.py index 78f180eb..38cad567 100644 --- a/src/lithic/resources/book_transfers.py +++ b/src/lithic/resources/book_transfers.py @@ -82,6 +82,7 @@ def create( "INACTIVITY_FEE_DOWN", "PROVISIONAL_CREDIT", "DISPUTE_WON", + "SERVICE", "TRANSFER", ], token: str | NotGiven = NOT_GIVEN, @@ -368,6 +369,7 @@ async def create( "INACTIVITY_FEE_DOWN", "PROVISIONAL_CREDIT", "DISPUTE_WON", + "SERVICE", "TRANSFER", ], token: str | NotGiven = NOT_GIVEN, diff --git a/src/lithic/resources/cards/cards.py b/src/lithic/resources/cards/cards.py index 7bb7c0f6..f545e7a4 100644 --- a/src/lithic/resources/cards/cards.py +++ b/src/lithic/resources/cards/cards.py @@ -841,7 +841,7 @@ def reissue( card is physically damaged). The PAN, expiry, and CVC2 will remain the same and the original card can continue to be used until the new card is activated. Only - applies to cards of type `PHYSICAL`. A card can be replaced or renewed a total + applies to cards of type `PHYSICAL`. A card can be reissued or renewed a total of 8 times. Args: @@ -918,7 +918,7 @@ def renew( original card will keep working for card-present transactions until the new card is activated. For card-not-present transactions, the original card details (expiry, CVC2) will also keep working until the new card is activated. A - `PHYSICAL` card can be replaced or renewed a total of 8 times. For `VIRTUAL`, + `PHYSICAL` card can be reissued or renewed a total of 8 times. For `VIRTUAL`, the card will retain the same card token and PAN and receive an updated expiry and CVC2 code. `product_id`, `shipping_method`, `shipping_address`, `carrier` are only relevant for renewing `PHYSICAL` cards. @@ -1828,7 +1828,7 @@ async def reissue( card is physically damaged). The PAN, expiry, and CVC2 will remain the same and the original card can continue to be used until the new card is activated. Only - applies to cards of type `PHYSICAL`. A card can be replaced or renewed a total + applies to cards of type `PHYSICAL`. A card can be reissued or renewed a total of 8 times. Args: @@ -1905,7 +1905,7 @@ async def renew( original card will keep working for card-present transactions until the new card is activated. For card-not-present transactions, the original card details (expiry, CVC2) will also keep working until the new card is activated. A - `PHYSICAL` card can be replaced or renewed a total of 8 times. For `VIRTUAL`, + `PHYSICAL` card can be reissued or renewed a total of 8 times. For `VIRTUAL`, the card will retain the same card token and PAN and receive an updated expiry and CVC2 code. `product_id`, `shipping_method`, `shipping_address`, `carrier` are only relevant for renewing `PHYSICAL` cards. diff --git a/src/lithic/types/auth_rules/v2_apply_response.py b/src/lithic/types/auth_rules/v2_apply_response.py index 153c3d2b..d18dcdb6 100644 --- a/src/lithic/types/auth_rules/v2_apply_response.py +++ b/src/lithic/types/auth_rules/v2_apply_response.py @@ -7,9 +7,52 @@ from .velocity_limit_params import VelocityLimitParams from .conditional_block_parameters import ConditionalBlockParameters -__all__ = ["V2ApplyResponse", "CurrentVersion", "CurrentVersionParameters", "DraftVersion", "DraftVersionParameters"] +__all__ = [ + "V2ApplyResponse", + "CurrentVersion", + "CurrentVersionParameters", + "CurrentVersionParametersMerchantLockParameters", + "CurrentVersionParametersMerchantLockParametersMerchant", + "DraftVersion", + "DraftVersionParameters", + "DraftVersionParametersMerchantLockParameters", + "DraftVersionParametersMerchantLockParametersMerchant", +] + + +class CurrentVersionParametersMerchantLockParametersMerchant(BaseModel): + comment: Optional[str] = None + """ + A comment or explanation about the merchant, used internally for rule management + purposes. + """ + + descriptor: Optional[str] = None + """ + Short description of the merchant, often used to provide more human-readable + context about the transaction merchant. This is typically the name or label + shown on transaction summaries. + """ + + merchant_id: Optional[str] = None + """Unique alphanumeric identifier for the payment card acceptor (merchant). + + This attribute specifies the merchant entity that will be locked or referenced + for authorization rules. + """ + -CurrentVersionParameters: TypeAlias = Union[ConditionalBlockParameters, VelocityLimitParams] +class CurrentVersionParametersMerchantLockParameters(BaseModel): + merchants: List[CurrentVersionParametersMerchantLockParametersMerchant] + """ + A list of merchant locks defining specific merchants or groups of merchants + (based on descriptors or IDs) that the lock applies to. + """ + + +CurrentVersionParameters: TypeAlias = Union[ + ConditionalBlockParameters, VelocityLimitParams, CurrentVersionParametersMerchantLockParameters +] class CurrentVersion(BaseModel): @@ -23,7 +66,39 @@ class CurrentVersion(BaseModel): """ -DraftVersionParameters: TypeAlias = Union[ConditionalBlockParameters, VelocityLimitParams] +class DraftVersionParametersMerchantLockParametersMerchant(BaseModel): + comment: Optional[str] = None + """ + A comment or explanation about the merchant, used internally for rule management + purposes. + """ + + descriptor: Optional[str] = None + """ + Short description of the merchant, often used to provide more human-readable + context about the transaction merchant. This is typically the name or label + shown on transaction summaries. + """ + + merchant_id: Optional[str] = None + """Unique alphanumeric identifier for the payment card acceptor (merchant). + + This attribute specifies the merchant entity that will be locked or referenced + for authorization rules. + """ + + +class DraftVersionParametersMerchantLockParameters(BaseModel): + merchants: List[DraftVersionParametersMerchantLockParametersMerchant] + """ + A list of merchant locks defining specific merchants or groups of merchants + (based on descriptors or IDs) that the lock applies to. + """ + + +DraftVersionParameters: TypeAlias = Union[ + ConditionalBlockParameters, VelocityLimitParams, DraftVersionParametersMerchantLockParameters +] class DraftVersion(BaseModel): @@ -60,7 +135,7 @@ class V2ApplyResponse(BaseModel): state: Literal["ACTIVE", "INACTIVE"] """The state of the Auth Rule""" - type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT"] + type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT", "MERCHANT_LOCK"] """The type of Auth Rule""" excluded_card_tokens: Optional[List[str]] = None diff --git a/src/lithic/types/auth_rules/v2_create_params.py b/src/lithic/types/auth_rules/v2_create_params.py index dff961f4..42ee2ff8 100644 --- a/src/lithic/types/auth_rules/v2_create_params.py +++ b/src/lithic/types/auth_rules/v2_create_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import List, Union, Optional +from typing import List, Union, Iterable, Optional from typing_extensions import Literal, Required, TypeAlias, TypedDict from .velocity_limit_params_param import VelocityLimitParamsParam @@ -12,10 +12,16 @@ "V2CreateParams", "CreateAuthRuleRequestAccountTokens", "CreateAuthRuleRequestAccountTokensParameters", + "CreateAuthRuleRequestAccountTokensParametersMerchantLockParameters", + "CreateAuthRuleRequestAccountTokensParametersMerchantLockParametersMerchant", "CreateAuthRuleRequestCardTokens", "CreateAuthRuleRequestCardTokensParameters", + "CreateAuthRuleRequestCardTokensParametersMerchantLockParameters", + "CreateAuthRuleRequestCardTokensParametersMerchantLockParametersMerchant", "CreateAuthRuleRequestProgramLevel", "CreateAuthRuleRequestProgramLevelParameters", + "CreateAuthRuleRequestProgramLevelParametersMerchantLockParameters", + "CreateAuthRuleRequestProgramLevelParametersMerchantLockParametersMerchant", ] @@ -29,12 +35,44 @@ class CreateAuthRuleRequestAccountTokens(TypedDict, total=False): parameters: CreateAuthRuleRequestAccountTokensParameters """Parameters for the Auth Rule""" - type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT"] + type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT", "MERCHANT_LOCK"] """The type of Auth Rule""" +class CreateAuthRuleRequestAccountTokensParametersMerchantLockParametersMerchant(TypedDict, total=False): + comment: str + """ + A comment or explanation about the merchant, used internally for rule management + purposes. + """ + + descriptor: str + """ + Short description of the merchant, often used to provide more human-readable + context about the transaction merchant. This is typically the name or label + shown on transaction summaries. + """ + + merchant_id: str + """Unique alphanumeric identifier for the payment card acceptor (merchant). + + This attribute specifies the merchant entity that will be locked or referenced + for authorization rules. + """ + + +class CreateAuthRuleRequestAccountTokensParametersMerchantLockParameters(TypedDict, total=False): + merchants: Required[Iterable[CreateAuthRuleRequestAccountTokensParametersMerchantLockParametersMerchant]] + """ + A list of merchant locks defining specific merchants or groups of merchants + (based on descriptors or IDs) that the lock applies to. + """ + + CreateAuthRuleRequestAccountTokensParameters: TypeAlias = Union[ - ConditionalBlockParametersParam, VelocityLimitParamsParam + ConditionalBlockParametersParam, + VelocityLimitParamsParam, + CreateAuthRuleRequestAccountTokensParametersMerchantLockParameters, ] @@ -48,11 +86,45 @@ class CreateAuthRuleRequestCardTokens(TypedDict, total=False): parameters: CreateAuthRuleRequestCardTokensParameters """Parameters for the Auth Rule""" - type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT"] + type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT", "MERCHANT_LOCK"] """The type of Auth Rule""" -CreateAuthRuleRequestCardTokensParameters: TypeAlias = Union[ConditionalBlockParametersParam, VelocityLimitParamsParam] +class CreateAuthRuleRequestCardTokensParametersMerchantLockParametersMerchant(TypedDict, total=False): + comment: str + """ + A comment or explanation about the merchant, used internally for rule management + purposes. + """ + + descriptor: str + """ + Short description of the merchant, often used to provide more human-readable + context about the transaction merchant. This is typically the name or label + shown on transaction summaries. + """ + + merchant_id: str + """Unique alphanumeric identifier for the payment card acceptor (merchant). + + This attribute specifies the merchant entity that will be locked or referenced + for authorization rules. + """ + + +class CreateAuthRuleRequestCardTokensParametersMerchantLockParameters(TypedDict, total=False): + merchants: Required[Iterable[CreateAuthRuleRequestCardTokensParametersMerchantLockParametersMerchant]] + """ + A list of merchant locks defining specific merchants or groups of merchants + (based on descriptors or IDs) that the lock applies to. + """ + + +CreateAuthRuleRequestCardTokensParameters: TypeAlias = Union[ + ConditionalBlockParametersParam, + VelocityLimitParamsParam, + CreateAuthRuleRequestCardTokensParametersMerchantLockParameters, +] class CreateAuthRuleRequestProgramLevel(TypedDict, total=False): @@ -68,12 +140,44 @@ class CreateAuthRuleRequestProgramLevel(TypedDict, total=False): parameters: CreateAuthRuleRequestProgramLevelParameters """Parameters for the Auth Rule""" - type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT"] + type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT", "MERCHANT_LOCK"] """The type of Auth Rule""" +class CreateAuthRuleRequestProgramLevelParametersMerchantLockParametersMerchant(TypedDict, total=False): + comment: str + """ + A comment or explanation about the merchant, used internally for rule management + purposes. + """ + + descriptor: str + """ + Short description of the merchant, often used to provide more human-readable + context about the transaction merchant. This is typically the name or label + shown on transaction summaries. + """ + + merchant_id: str + """Unique alphanumeric identifier for the payment card acceptor (merchant). + + This attribute specifies the merchant entity that will be locked or referenced + for authorization rules. + """ + + +class CreateAuthRuleRequestProgramLevelParametersMerchantLockParameters(TypedDict, total=False): + merchants: Required[Iterable[CreateAuthRuleRequestProgramLevelParametersMerchantLockParametersMerchant]] + """ + A list of merchant locks defining specific merchants or groups of merchants + (based on descriptors or IDs) that the lock applies to. + """ + + CreateAuthRuleRequestProgramLevelParameters: TypeAlias = Union[ - ConditionalBlockParametersParam, VelocityLimitParamsParam + ConditionalBlockParametersParam, + VelocityLimitParamsParam, + CreateAuthRuleRequestProgramLevelParametersMerchantLockParameters, ] V2CreateParams: TypeAlias = Union[ diff --git a/src/lithic/types/auth_rules/v2_create_response.py b/src/lithic/types/auth_rules/v2_create_response.py index b2078622..05686de1 100644 --- a/src/lithic/types/auth_rules/v2_create_response.py +++ b/src/lithic/types/auth_rules/v2_create_response.py @@ -7,9 +7,52 @@ from .velocity_limit_params import VelocityLimitParams from .conditional_block_parameters import ConditionalBlockParameters -__all__ = ["V2CreateResponse", "CurrentVersion", "CurrentVersionParameters", "DraftVersion", "DraftVersionParameters"] +__all__ = [ + "V2CreateResponse", + "CurrentVersion", + "CurrentVersionParameters", + "CurrentVersionParametersMerchantLockParameters", + "CurrentVersionParametersMerchantLockParametersMerchant", + "DraftVersion", + "DraftVersionParameters", + "DraftVersionParametersMerchantLockParameters", + "DraftVersionParametersMerchantLockParametersMerchant", +] + + +class CurrentVersionParametersMerchantLockParametersMerchant(BaseModel): + comment: Optional[str] = None + """ + A comment or explanation about the merchant, used internally for rule management + purposes. + """ + + descriptor: Optional[str] = None + """ + Short description of the merchant, often used to provide more human-readable + context about the transaction merchant. This is typically the name or label + shown on transaction summaries. + """ + + merchant_id: Optional[str] = None + """Unique alphanumeric identifier for the payment card acceptor (merchant). + + This attribute specifies the merchant entity that will be locked or referenced + for authorization rules. + """ + -CurrentVersionParameters: TypeAlias = Union[ConditionalBlockParameters, VelocityLimitParams] +class CurrentVersionParametersMerchantLockParameters(BaseModel): + merchants: List[CurrentVersionParametersMerchantLockParametersMerchant] + """ + A list of merchant locks defining specific merchants or groups of merchants + (based on descriptors or IDs) that the lock applies to. + """ + + +CurrentVersionParameters: TypeAlias = Union[ + ConditionalBlockParameters, VelocityLimitParams, CurrentVersionParametersMerchantLockParameters +] class CurrentVersion(BaseModel): @@ -23,7 +66,39 @@ class CurrentVersion(BaseModel): """ -DraftVersionParameters: TypeAlias = Union[ConditionalBlockParameters, VelocityLimitParams] +class DraftVersionParametersMerchantLockParametersMerchant(BaseModel): + comment: Optional[str] = None + """ + A comment or explanation about the merchant, used internally for rule management + purposes. + """ + + descriptor: Optional[str] = None + """ + Short description of the merchant, often used to provide more human-readable + context about the transaction merchant. This is typically the name or label + shown on transaction summaries. + """ + + merchant_id: Optional[str] = None + """Unique alphanumeric identifier for the payment card acceptor (merchant). + + This attribute specifies the merchant entity that will be locked or referenced + for authorization rules. + """ + + +class DraftVersionParametersMerchantLockParameters(BaseModel): + merchants: List[DraftVersionParametersMerchantLockParametersMerchant] + """ + A list of merchant locks defining specific merchants or groups of merchants + (based on descriptors or IDs) that the lock applies to. + """ + + +DraftVersionParameters: TypeAlias = Union[ + ConditionalBlockParameters, VelocityLimitParams, DraftVersionParametersMerchantLockParameters +] class DraftVersion(BaseModel): @@ -60,7 +135,7 @@ class V2CreateResponse(BaseModel): state: Literal["ACTIVE", "INACTIVE"] """The state of the Auth Rule""" - type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT"] + type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT", "MERCHANT_LOCK"] """The type of Auth Rule""" excluded_card_tokens: Optional[List[str]] = None diff --git a/src/lithic/types/auth_rules/v2_draft_params.py b/src/lithic/types/auth_rules/v2_draft_params.py index 5d7a5559..e90da23a 100644 --- a/src/lithic/types/auth_rules/v2_draft_params.py +++ b/src/lithic/types/auth_rules/v2_draft_params.py @@ -2,13 +2,18 @@ from __future__ import annotations -from typing import Union, Optional -from typing_extensions import TypeAlias, TypedDict +from typing import Union, Iterable, Optional +from typing_extensions import Required, TypeAlias, TypedDict from .velocity_limit_params_param import VelocityLimitParamsParam from .conditional_block_parameters_param import ConditionalBlockParametersParam -__all__ = ["V2DraftParams", "Parameters"] +__all__ = [ + "V2DraftParams", + "Parameters", + "ParametersMerchantLockParameters", + "ParametersMerchantLockParametersMerchant", +] class V2DraftParams(TypedDict, total=False): @@ -16,4 +21,36 @@ class V2DraftParams(TypedDict, total=False): """Parameters for the Auth Rule""" -Parameters: TypeAlias = Union[ConditionalBlockParametersParam, VelocityLimitParamsParam] +class ParametersMerchantLockParametersMerchant(TypedDict, total=False): + comment: str + """ + A comment or explanation about the merchant, used internally for rule management + purposes. + """ + + descriptor: str + """ + Short description of the merchant, often used to provide more human-readable + context about the transaction merchant. This is typically the name or label + shown on transaction summaries. + """ + + merchant_id: str + """Unique alphanumeric identifier for the payment card acceptor (merchant). + + This attribute specifies the merchant entity that will be locked or referenced + for authorization rules. + """ + + +class ParametersMerchantLockParameters(TypedDict, total=False): + merchants: Required[Iterable[ParametersMerchantLockParametersMerchant]] + """ + A list of merchant locks defining specific merchants or groups of merchants + (based on descriptors or IDs) that the lock applies to. + """ + + +Parameters: TypeAlias = Union[ + ConditionalBlockParametersParam, VelocityLimitParamsParam, ParametersMerchantLockParameters +] diff --git a/src/lithic/types/auth_rules/v2_draft_response.py b/src/lithic/types/auth_rules/v2_draft_response.py index 4226de04..d2b830bb 100644 --- a/src/lithic/types/auth_rules/v2_draft_response.py +++ b/src/lithic/types/auth_rules/v2_draft_response.py @@ -7,9 +7,52 @@ from .velocity_limit_params import VelocityLimitParams from .conditional_block_parameters import ConditionalBlockParameters -__all__ = ["V2DraftResponse", "CurrentVersion", "CurrentVersionParameters", "DraftVersion", "DraftVersionParameters"] +__all__ = [ + "V2DraftResponse", + "CurrentVersion", + "CurrentVersionParameters", + "CurrentVersionParametersMerchantLockParameters", + "CurrentVersionParametersMerchantLockParametersMerchant", + "DraftVersion", + "DraftVersionParameters", + "DraftVersionParametersMerchantLockParameters", + "DraftVersionParametersMerchantLockParametersMerchant", +] + + +class CurrentVersionParametersMerchantLockParametersMerchant(BaseModel): + comment: Optional[str] = None + """ + A comment or explanation about the merchant, used internally for rule management + purposes. + """ + + descriptor: Optional[str] = None + """ + Short description of the merchant, often used to provide more human-readable + context about the transaction merchant. This is typically the name or label + shown on transaction summaries. + """ + + merchant_id: Optional[str] = None + """Unique alphanumeric identifier for the payment card acceptor (merchant). + + This attribute specifies the merchant entity that will be locked or referenced + for authorization rules. + """ + -CurrentVersionParameters: TypeAlias = Union[ConditionalBlockParameters, VelocityLimitParams] +class CurrentVersionParametersMerchantLockParameters(BaseModel): + merchants: List[CurrentVersionParametersMerchantLockParametersMerchant] + """ + A list of merchant locks defining specific merchants or groups of merchants + (based on descriptors or IDs) that the lock applies to. + """ + + +CurrentVersionParameters: TypeAlias = Union[ + ConditionalBlockParameters, VelocityLimitParams, CurrentVersionParametersMerchantLockParameters +] class CurrentVersion(BaseModel): @@ -23,7 +66,39 @@ class CurrentVersion(BaseModel): """ -DraftVersionParameters: TypeAlias = Union[ConditionalBlockParameters, VelocityLimitParams] +class DraftVersionParametersMerchantLockParametersMerchant(BaseModel): + comment: Optional[str] = None + """ + A comment or explanation about the merchant, used internally for rule management + purposes. + """ + + descriptor: Optional[str] = None + """ + Short description of the merchant, often used to provide more human-readable + context about the transaction merchant. This is typically the name or label + shown on transaction summaries. + """ + + merchant_id: Optional[str] = None + """Unique alphanumeric identifier for the payment card acceptor (merchant). + + This attribute specifies the merchant entity that will be locked or referenced + for authorization rules. + """ + + +class DraftVersionParametersMerchantLockParameters(BaseModel): + merchants: List[DraftVersionParametersMerchantLockParametersMerchant] + """ + A list of merchant locks defining specific merchants or groups of merchants + (based on descriptors or IDs) that the lock applies to. + """ + + +DraftVersionParameters: TypeAlias = Union[ + ConditionalBlockParameters, VelocityLimitParams, DraftVersionParametersMerchantLockParameters +] class DraftVersion(BaseModel): @@ -60,7 +135,7 @@ class V2DraftResponse(BaseModel): state: Literal["ACTIVE", "INACTIVE"] """The state of the Auth Rule""" - type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT"] + type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT", "MERCHANT_LOCK"] """The type of Auth Rule""" excluded_card_tokens: Optional[List[str]] = None diff --git a/src/lithic/types/auth_rules/v2_list_params.py b/src/lithic/types/auth_rules/v2_list_params.py index f080a4f6..daeca3ce 100644 --- a/src/lithic/types/auth_rules/v2_list_params.py +++ b/src/lithic/types/auth_rules/v2_list_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Literal, TypedDict __all__ = ["V2ListParams"] @@ -23,6 +23,9 @@ class V2ListParams(TypedDict, total=False): page_size: int """Page size (for pagination).""" + scope: Literal["PROGRAM", "ACCOUNT", "CARD"] + """Only return Authorization Rules that are bound to the provided scope;""" + starting_after: str """A cursor representing an item's token after which a page of results should begin. diff --git a/src/lithic/types/auth_rules/v2_list_response.py b/src/lithic/types/auth_rules/v2_list_response.py index d1039175..a53ab7c7 100644 --- a/src/lithic/types/auth_rules/v2_list_response.py +++ b/src/lithic/types/auth_rules/v2_list_response.py @@ -7,9 +7,52 @@ from .velocity_limit_params import VelocityLimitParams from .conditional_block_parameters import ConditionalBlockParameters -__all__ = ["V2ListResponse", "CurrentVersion", "CurrentVersionParameters", "DraftVersion", "DraftVersionParameters"] +__all__ = [ + "V2ListResponse", + "CurrentVersion", + "CurrentVersionParameters", + "CurrentVersionParametersMerchantLockParameters", + "CurrentVersionParametersMerchantLockParametersMerchant", + "DraftVersion", + "DraftVersionParameters", + "DraftVersionParametersMerchantLockParameters", + "DraftVersionParametersMerchantLockParametersMerchant", +] + + +class CurrentVersionParametersMerchantLockParametersMerchant(BaseModel): + comment: Optional[str] = None + """ + A comment or explanation about the merchant, used internally for rule management + purposes. + """ + + descriptor: Optional[str] = None + """ + Short description of the merchant, often used to provide more human-readable + context about the transaction merchant. This is typically the name or label + shown on transaction summaries. + """ + + merchant_id: Optional[str] = None + """Unique alphanumeric identifier for the payment card acceptor (merchant). + + This attribute specifies the merchant entity that will be locked or referenced + for authorization rules. + """ + -CurrentVersionParameters: TypeAlias = Union[ConditionalBlockParameters, VelocityLimitParams] +class CurrentVersionParametersMerchantLockParameters(BaseModel): + merchants: List[CurrentVersionParametersMerchantLockParametersMerchant] + """ + A list of merchant locks defining specific merchants or groups of merchants + (based on descriptors or IDs) that the lock applies to. + """ + + +CurrentVersionParameters: TypeAlias = Union[ + ConditionalBlockParameters, VelocityLimitParams, CurrentVersionParametersMerchantLockParameters +] class CurrentVersion(BaseModel): @@ -23,7 +66,39 @@ class CurrentVersion(BaseModel): """ -DraftVersionParameters: TypeAlias = Union[ConditionalBlockParameters, VelocityLimitParams] +class DraftVersionParametersMerchantLockParametersMerchant(BaseModel): + comment: Optional[str] = None + """ + A comment or explanation about the merchant, used internally for rule management + purposes. + """ + + descriptor: Optional[str] = None + """ + Short description of the merchant, often used to provide more human-readable + context about the transaction merchant. This is typically the name or label + shown on transaction summaries. + """ + + merchant_id: Optional[str] = None + """Unique alphanumeric identifier for the payment card acceptor (merchant). + + This attribute specifies the merchant entity that will be locked or referenced + for authorization rules. + """ + + +class DraftVersionParametersMerchantLockParameters(BaseModel): + merchants: List[DraftVersionParametersMerchantLockParametersMerchant] + """ + A list of merchant locks defining specific merchants or groups of merchants + (based on descriptors or IDs) that the lock applies to. + """ + + +DraftVersionParameters: TypeAlias = Union[ + ConditionalBlockParameters, VelocityLimitParams, DraftVersionParametersMerchantLockParameters +] class DraftVersion(BaseModel): @@ -60,7 +135,7 @@ class V2ListResponse(BaseModel): state: Literal["ACTIVE", "INACTIVE"] """The state of the Auth Rule""" - type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT"] + type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT", "MERCHANT_LOCK"] """The type of Auth Rule""" excluded_card_tokens: Optional[List[str]] = None diff --git a/src/lithic/types/auth_rules/v2_promote_response.py b/src/lithic/types/auth_rules/v2_promote_response.py index 53c27487..0d26f143 100644 --- a/src/lithic/types/auth_rules/v2_promote_response.py +++ b/src/lithic/types/auth_rules/v2_promote_response.py @@ -7,9 +7,52 @@ from .velocity_limit_params import VelocityLimitParams from .conditional_block_parameters import ConditionalBlockParameters -__all__ = ["V2PromoteResponse", "CurrentVersion", "CurrentVersionParameters", "DraftVersion", "DraftVersionParameters"] +__all__ = [ + "V2PromoteResponse", + "CurrentVersion", + "CurrentVersionParameters", + "CurrentVersionParametersMerchantLockParameters", + "CurrentVersionParametersMerchantLockParametersMerchant", + "DraftVersion", + "DraftVersionParameters", + "DraftVersionParametersMerchantLockParameters", + "DraftVersionParametersMerchantLockParametersMerchant", +] + + +class CurrentVersionParametersMerchantLockParametersMerchant(BaseModel): + comment: Optional[str] = None + """ + A comment or explanation about the merchant, used internally for rule management + purposes. + """ + + descriptor: Optional[str] = None + """ + Short description of the merchant, often used to provide more human-readable + context about the transaction merchant. This is typically the name or label + shown on transaction summaries. + """ + + merchant_id: Optional[str] = None + """Unique alphanumeric identifier for the payment card acceptor (merchant). + + This attribute specifies the merchant entity that will be locked or referenced + for authorization rules. + """ + -CurrentVersionParameters: TypeAlias = Union[ConditionalBlockParameters, VelocityLimitParams] +class CurrentVersionParametersMerchantLockParameters(BaseModel): + merchants: List[CurrentVersionParametersMerchantLockParametersMerchant] + """ + A list of merchant locks defining specific merchants or groups of merchants + (based on descriptors or IDs) that the lock applies to. + """ + + +CurrentVersionParameters: TypeAlias = Union[ + ConditionalBlockParameters, VelocityLimitParams, CurrentVersionParametersMerchantLockParameters +] class CurrentVersion(BaseModel): @@ -23,7 +66,39 @@ class CurrentVersion(BaseModel): """ -DraftVersionParameters: TypeAlias = Union[ConditionalBlockParameters, VelocityLimitParams] +class DraftVersionParametersMerchantLockParametersMerchant(BaseModel): + comment: Optional[str] = None + """ + A comment or explanation about the merchant, used internally for rule management + purposes. + """ + + descriptor: Optional[str] = None + """ + Short description of the merchant, often used to provide more human-readable + context about the transaction merchant. This is typically the name or label + shown on transaction summaries. + """ + + merchant_id: Optional[str] = None + """Unique alphanumeric identifier for the payment card acceptor (merchant). + + This attribute specifies the merchant entity that will be locked or referenced + for authorization rules. + """ + + +class DraftVersionParametersMerchantLockParameters(BaseModel): + merchants: List[DraftVersionParametersMerchantLockParametersMerchant] + """ + A list of merchant locks defining specific merchants or groups of merchants + (based on descriptors or IDs) that the lock applies to. + """ + + +DraftVersionParameters: TypeAlias = Union[ + ConditionalBlockParameters, VelocityLimitParams, DraftVersionParametersMerchantLockParameters +] class DraftVersion(BaseModel): @@ -60,7 +135,7 @@ class V2PromoteResponse(BaseModel): state: Literal["ACTIVE", "INACTIVE"] """The state of the Auth Rule""" - type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT"] + type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT", "MERCHANT_LOCK"] """The type of Auth Rule""" excluded_card_tokens: Optional[List[str]] = None diff --git a/src/lithic/types/auth_rules/v2_retrieve_response.py b/src/lithic/types/auth_rules/v2_retrieve_response.py index c4793dcc..9b9ce7f1 100644 --- a/src/lithic/types/auth_rules/v2_retrieve_response.py +++ b/src/lithic/types/auth_rules/v2_retrieve_response.py @@ -7,9 +7,52 @@ from .velocity_limit_params import VelocityLimitParams from .conditional_block_parameters import ConditionalBlockParameters -__all__ = ["V2RetrieveResponse", "CurrentVersion", "CurrentVersionParameters", "DraftVersion", "DraftVersionParameters"] +__all__ = [ + "V2RetrieveResponse", + "CurrentVersion", + "CurrentVersionParameters", + "CurrentVersionParametersMerchantLockParameters", + "CurrentVersionParametersMerchantLockParametersMerchant", + "DraftVersion", + "DraftVersionParameters", + "DraftVersionParametersMerchantLockParameters", + "DraftVersionParametersMerchantLockParametersMerchant", +] + + +class CurrentVersionParametersMerchantLockParametersMerchant(BaseModel): + comment: Optional[str] = None + """ + A comment or explanation about the merchant, used internally for rule management + purposes. + """ + + descriptor: Optional[str] = None + """ + Short description of the merchant, often used to provide more human-readable + context about the transaction merchant. This is typically the name or label + shown on transaction summaries. + """ + + merchant_id: Optional[str] = None + """Unique alphanumeric identifier for the payment card acceptor (merchant). + + This attribute specifies the merchant entity that will be locked or referenced + for authorization rules. + """ + -CurrentVersionParameters: TypeAlias = Union[ConditionalBlockParameters, VelocityLimitParams] +class CurrentVersionParametersMerchantLockParameters(BaseModel): + merchants: List[CurrentVersionParametersMerchantLockParametersMerchant] + """ + A list of merchant locks defining specific merchants or groups of merchants + (based on descriptors or IDs) that the lock applies to. + """ + + +CurrentVersionParameters: TypeAlias = Union[ + ConditionalBlockParameters, VelocityLimitParams, CurrentVersionParametersMerchantLockParameters +] class CurrentVersion(BaseModel): @@ -23,7 +66,39 @@ class CurrentVersion(BaseModel): """ -DraftVersionParameters: TypeAlias = Union[ConditionalBlockParameters, VelocityLimitParams] +class DraftVersionParametersMerchantLockParametersMerchant(BaseModel): + comment: Optional[str] = None + """ + A comment or explanation about the merchant, used internally for rule management + purposes. + """ + + descriptor: Optional[str] = None + """ + Short description of the merchant, often used to provide more human-readable + context about the transaction merchant. This is typically the name or label + shown on transaction summaries. + """ + + merchant_id: Optional[str] = None + """Unique alphanumeric identifier for the payment card acceptor (merchant). + + This attribute specifies the merchant entity that will be locked or referenced + for authorization rules. + """ + + +class DraftVersionParametersMerchantLockParameters(BaseModel): + merchants: List[DraftVersionParametersMerchantLockParametersMerchant] + """ + A list of merchant locks defining specific merchants or groups of merchants + (based on descriptors or IDs) that the lock applies to. + """ + + +DraftVersionParameters: TypeAlias = Union[ + ConditionalBlockParameters, VelocityLimitParams, DraftVersionParametersMerchantLockParameters +] class DraftVersion(BaseModel): @@ -60,7 +135,7 @@ class V2RetrieveResponse(BaseModel): state: Literal["ACTIVE", "INACTIVE"] """The state of the Auth Rule""" - type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT"] + type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT", "MERCHANT_LOCK"] """The type of Auth Rule""" excluded_card_tokens: Optional[List[str]] = None diff --git a/src/lithic/types/auth_rules/v2_update_response.py b/src/lithic/types/auth_rules/v2_update_response.py index e5a5456f..681846ec 100644 --- a/src/lithic/types/auth_rules/v2_update_response.py +++ b/src/lithic/types/auth_rules/v2_update_response.py @@ -7,9 +7,52 @@ from .velocity_limit_params import VelocityLimitParams from .conditional_block_parameters import ConditionalBlockParameters -__all__ = ["V2UpdateResponse", "CurrentVersion", "CurrentVersionParameters", "DraftVersion", "DraftVersionParameters"] +__all__ = [ + "V2UpdateResponse", + "CurrentVersion", + "CurrentVersionParameters", + "CurrentVersionParametersMerchantLockParameters", + "CurrentVersionParametersMerchantLockParametersMerchant", + "DraftVersion", + "DraftVersionParameters", + "DraftVersionParametersMerchantLockParameters", + "DraftVersionParametersMerchantLockParametersMerchant", +] + + +class CurrentVersionParametersMerchantLockParametersMerchant(BaseModel): + comment: Optional[str] = None + """ + A comment or explanation about the merchant, used internally for rule management + purposes. + """ + + descriptor: Optional[str] = None + """ + Short description of the merchant, often used to provide more human-readable + context about the transaction merchant. This is typically the name or label + shown on transaction summaries. + """ + + merchant_id: Optional[str] = None + """Unique alphanumeric identifier for the payment card acceptor (merchant). + + This attribute specifies the merchant entity that will be locked or referenced + for authorization rules. + """ + -CurrentVersionParameters: TypeAlias = Union[ConditionalBlockParameters, VelocityLimitParams] +class CurrentVersionParametersMerchantLockParameters(BaseModel): + merchants: List[CurrentVersionParametersMerchantLockParametersMerchant] + """ + A list of merchant locks defining specific merchants or groups of merchants + (based on descriptors or IDs) that the lock applies to. + """ + + +CurrentVersionParameters: TypeAlias = Union[ + ConditionalBlockParameters, VelocityLimitParams, CurrentVersionParametersMerchantLockParameters +] class CurrentVersion(BaseModel): @@ -23,7 +66,39 @@ class CurrentVersion(BaseModel): """ -DraftVersionParameters: TypeAlias = Union[ConditionalBlockParameters, VelocityLimitParams] +class DraftVersionParametersMerchantLockParametersMerchant(BaseModel): + comment: Optional[str] = None + """ + A comment or explanation about the merchant, used internally for rule management + purposes. + """ + + descriptor: Optional[str] = None + """ + Short description of the merchant, often used to provide more human-readable + context about the transaction merchant. This is typically the name or label + shown on transaction summaries. + """ + + merchant_id: Optional[str] = None + """Unique alphanumeric identifier for the payment card acceptor (merchant). + + This attribute specifies the merchant entity that will be locked or referenced + for authorization rules. + """ + + +class DraftVersionParametersMerchantLockParameters(BaseModel): + merchants: List[DraftVersionParametersMerchantLockParametersMerchant] + """ + A list of merchant locks defining specific merchants or groups of merchants + (based on descriptors or IDs) that the lock applies to. + """ + + +DraftVersionParameters: TypeAlias = Union[ + ConditionalBlockParameters, VelocityLimitParams, DraftVersionParametersMerchantLockParameters +] class DraftVersion(BaseModel): @@ -60,7 +135,7 @@ class V2UpdateResponse(BaseModel): state: Literal["ACTIVE", "INACTIVE"] """The state of the Auth Rule""" - type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT"] + type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT", "MERCHANT_LOCK"] """The type of Auth Rule""" excluded_card_tokens: Optional[List[str]] = None diff --git a/src/lithic/types/book_transfer_create_params.py b/src/lithic/types/book_transfer_create_params.py index 672fb095..73cd8287 100644 --- a/src/lithic/types/book_transfer_create_params.py +++ b/src/lithic/types/book_transfer_create_params.py @@ -67,6 +67,7 @@ class BookTransferCreateParams(TypedDict, total=False): "INACTIVITY_FEE_DOWN", "PROVISIONAL_CREDIT", "DISPUTE_WON", + "SERVICE", "TRANSFER", ] ] diff --git a/src/lithic/types/financial_accounts/statements/statement_line_items.py b/src/lithic/types/financial_accounts/statements/statement_line_items.py index 3b9bc40e..5016fd58 100644 --- a/src/lithic/types/financial_accounts/statements/statement_line_items.py +++ b/src/lithic/types/financial_accounts/statements/statement_line_items.py @@ -103,6 +103,7 @@ class Data(BaseModel): "LOSS_WRITE_OFF", "PROVISIONAL_CREDIT", "PROVISIONAL_CREDIT_REVERSAL", + "SERVICE", "RETURN", "RETURN_REVERSAL", "TRANSFER", diff --git a/src/lithic/types/financial_transaction.py b/src/lithic/types/financial_transaction.py index ecbbade3..0865928d 100644 --- a/src/lithic/types/financial_transaction.py +++ b/src/lithic/types/financial_transaction.py @@ -89,6 +89,7 @@ class Event(BaseModel): "LOSS_WRITE_OFF", "PROVISIONAL_CREDIT", "PROVISIONAL_CREDIT_REVERSAL", + "SERVICE", "RETURN", "RETURN_REVERSAL", "TRANSFER", diff --git a/tests/api_resources/auth_rules/test_v2.py b/tests/api_resources/auth_rules/test_v2.py index 0f7e7bb6..a86f4016 100644 --- a/tests/api_resources/auth_rules/test_v2.py +++ b/tests/api_resources/auth_rules/test_v2.py @@ -370,6 +370,7 @@ def test_method_list_with_all_params(self, client: Lithic) -> None: card_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ending_before="ending_before", page_size=1, + scope="PROGRAM", starting_after="starting_after", ) assert_matches_type(SyncCursorPage[V2ListResponse], v2, path=["response"]) @@ -1044,6 +1045,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncLithic) -> N card_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ending_before="ending_before", page_size=1, + scope="PROGRAM", starting_after="starting_after", ) assert_matches_type(AsyncCursorPage[V2ListResponse], v2, path=["response"]) From 3744686ee32cf76a1b7b3f242dbd56624fdb7fe2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 29 Apr 2025 17:33:20 +0000 Subject: [PATCH 6/6] release: 0.91.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 16 ++++++++++++++++ pyproject.toml | 2 +- src/lithic/_version.py | 2 +- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index ccb3566a..29c535cb 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.90.3" + ".": "0.91.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c830c28..7ee40f0c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## 0.91.0 (2025-04-29) + +Full Changelog: [v0.90.3...v0.91.0](https://github.com/lithic-com/lithic-python/compare/v0.90.3...v0.91.0) + +### Features + +* **api:** adds new merchant lock Auth Rule ([649c467](https://github.com/lithic-com/lithic-python/commit/649c467ede30d36ab20edb8df90afb7a9c69b8eb)) + + +### Chores + +* broadly detect json family of content-type headers ([0f14461](https://github.com/lithic-com/lithic-python/commit/0f144611e50f58ad31d3a8d7cc508f46be86c698)) +* **ci:** only use depot for staging repos ([3c98e4a](https://github.com/lithic-com/lithic-python/commit/3c98e4af4ca05552fcfa4181917cdd7cd3f27b30)) +* **ci:** run on more branches and use depot runners ([0e3086d](https://github.com/lithic-com/lithic-python/commit/0e3086d630295afedb1f2925cee8ef660ff90853)) +* **internal:** minor formatting changes ([b8f48c2](https://github.com/lithic-com/lithic-python/commit/b8f48c2c07fc10aa924e5c7f729596312749fbe8)) + ## 0.90.3 (2025-04-22) Full Changelog: [v0.90.2...v0.90.3](https://github.com/lithic-com/lithic-python/compare/v0.90.2...v0.90.3) diff --git a/pyproject.toml b/pyproject.toml index 9492773b..a7cdab1d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "lithic" -version = "0.90.3" +version = "0.91.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 92b76556..039c959a 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.90.3" # x-release-please-version +__version__ = "0.91.0" # x-release-please-version