diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1219cf77..4a08a424 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,10 +35,10 @@ jobs: - name: Run lints run: ./scripts/lint - upload: + build: if: github.repository == 'stainless-sdks/lithic-python' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork) timeout-minutes: 10 - name: upload + name: build permissions: contents: read id-token: write @@ -46,6 +46,20 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Install Rye + run: | + curl -sSf https://rye.astral.sh/get | bash + echo "$HOME/.rye/shims" >> $GITHUB_PATH + env: + RYE_VERSION: '0.44.0' + RYE_INSTALL_OPTION: '--yes' + + - name: Install dependencies + run: rye sync --all-features + + - name: Run build + run: rye build + - name: Get GitHub OIDC Token id: github-oidc uses: actions/github-script@v6 diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 2292ca70..d486cde7 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.95.0" + ".": "0.96.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index ba657b97..bcc65975 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 164 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-aa684ff2a2af585fe502a6e44520ddd883f5141a1113fc9dbe7830027842aa09.yml -openapi_spec_hash: b58989fdc04768fc1eb758e180c5f128 -config_hash: 1a83dceb58f6f525b19a5775018db7e8 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-80f2056989855259782c8e23b9b95530b708b87669d2ba82594ecfee843b4db3.yml +openapi_spec_hash: 160aa2f0e95a7be3ad9d68390ae9aa7c +config_hash: a5d12cd64a37624cbe350cd7b2380693 diff --git a/CHANGELOG.md b/CHANGELOG.md index dd41ec7b..e4ab78b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## 0.96.0 (2025-07-02) + +Full Changelog: [v0.95.0...v0.96.0](https://github.com/lithic-com/lithic-python/compare/v0.95.0...v0.96.0) + +### Features + +* **api:** add models for merchant_lock_parameters and conditional_3ds_action_parameters ([6dcfc0d](https://github.com/lithic-com/lithic-python/commit/6dcfc0dc2ea8e25b316317c3c99d34c9beb92465)) +* **api:** api update ([9387b8d](https://github.com/lithic-com/lithic-python/commit/9387b8dcd62abdea2f001dad29fc5f85f1d31f29)) + + +### Chores + +* **ci:** change upload type ([58fae0a](https://github.com/lithic-com/lithic-python/commit/58fae0a7c82b38bed1b3adc9a6077ab2d232ccba)) + ## 0.95.0 (2025-06-29) Full Changelog: [v0.94.0...v0.95.0](https://github.com/lithic-com/lithic-python/compare/v0.94.0...v0.95.0) diff --git a/api.md b/api.md index 5a10a649..c9f9805a 100644 --- a/api.md +++ b/api.md @@ -81,8 +81,10 @@ Types: from lithic.types.auth_rules import ( AuthRule, AuthRuleCondition, + Conditional3DSActionParameters, ConditionalAttribute, ConditionalBlockParameters, + MerchantLockParameters, RuleStats, VelocityLimitParams, VelocityLimitParamsPeriodWindow, diff --git a/pyproject.toml b/pyproject.toml index 7a00f8d6..fbb0e843 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "lithic" -version = "0.95.0" +version = "0.96.0" description = "The official Python library for the lithic API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/scripts/utils/upload-artifact.sh b/scripts/utils/upload-artifact.sh index 6a927c77..f0638157 100755 --- a/scripts/utils/upload-artifact.sh +++ b/scripts/utils/upload-artifact.sh @@ -1,7 +1,9 @@ #!/usr/bin/env bash set -exuo pipefail -RESPONSE=$(curl -X POST "$URL" \ +FILENAME=$(basename dist/*.whl) + +RESPONSE=$(curl -X POST "$URL?filename=$FILENAME" \ -H "Authorization: Bearer $AUTH" \ -H "Content-Type: application/json") @@ -12,13 +14,13 @@ if [[ "$SIGNED_URL" == "null" ]]; then exit 1 fi -UPLOAD_RESPONSE=$(tar -cz . | curl -v -X PUT \ - -H "Content-Type: application/gzip" \ - --data-binary @- "$SIGNED_URL" 2>&1) +UPLOAD_RESPONSE=$(curl -v -X PUT \ + -H "Content-Type: binary/octet-stream" \ + --data-binary "@dist/$FILENAME" "$SIGNED_URL" 2>&1) if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then echo -e "\033[32mUploaded build to Stainless storage.\033[0m" - echo -e "\033[32mInstallation: pip install 'https://pkg.stainless.com/s/lithic-python/$SHA'\033[0m" + echo -e "\033[32mInstallation: pip install 'https://pkg.stainless.com/s/lithic-python/$SHA/$FILENAME'\033[0m" else echo -e "\033[31mFailed to upload artifact.\033[0m" exit 1 diff --git a/src/lithic/_version.py b/src/lithic/_version.py index 6dbf48d0..d0e6eb5c 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.95.0" # x-release-please-version +__version__ = "0.96.0" # x-release-please-version diff --git a/src/lithic/types/auth_rules/__init__.py b/src/lithic/types/auth_rules/__init__.py index cb697fd1..ebfa23a1 100644 --- a/src/lithic/types/auth_rules/__init__.py +++ b/src/lithic/types/auth_rules/__init__.py @@ -19,10 +19,16 @@ from .v2_retrieve_response import V2RetrieveResponse as V2RetrieveResponse from .conditional_attribute import ConditionalAttribute as ConditionalAttribute from .velocity_limit_params import VelocityLimitParams as VelocityLimitParams +from .merchant_lock_parameters import MerchantLockParameters as MerchantLockParameters from .auth_rule_condition_param import AuthRuleConditionParam as AuthRuleConditionParam from .v2_retrieve_report_params import V2RetrieveReportParams as V2RetrieveReportParams from .v2_retrieve_report_response import V2RetrieveReportResponse as V2RetrieveReportResponse from .velocity_limit_params_param import VelocityLimitParamsParam as VelocityLimitParamsParam from .conditional_block_parameters import ConditionalBlockParameters as ConditionalBlockParameters +from .merchant_lock_parameters_param import MerchantLockParametersParam as MerchantLockParametersParam +from .conditional_3ds_action_parameters import Conditional3DSActionParameters as Conditional3DSActionParameters from .conditional_block_parameters_param import ConditionalBlockParametersParam as ConditionalBlockParametersParam from .velocity_limit_params_period_window import VelocityLimitParamsPeriodWindow as VelocityLimitParamsPeriodWindow +from .conditional_3ds_action_parameters_param import ( + Conditional3DSActionParametersParam as Conditional3DSActionParametersParam, +) diff --git a/src/lithic/types/auth_rules/conditional_3ds_action_parameters.py b/src/lithic/types/auth_rules/conditional_3ds_action_parameters.py new file mode 100644 index 00000000..a03f21ff --- /dev/null +++ b/src/lithic/types/auth_rules/conditional_3ds_action_parameters.py @@ -0,0 +1,63 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["Conditional3DSActionParameters", "Condition"] + + +class Condition(BaseModel): + attribute: Optional[ + Literal[ + "MCC", + "COUNTRY", + "CURRENCY", + "MERCHANT_ID", + "DESCRIPTOR", + "TRANSACTION_AMOUNT", + "RISK_SCORE", + "MESSAGE_CATEGORY", + ] + ] = None + """The attribute to target. + + The following attributes may be targeted: + + - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a + business by the types of goods or services it provides. + - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all + ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for + Netherlands Antilles. + - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of + the transaction. + - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor + (merchant). + - `DESCRIPTOR`: Short description of card acceptor. + - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer + fee field in the settlement/cardholder billing currency. This is the amount + the issuer should authorize against unless the issuer is paying the acquirer + fee on behalf of the cardholder. + - `RISK_SCORE`: Network-provided score assessing risk level associated with a + given authentication. Scores are on a range of 0-999, with 0 representing the + lowest risk and 999 representing the highest risk. For Visa transactions, + where the raw score has a range of 0-99, Lithic will normalize the score by + multiplying the raw score by 10x. + - `MESSAGE_CATEGORY`: The category of the authentication being processed. + """ + + operation: Optional[ + Literal["IS_ONE_OF", "IS_NOT_ONE_OF", "MATCHES", "DOES_NOT_MATCH", "IS_GREATER_THAN", "IS_LESS_THAN"] + ] = None + """The operation to apply to the attribute""" + + value: Union[str, int, List[str], None] = None + """A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`""" + + +class Conditional3DSActionParameters(BaseModel): + action: Literal["DECLINE", "CHALLENGE"] + """The action to take if the conditions are met.""" + + conditions: List[Condition] diff --git a/src/lithic/types/auth_rules/conditional_3ds_action_parameters_param.py b/src/lithic/types/auth_rules/conditional_3ds_action_parameters_param.py new file mode 100644 index 00000000..dee3e85c --- /dev/null +++ b/src/lithic/types/auth_rules/conditional_3ds_action_parameters_param.py @@ -0,0 +1,59 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Union, Iterable +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["Conditional3DSActionParametersParam", "Condition"] + + +class Condition(TypedDict, total=False): + attribute: Literal[ + "MCC", + "COUNTRY", + "CURRENCY", + "MERCHANT_ID", + "DESCRIPTOR", + "TRANSACTION_AMOUNT", + "RISK_SCORE", + "MESSAGE_CATEGORY", + ] + """The attribute to target. + + The following attributes may be targeted: + + - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a + business by the types of goods or services it provides. + - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all + ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for + Netherlands Antilles. + - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of + the transaction. + - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor + (merchant). + - `DESCRIPTOR`: Short description of card acceptor. + - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer + fee field in the settlement/cardholder billing currency. This is the amount + the issuer should authorize against unless the issuer is paying the acquirer + fee on behalf of the cardholder. + - `RISK_SCORE`: Network-provided score assessing risk level associated with a + given authentication. Scores are on a range of 0-999, with 0 representing the + lowest risk and 999 representing the highest risk. For Visa transactions, + where the raw score has a range of 0-99, Lithic will normalize the score by + multiplying the raw score by 10x. + - `MESSAGE_CATEGORY`: The category of the authentication being processed. + """ + + operation: Literal["IS_ONE_OF", "IS_NOT_ONE_OF", "MATCHES", "DOES_NOT_MATCH", "IS_GREATER_THAN", "IS_LESS_THAN"] + """The operation to apply to the attribute""" + + value: Union[str, int, List[str]] + """A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`""" + + +class Conditional3DSActionParametersParam(TypedDict, total=False): + action: Required[Literal["DECLINE", "CHALLENGE"]] + """The action to take if the conditions are met.""" + + conditions: Required[Iterable[Condition]] diff --git a/src/lithic/types/auth_rules/merchant_lock_parameters.py b/src/lithic/types/auth_rules/merchant_lock_parameters.py new file mode 100644 index 00000000..dcb5eb10 --- /dev/null +++ b/src/lithic/types/auth_rules/merchant_lock_parameters.py @@ -0,0 +1,37 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["MerchantLockParameters", "Merchant"] + + +class Merchant(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 MerchantLockParameters(BaseModel): + merchants: List[Merchant] + """ + A list of merchant locks defining specific merchants or groups of merchants + (based on descriptors or IDs) that the lock applies to. + """ diff --git a/src/lithic/types/auth_rules/merchant_lock_parameters_param.py b/src/lithic/types/auth_rules/merchant_lock_parameters_param.py new file mode 100644 index 00000000..bfaf2dcb --- /dev/null +++ b/src/lithic/types/auth_rules/merchant_lock_parameters_param.py @@ -0,0 +1,38 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["MerchantLockParametersParam", "Merchant"] + + +class Merchant(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 MerchantLockParametersParam(TypedDict, total=False): + merchants: Required[Iterable[Merchant]] + """ + A list of merchant locks defining specific merchants or groups of merchants + (based on descriptors or IDs) that the lock applies to. + """ diff --git a/src/lithic/types/auth_rules/v2_apply_response.py b/src/lithic/types/auth_rules/v2_apply_response.py index 3836bdda..c42cfb03 100644 --- a/src/lithic/types/auth_rules/v2_apply_response.py +++ b/src/lithic/types/auth_rules/v2_apply_response.py @@ -5,115 +5,14 @@ from ..._models import BaseModel from .velocity_limit_params import VelocityLimitParams +from .merchant_lock_parameters import MerchantLockParameters from .conditional_block_parameters import ConditionalBlockParameters +from .conditional_3ds_action_parameters import Conditional3DSActionParameters -__all__ = [ - "V2ApplyResponse", - "CurrentVersion", - "CurrentVersionParameters", - "CurrentVersionParametersMerchantLockParameters", - "CurrentVersionParametersMerchantLockParametersMerchant", - "CurrentVersionParametersConditional3DSActionParameters", - "CurrentVersionParametersConditional3DsActionParametersCondition", - "DraftVersion", - "DraftVersionParameters", - "DraftVersionParametersMerchantLockParameters", - "DraftVersionParametersMerchantLockParametersMerchant", - "DraftVersionParametersConditional3DSActionParameters", - "DraftVersionParametersConditional3DsActionParametersCondition", -] - - -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. - """ - - -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. - """ - - -class CurrentVersionParametersConditional3DsActionParametersCondition(BaseModel): - attribute: Optional[ - Literal[ - "MCC", - "COUNTRY", - "CURRENCY", - "MERCHANT_ID", - "DESCRIPTOR", - "TRANSACTION_AMOUNT", - "RISK_SCORE", - "MESSAGE_CATEGORY", - ] - ] = None - """The attribute to target. - - The following attributes may be targeted: - - - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a - business by the types of goods or services it provides. - - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all - ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for - Netherlands Antilles. - - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of - the transaction. - - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor - (merchant). - - `DESCRIPTOR`: Short description of card acceptor. - - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer - fee field in the settlement/cardholder billing currency. This is the amount - the issuer should authorize against unless the issuer is paying the acquirer - fee on behalf of the cardholder. - - `RISK_SCORE`: Network-provided score assessing risk level associated with a - given authentication. Scores are on a range of 0-999, with 0 representing the - lowest risk and 999 representing the highest risk. For Visa transactions, - where the raw score has a range of 0-99, Lithic will normalize the score by - multiplying the raw score by 10x. - - `MESSAGE_CATEGORY`: The category of the authentication being processed. - """ - - operation: Optional[ - Literal["IS_ONE_OF", "IS_NOT_ONE_OF", "MATCHES", "DOES_NOT_MATCH", "IS_GREATER_THAN", "IS_LESS_THAN"] - ] = None - """The operation to apply to the attribute""" - - value: Union[str, int, List[str], None] = None - """A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`""" - - -class CurrentVersionParametersConditional3DSActionParameters(BaseModel): - action: Literal["DECLINE", "CHALLENGE"] - """The action to take if the conditions are met.""" - - conditions: List[CurrentVersionParametersConditional3DsActionParametersCondition] - +__all__ = ["V2ApplyResponse", "CurrentVersion", "CurrentVersionParameters", "DraftVersion", "DraftVersionParameters"] CurrentVersionParameters: TypeAlias = Union[ - ConditionalBlockParameters, - VelocityLimitParams, - CurrentVersionParametersMerchantLockParameters, - CurrentVersionParametersConditional3DSActionParameters, + ConditionalBlockParameters, VelocityLimitParams, MerchantLockParameters, Conditional3DSActionParameters ] @@ -128,96 +27,8 @@ class CurrentVersion(BaseModel): """ -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. - """ - - -class DraftVersionParametersConditional3DsActionParametersCondition(BaseModel): - attribute: Optional[ - Literal[ - "MCC", - "COUNTRY", - "CURRENCY", - "MERCHANT_ID", - "DESCRIPTOR", - "TRANSACTION_AMOUNT", - "RISK_SCORE", - "MESSAGE_CATEGORY", - ] - ] = None - """The attribute to target. - - The following attributes may be targeted: - - - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a - business by the types of goods or services it provides. - - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all - ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for - Netherlands Antilles. - - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of - the transaction. - - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor - (merchant). - - `DESCRIPTOR`: Short description of card acceptor. - - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer - fee field in the settlement/cardholder billing currency. This is the amount - the issuer should authorize against unless the issuer is paying the acquirer - fee on behalf of the cardholder. - - `RISK_SCORE`: Network-provided score assessing risk level associated with a - given authentication. Scores are on a range of 0-999, with 0 representing the - lowest risk and 999 representing the highest risk. For Visa transactions, - where the raw score has a range of 0-99, Lithic will normalize the score by - multiplying the raw score by 10x. - - `MESSAGE_CATEGORY`: The category of the authentication being processed. - """ - - operation: Optional[ - Literal["IS_ONE_OF", "IS_NOT_ONE_OF", "MATCHES", "DOES_NOT_MATCH", "IS_GREATER_THAN", "IS_LESS_THAN"] - ] = None - """The operation to apply to the attribute""" - - value: Union[str, int, List[str], None] = None - """A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`""" - - -class DraftVersionParametersConditional3DSActionParameters(BaseModel): - action: Literal["DECLINE", "CHALLENGE"] - """The action to take if the conditions are met.""" - - conditions: List[DraftVersionParametersConditional3DsActionParametersCondition] - - DraftVersionParameters: TypeAlias = Union[ - ConditionalBlockParameters, - VelocityLimitParams, - DraftVersionParametersMerchantLockParameters, - DraftVersionParametersConditional3DSActionParameters, + ConditionalBlockParameters, VelocityLimitParams, MerchantLockParameters, Conditional3DSActionParameters ] diff --git a/src/lithic/types/auth_rules/v2_create_params.py b/src/lithic/types/auth_rules/v2_create_params.py index 62136bf6..283ea9ed 100644 --- a/src/lithic/types/auth_rules/v2_create_params.py +++ b/src/lithic/types/auth_rules/v2_create_params.py @@ -2,32 +2,22 @@ from __future__ import annotations -from typing import List, Union, Iterable, Optional +from typing import List, Union, Optional from typing_extensions import Literal, Required, TypeAlias, TypedDict from .velocity_limit_params_param import VelocityLimitParamsParam +from .merchant_lock_parameters_param import MerchantLockParametersParam from .conditional_block_parameters_param import ConditionalBlockParametersParam +from .conditional_3ds_action_parameters_param import Conditional3DSActionParametersParam __all__ = [ "V2CreateParams", "CreateAuthRuleRequestAccountTokens", "CreateAuthRuleRequestAccountTokensParameters", - "CreateAuthRuleRequestAccountTokensParametersMerchantLockParameters", - "CreateAuthRuleRequestAccountTokensParametersMerchantLockParametersMerchant", - "CreateAuthRuleRequestAccountTokensParametersConditional3DSActionParameters", - "CreateAuthRuleRequestAccountTokensParametersConditional3DsActionParametersCondition", "CreateAuthRuleRequestCardTokens", "CreateAuthRuleRequestCardTokensParameters", - "CreateAuthRuleRequestCardTokensParametersMerchantLockParameters", - "CreateAuthRuleRequestCardTokensParametersMerchantLockParametersMerchant", - "CreateAuthRuleRequestCardTokensParametersConditional3DSActionParameters", - "CreateAuthRuleRequestCardTokensParametersConditional3DsActionParametersCondition", "CreateAuthRuleRequestProgramLevel", "CreateAuthRuleRequestProgramLevelParameters", - "CreateAuthRuleRequestProgramLevelParametersMerchantLockParameters", - "CreateAuthRuleRequestProgramLevelParametersMerchantLockParametersMerchant", - "CreateAuthRuleRequestProgramLevelParametersConditional3DSActionParameters", - "CreateAuthRuleRequestProgramLevelParametersConditional3DsActionParametersCondition", ] @@ -53,92 +43,11 @@ class CreateAuthRuleRequestAccountTokens(TypedDict, total=False): """ -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. - """ - - -class CreateAuthRuleRequestAccountTokensParametersConditional3DsActionParametersCondition(TypedDict, total=False): - attribute: Literal[ - "MCC", - "COUNTRY", - "CURRENCY", - "MERCHANT_ID", - "DESCRIPTOR", - "TRANSACTION_AMOUNT", - "RISK_SCORE", - "MESSAGE_CATEGORY", - ] - """The attribute to target. - - The following attributes may be targeted: - - - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a - business by the types of goods or services it provides. - - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all - ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for - Netherlands Antilles. - - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of - the transaction. - - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor - (merchant). - - `DESCRIPTOR`: Short description of card acceptor. - - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer - fee field in the settlement/cardholder billing currency. This is the amount - the issuer should authorize against unless the issuer is paying the acquirer - fee on behalf of the cardholder. - - `RISK_SCORE`: Network-provided score assessing risk level associated with a - given authentication. Scores are on a range of 0-999, with 0 representing the - lowest risk and 999 representing the highest risk. For Visa transactions, - where the raw score has a range of 0-99, Lithic will normalize the score by - multiplying the raw score by 10x. - - `MESSAGE_CATEGORY`: The category of the authentication being processed. - """ - - operation: Literal["IS_ONE_OF", "IS_NOT_ONE_OF", "MATCHES", "DOES_NOT_MATCH", "IS_GREATER_THAN", "IS_LESS_THAN"] - """The operation to apply to the attribute""" - - value: Union[str, int, List[str]] - """A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`""" - - -class CreateAuthRuleRequestAccountTokensParametersConditional3DSActionParameters(TypedDict, total=False): - action: Required[Literal["DECLINE", "CHALLENGE"]] - """The action to take if the conditions are met.""" - - conditions: Required[Iterable[CreateAuthRuleRequestAccountTokensParametersConditional3DsActionParametersCondition]] - - CreateAuthRuleRequestAccountTokensParameters: TypeAlias = Union[ ConditionalBlockParametersParam, VelocityLimitParamsParam, - CreateAuthRuleRequestAccountTokensParametersMerchantLockParameters, - CreateAuthRuleRequestAccountTokensParametersConditional3DSActionParameters, + MerchantLockParametersParam, + Conditional3DSActionParametersParam, ] @@ -164,92 +73,11 @@ class CreateAuthRuleRequestCardTokens(TypedDict, total=False): """ -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. - """ - - -class CreateAuthRuleRequestCardTokensParametersConditional3DsActionParametersCondition(TypedDict, total=False): - attribute: Literal[ - "MCC", - "COUNTRY", - "CURRENCY", - "MERCHANT_ID", - "DESCRIPTOR", - "TRANSACTION_AMOUNT", - "RISK_SCORE", - "MESSAGE_CATEGORY", - ] - """The attribute to target. - - The following attributes may be targeted: - - - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a - business by the types of goods or services it provides. - - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all - ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for - Netherlands Antilles. - - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of - the transaction. - - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor - (merchant). - - `DESCRIPTOR`: Short description of card acceptor. - - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer - fee field in the settlement/cardholder billing currency. This is the amount - the issuer should authorize against unless the issuer is paying the acquirer - fee on behalf of the cardholder. - - `RISK_SCORE`: Network-provided score assessing risk level associated with a - given authentication. Scores are on a range of 0-999, with 0 representing the - lowest risk and 999 representing the highest risk. For Visa transactions, - where the raw score has a range of 0-99, Lithic will normalize the score by - multiplying the raw score by 10x. - - `MESSAGE_CATEGORY`: The category of the authentication being processed. - """ - - operation: Literal["IS_ONE_OF", "IS_NOT_ONE_OF", "MATCHES", "DOES_NOT_MATCH", "IS_GREATER_THAN", "IS_LESS_THAN"] - """The operation to apply to the attribute""" - - value: Union[str, int, List[str]] - """A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`""" - - -class CreateAuthRuleRequestCardTokensParametersConditional3DSActionParameters(TypedDict, total=False): - action: Required[Literal["DECLINE", "CHALLENGE"]] - """The action to take if the conditions are met.""" - - conditions: Required[Iterable[CreateAuthRuleRequestCardTokensParametersConditional3DsActionParametersCondition]] - - CreateAuthRuleRequestCardTokensParameters: TypeAlias = Union[ ConditionalBlockParametersParam, VelocityLimitParamsParam, - CreateAuthRuleRequestCardTokensParametersMerchantLockParameters, - CreateAuthRuleRequestCardTokensParametersConditional3DSActionParameters, + MerchantLockParametersParam, + Conditional3DSActionParametersParam, ] @@ -278,92 +106,11 @@ class CreateAuthRuleRequestProgramLevel(TypedDict, total=False): """ -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. - """ - - -class CreateAuthRuleRequestProgramLevelParametersConditional3DsActionParametersCondition(TypedDict, total=False): - attribute: Literal[ - "MCC", - "COUNTRY", - "CURRENCY", - "MERCHANT_ID", - "DESCRIPTOR", - "TRANSACTION_AMOUNT", - "RISK_SCORE", - "MESSAGE_CATEGORY", - ] - """The attribute to target. - - The following attributes may be targeted: - - - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a - business by the types of goods or services it provides. - - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all - ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for - Netherlands Antilles. - - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of - the transaction. - - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor - (merchant). - - `DESCRIPTOR`: Short description of card acceptor. - - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer - fee field in the settlement/cardholder billing currency. This is the amount - the issuer should authorize against unless the issuer is paying the acquirer - fee on behalf of the cardholder. - - `RISK_SCORE`: Network-provided score assessing risk level associated with a - given authentication. Scores are on a range of 0-999, with 0 representing the - lowest risk and 999 representing the highest risk. For Visa transactions, - where the raw score has a range of 0-99, Lithic will normalize the score by - multiplying the raw score by 10x. - - `MESSAGE_CATEGORY`: The category of the authentication being processed. - """ - - operation: Literal["IS_ONE_OF", "IS_NOT_ONE_OF", "MATCHES", "DOES_NOT_MATCH", "IS_GREATER_THAN", "IS_LESS_THAN"] - """The operation to apply to the attribute""" - - value: Union[str, int, List[str]] - """A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`""" - - -class CreateAuthRuleRequestProgramLevelParametersConditional3DSActionParameters(TypedDict, total=False): - action: Required[Literal["DECLINE", "CHALLENGE"]] - """The action to take if the conditions are met.""" - - conditions: Required[Iterable[CreateAuthRuleRequestProgramLevelParametersConditional3DsActionParametersCondition]] - - CreateAuthRuleRequestProgramLevelParameters: TypeAlias = Union[ ConditionalBlockParametersParam, VelocityLimitParamsParam, - CreateAuthRuleRequestProgramLevelParametersMerchantLockParameters, - CreateAuthRuleRequestProgramLevelParametersConditional3DSActionParameters, + MerchantLockParametersParam, + Conditional3DSActionParametersParam, ] 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 ba34fa56..20e0525c 100644 --- a/src/lithic/types/auth_rules/v2_create_response.py +++ b/src/lithic/types/auth_rules/v2_create_response.py @@ -5,115 +5,14 @@ from ..._models import BaseModel from .velocity_limit_params import VelocityLimitParams +from .merchant_lock_parameters import MerchantLockParameters from .conditional_block_parameters import ConditionalBlockParameters +from .conditional_3ds_action_parameters import Conditional3DSActionParameters -__all__ = [ - "V2CreateResponse", - "CurrentVersion", - "CurrentVersionParameters", - "CurrentVersionParametersMerchantLockParameters", - "CurrentVersionParametersMerchantLockParametersMerchant", - "CurrentVersionParametersConditional3DSActionParameters", - "CurrentVersionParametersConditional3DsActionParametersCondition", - "DraftVersion", - "DraftVersionParameters", - "DraftVersionParametersMerchantLockParameters", - "DraftVersionParametersMerchantLockParametersMerchant", - "DraftVersionParametersConditional3DSActionParameters", - "DraftVersionParametersConditional3DsActionParametersCondition", -] - - -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. - """ - - -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. - """ - - -class CurrentVersionParametersConditional3DsActionParametersCondition(BaseModel): - attribute: Optional[ - Literal[ - "MCC", - "COUNTRY", - "CURRENCY", - "MERCHANT_ID", - "DESCRIPTOR", - "TRANSACTION_AMOUNT", - "RISK_SCORE", - "MESSAGE_CATEGORY", - ] - ] = None - """The attribute to target. - - The following attributes may be targeted: - - - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a - business by the types of goods or services it provides. - - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all - ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for - Netherlands Antilles. - - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of - the transaction. - - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor - (merchant). - - `DESCRIPTOR`: Short description of card acceptor. - - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer - fee field in the settlement/cardholder billing currency. This is the amount - the issuer should authorize against unless the issuer is paying the acquirer - fee on behalf of the cardholder. - - `RISK_SCORE`: Network-provided score assessing risk level associated with a - given authentication. Scores are on a range of 0-999, with 0 representing the - lowest risk and 999 representing the highest risk. For Visa transactions, - where the raw score has a range of 0-99, Lithic will normalize the score by - multiplying the raw score by 10x. - - `MESSAGE_CATEGORY`: The category of the authentication being processed. - """ - - operation: Optional[ - Literal["IS_ONE_OF", "IS_NOT_ONE_OF", "MATCHES", "DOES_NOT_MATCH", "IS_GREATER_THAN", "IS_LESS_THAN"] - ] = None - """The operation to apply to the attribute""" - - value: Union[str, int, List[str], None] = None - """A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`""" - - -class CurrentVersionParametersConditional3DSActionParameters(BaseModel): - action: Literal["DECLINE", "CHALLENGE"] - """The action to take if the conditions are met.""" - - conditions: List[CurrentVersionParametersConditional3DsActionParametersCondition] - +__all__ = ["V2CreateResponse", "CurrentVersion", "CurrentVersionParameters", "DraftVersion", "DraftVersionParameters"] CurrentVersionParameters: TypeAlias = Union[ - ConditionalBlockParameters, - VelocityLimitParams, - CurrentVersionParametersMerchantLockParameters, - CurrentVersionParametersConditional3DSActionParameters, + ConditionalBlockParameters, VelocityLimitParams, MerchantLockParameters, Conditional3DSActionParameters ] @@ -128,96 +27,8 @@ class CurrentVersion(BaseModel): """ -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. - """ - - -class DraftVersionParametersConditional3DsActionParametersCondition(BaseModel): - attribute: Optional[ - Literal[ - "MCC", - "COUNTRY", - "CURRENCY", - "MERCHANT_ID", - "DESCRIPTOR", - "TRANSACTION_AMOUNT", - "RISK_SCORE", - "MESSAGE_CATEGORY", - ] - ] = None - """The attribute to target. - - The following attributes may be targeted: - - - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a - business by the types of goods or services it provides. - - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all - ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for - Netherlands Antilles. - - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of - the transaction. - - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor - (merchant). - - `DESCRIPTOR`: Short description of card acceptor. - - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer - fee field in the settlement/cardholder billing currency. This is the amount - the issuer should authorize against unless the issuer is paying the acquirer - fee on behalf of the cardholder. - - `RISK_SCORE`: Network-provided score assessing risk level associated with a - given authentication. Scores are on a range of 0-999, with 0 representing the - lowest risk and 999 representing the highest risk. For Visa transactions, - where the raw score has a range of 0-99, Lithic will normalize the score by - multiplying the raw score by 10x. - - `MESSAGE_CATEGORY`: The category of the authentication being processed. - """ - - operation: Optional[ - Literal["IS_ONE_OF", "IS_NOT_ONE_OF", "MATCHES", "DOES_NOT_MATCH", "IS_GREATER_THAN", "IS_LESS_THAN"] - ] = None - """The operation to apply to the attribute""" - - value: Union[str, int, List[str], None] = None - """A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`""" - - -class DraftVersionParametersConditional3DSActionParameters(BaseModel): - action: Literal["DECLINE", "CHALLENGE"] - """The action to take if the conditions are met.""" - - conditions: List[DraftVersionParametersConditional3DsActionParametersCondition] - - DraftVersionParameters: TypeAlias = Union[ - ConditionalBlockParameters, - VelocityLimitParams, - DraftVersionParametersMerchantLockParameters, - DraftVersionParametersConditional3DSActionParameters, + ConditionalBlockParameters, VelocityLimitParams, MerchantLockParameters, Conditional3DSActionParameters ] diff --git a/src/lithic/types/auth_rules/v2_draft_params.py b/src/lithic/types/auth_rules/v2_draft_params.py index b76efb4c..5b90b082 100644 --- a/src/lithic/types/auth_rules/v2_draft_params.py +++ b/src/lithic/types/auth_rules/v2_draft_params.py @@ -2,20 +2,15 @@ from __future__ import annotations -from typing import List, Union, Iterable, Optional -from typing_extensions import Literal, Required, TypeAlias, TypedDict +from typing import Union, Optional +from typing_extensions import TypeAlias, TypedDict from .velocity_limit_params_param import VelocityLimitParamsParam +from .merchant_lock_parameters_param import MerchantLockParametersParam from .conditional_block_parameters_param import ConditionalBlockParametersParam +from .conditional_3ds_action_parameters_param import Conditional3DSActionParametersParam -__all__ = [ - "V2DraftParams", - "Parameters", - "ParametersMerchantLockParameters", - "ParametersMerchantLockParametersMerchant", - "ParametersConditional3DSActionParameters", - "ParametersConditional3DsActionParametersCondition", -] +__all__ = ["V2DraftParams", "Parameters"] class V2DraftParams(TypedDict, total=False): @@ -23,90 +18,9 @@ class V2DraftParams(TypedDict, total=False): """Parameters for the Auth Rule""" -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. - """ - - -class ParametersConditional3DsActionParametersCondition(TypedDict, total=False): - attribute: Literal[ - "MCC", - "COUNTRY", - "CURRENCY", - "MERCHANT_ID", - "DESCRIPTOR", - "TRANSACTION_AMOUNT", - "RISK_SCORE", - "MESSAGE_CATEGORY", - ] - """The attribute to target. - - The following attributes may be targeted: - - - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a - business by the types of goods or services it provides. - - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all - ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for - Netherlands Antilles. - - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of - the transaction. - - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor - (merchant). - - `DESCRIPTOR`: Short description of card acceptor. - - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer - fee field in the settlement/cardholder billing currency. This is the amount - the issuer should authorize against unless the issuer is paying the acquirer - fee on behalf of the cardholder. - - `RISK_SCORE`: Network-provided score assessing risk level associated with a - given authentication. Scores are on a range of 0-999, with 0 representing the - lowest risk and 999 representing the highest risk. For Visa transactions, - where the raw score has a range of 0-99, Lithic will normalize the score by - multiplying the raw score by 10x. - - `MESSAGE_CATEGORY`: The category of the authentication being processed. - """ - - operation: Literal["IS_ONE_OF", "IS_NOT_ONE_OF", "MATCHES", "DOES_NOT_MATCH", "IS_GREATER_THAN", "IS_LESS_THAN"] - """The operation to apply to the attribute""" - - value: Union[str, int, List[str]] - """A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`""" - - -class ParametersConditional3DSActionParameters(TypedDict, total=False): - action: Required[Literal["DECLINE", "CHALLENGE"]] - """The action to take if the conditions are met.""" - - conditions: Required[Iterable[ParametersConditional3DsActionParametersCondition]] - - Parameters: TypeAlias = Union[ ConditionalBlockParametersParam, VelocityLimitParamsParam, - ParametersMerchantLockParameters, - ParametersConditional3DSActionParameters, + MerchantLockParametersParam, + Conditional3DSActionParametersParam, ] diff --git a/src/lithic/types/auth_rules/v2_draft_response.py b/src/lithic/types/auth_rules/v2_draft_response.py index 870bed39..db688f4a 100644 --- a/src/lithic/types/auth_rules/v2_draft_response.py +++ b/src/lithic/types/auth_rules/v2_draft_response.py @@ -5,115 +5,14 @@ from ..._models import BaseModel from .velocity_limit_params import VelocityLimitParams +from .merchant_lock_parameters import MerchantLockParameters from .conditional_block_parameters import ConditionalBlockParameters +from .conditional_3ds_action_parameters import Conditional3DSActionParameters -__all__ = [ - "V2DraftResponse", - "CurrentVersion", - "CurrentVersionParameters", - "CurrentVersionParametersMerchantLockParameters", - "CurrentVersionParametersMerchantLockParametersMerchant", - "CurrentVersionParametersConditional3DSActionParameters", - "CurrentVersionParametersConditional3DsActionParametersCondition", - "DraftVersion", - "DraftVersionParameters", - "DraftVersionParametersMerchantLockParameters", - "DraftVersionParametersMerchantLockParametersMerchant", - "DraftVersionParametersConditional3DSActionParameters", - "DraftVersionParametersConditional3DsActionParametersCondition", -] - - -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. - """ - - -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. - """ - - -class CurrentVersionParametersConditional3DsActionParametersCondition(BaseModel): - attribute: Optional[ - Literal[ - "MCC", - "COUNTRY", - "CURRENCY", - "MERCHANT_ID", - "DESCRIPTOR", - "TRANSACTION_AMOUNT", - "RISK_SCORE", - "MESSAGE_CATEGORY", - ] - ] = None - """The attribute to target. - - The following attributes may be targeted: - - - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a - business by the types of goods or services it provides. - - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all - ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for - Netherlands Antilles. - - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of - the transaction. - - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor - (merchant). - - `DESCRIPTOR`: Short description of card acceptor. - - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer - fee field in the settlement/cardholder billing currency. This is the amount - the issuer should authorize against unless the issuer is paying the acquirer - fee on behalf of the cardholder. - - `RISK_SCORE`: Network-provided score assessing risk level associated with a - given authentication. Scores are on a range of 0-999, with 0 representing the - lowest risk and 999 representing the highest risk. For Visa transactions, - where the raw score has a range of 0-99, Lithic will normalize the score by - multiplying the raw score by 10x. - - `MESSAGE_CATEGORY`: The category of the authentication being processed. - """ - - operation: Optional[ - Literal["IS_ONE_OF", "IS_NOT_ONE_OF", "MATCHES", "DOES_NOT_MATCH", "IS_GREATER_THAN", "IS_LESS_THAN"] - ] = None - """The operation to apply to the attribute""" - - value: Union[str, int, List[str], None] = None - """A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`""" - - -class CurrentVersionParametersConditional3DSActionParameters(BaseModel): - action: Literal["DECLINE", "CHALLENGE"] - """The action to take if the conditions are met.""" - - conditions: List[CurrentVersionParametersConditional3DsActionParametersCondition] - +__all__ = ["V2DraftResponse", "CurrentVersion", "CurrentVersionParameters", "DraftVersion", "DraftVersionParameters"] CurrentVersionParameters: TypeAlias = Union[ - ConditionalBlockParameters, - VelocityLimitParams, - CurrentVersionParametersMerchantLockParameters, - CurrentVersionParametersConditional3DSActionParameters, + ConditionalBlockParameters, VelocityLimitParams, MerchantLockParameters, Conditional3DSActionParameters ] @@ -128,96 +27,8 @@ class CurrentVersion(BaseModel): """ -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. - """ - - -class DraftVersionParametersConditional3DsActionParametersCondition(BaseModel): - attribute: Optional[ - Literal[ - "MCC", - "COUNTRY", - "CURRENCY", - "MERCHANT_ID", - "DESCRIPTOR", - "TRANSACTION_AMOUNT", - "RISK_SCORE", - "MESSAGE_CATEGORY", - ] - ] = None - """The attribute to target. - - The following attributes may be targeted: - - - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a - business by the types of goods or services it provides. - - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all - ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for - Netherlands Antilles. - - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of - the transaction. - - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor - (merchant). - - `DESCRIPTOR`: Short description of card acceptor. - - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer - fee field in the settlement/cardholder billing currency. This is the amount - the issuer should authorize against unless the issuer is paying the acquirer - fee on behalf of the cardholder. - - `RISK_SCORE`: Network-provided score assessing risk level associated with a - given authentication. Scores are on a range of 0-999, with 0 representing the - lowest risk and 999 representing the highest risk. For Visa transactions, - where the raw score has a range of 0-99, Lithic will normalize the score by - multiplying the raw score by 10x. - - `MESSAGE_CATEGORY`: The category of the authentication being processed. - """ - - operation: Optional[ - Literal["IS_ONE_OF", "IS_NOT_ONE_OF", "MATCHES", "DOES_NOT_MATCH", "IS_GREATER_THAN", "IS_LESS_THAN"] - ] = None - """The operation to apply to the attribute""" - - value: Union[str, int, List[str], None] = None - """A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`""" - - -class DraftVersionParametersConditional3DSActionParameters(BaseModel): - action: Literal["DECLINE", "CHALLENGE"] - """The action to take if the conditions are met.""" - - conditions: List[DraftVersionParametersConditional3DsActionParametersCondition] - - DraftVersionParameters: TypeAlias = Union[ - ConditionalBlockParameters, - VelocityLimitParams, - DraftVersionParametersMerchantLockParameters, - DraftVersionParametersConditional3DSActionParameters, + ConditionalBlockParameters, VelocityLimitParams, MerchantLockParameters, Conditional3DSActionParameters ] diff --git a/src/lithic/types/auth_rules/v2_list_response.py b/src/lithic/types/auth_rules/v2_list_response.py index 182dc3f1..48b3e1af 100644 --- a/src/lithic/types/auth_rules/v2_list_response.py +++ b/src/lithic/types/auth_rules/v2_list_response.py @@ -5,115 +5,14 @@ from ..._models import BaseModel from .velocity_limit_params import VelocityLimitParams +from .merchant_lock_parameters import MerchantLockParameters from .conditional_block_parameters import ConditionalBlockParameters +from .conditional_3ds_action_parameters import Conditional3DSActionParameters -__all__ = [ - "V2ListResponse", - "CurrentVersion", - "CurrentVersionParameters", - "CurrentVersionParametersMerchantLockParameters", - "CurrentVersionParametersMerchantLockParametersMerchant", - "CurrentVersionParametersConditional3DSActionParameters", - "CurrentVersionParametersConditional3DsActionParametersCondition", - "DraftVersion", - "DraftVersionParameters", - "DraftVersionParametersMerchantLockParameters", - "DraftVersionParametersMerchantLockParametersMerchant", - "DraftVersionParametersConditional3DSActionParameters", - "DraftVersionParametersConditional3DsActionParametersCondition", -] - - -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. - """ - - -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. - """ - - -class CurrentVersionParametersConditional3DsActionParametersCondition(BaseModel): - attribute: Optional[ - Literal[ - "MCC", - "COUNTRY", - "CURRENCY", - "MERCHANT_ID", - "DESCRIPTOR", - "TRANSACTION_AMOUNT", - "RISK_SCORE", - "MESSAGE_CATEGORY", - ] - ] = None - """The attribute to target. - - The following attributes may be targeted: - - - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a - business by the types of goods or services it provides. - - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all - ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for - Netherlands Antilles. - - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of - the transaction. - - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor - (merchant). - - `DESCRIPTOR`: Short description of card acceptor. - - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer - fee field in the settlement/cardholder billing currency. This is the amount - the issuer should authorize against unless the issuer is paying the acquirer - fee on behalf of the cardholder. - - `RISK_SCORE`: Network-provided score assessing risk level associated with a - given authentication. Scores are on a range of 0-999, with 0 representing the - lowest risk and 999 representing the highest risk. For Visa transactions, - where the raw score has a range of 0-99, Lithic will normalize the score by - multiplying the raw score by 10x. - - `MESSAGE_CATEGORY`: The category of the authentication being processed. - """ - - operation: Optional[ - Literal["IS_ONE_OF", "IS_NOT_ONE_OF", "MATCHES", "DOES_NOT_MATCH", "IS_GREATER_THAN", "IS_LESS_THAN"] - ] = None - """The operation to apply to the attribute""" - - value: Union[str, int, List[str], None] = None - """A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`""" - - -class CurrentVersionParametersConditional3DSActionParameters(BaseModel): - action: Literal["DECLINE", "CHALLENGE"] - """The action to take if the conditions are met.""" - - conditions: List[CurrentVersionParametersConditional3DsActionParametersCondition] - +__all__ = ["V2ListResponse", "CurrentVersion", "CurrentVersionParameters", "DraftVersion", "DraftVersionParameters"] CurrentVersionParameters: TypeAlias = Union[ - ConditionalBlockParameters, - VelocityLimitParams, - CurrentVersionParametersMerchantLockParameters, - CurrentVersionParametersConditional3DSActionParameters, + ConditionalBlockParameters, VelocityLimitParams, MerchantLockParameters, Conditional3DSActionParameters ] @@ -128,96 +27,8 @@ class CurrentVersion(BaseModel): """ -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. - """ - - -class DraftVersionParametersConditional3DsActionParametersCondition(BaseModel): - attribute: Optional[ - Literal[ - "MCC", - "COUNTRY", - "CURRENCY", - "MERCHANT_ID", - "DESCRIPTOR", - "TRANSACTION_AMOUNT", - "RISK_SCORE", - "MESSAGE_CATEGORY", - ] - ] = None - """The attribute to target. - - The following attributes may be targeted: - - - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a - business by the types of goods or services it provides. - - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all - ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for - Netherlands Antilles. - - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of - the transaction. - - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor - (merchant). - - `DESCRIPTOR`: Short description of card acceptor. - - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer - fee field in the settlement/cardholder billing currency. This is the amount - the issuer should authorize against unless the issuer is paying the acquirer - fee on behalf of the cardholder. - - `RISK_SCORE`: Network-provided score assessing risk level associated with a - given authentication. Scores are on a range of 0-999, with 0 representing the - lowest risk and 999 representing the highest risk. For Visa transactions, - where the raw score has a range of 0-99, Lithic will normalize the score by - multiplying the raw score by 10x. - - `MESSAGE_CATEGORY`: The category of the authentication being processed. - """ - - operation: Optional[ - Literal["IS_ONE_OF", "IS_NOT_ONE_OF", "MATCHES", "DOES_NOT_MATCH", "IS_GREATER_THAN", "IS_LESS_THAN"] - ] = None - """The operation to apply to the attribute""" - - value: Union[str, int, List[str], None] = None - """A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`""" - - -class DraftVersionParametersConditional3DSActionParameters(BaseModel): - action: Literal["DECLINE", "CHALLENGE"] - """The action to take if the conditions are met.""" - - conditions: List[DraftVersionParametersConditional3DsActionParametersCondition] - - DraftVersionParameters: TypeAlias = Union[ - ConditionalBlockParameters, - VelocityLimitParams, - DraftVersionParametersMerchantLockParameters, - DraftVersionParametersConditional3DSActionParameters, + ConditionalBlockParameters, VelocityLimitParams, MerchantLockParameters, Conditional3DSActionParameters ] diff --git a/src/lithic/types/auth_rules/v2_promote_response.py b/src/lithic/types/auth_rules/v2_promote_response.py index 590561b4..e6a1159f 100644 --- a/src/lithic/types/auth_rules/v2_promote_response.py +++ b/src/lithic/types/auth_rules/v2_promote_response.py @@ -5,115 +5,14 @@ from ..._models import BaseModel from .velocity_limit_params import VelocityLimitParams +from .merchant_lock_parameters import MerchantLockParameters from .conditional_block_parameters import ConditionalBlockParameters +from .conditional_3ds_action_parameters import Conditional3DSActionParameters -__all__ = [ - "V2PromoteResponse", - "CurrentVersion", - "CurrentVersionParameters", - "CurrentVersionParametersMerchantLockParameters", - "CurrentVersionParametersMerchantLockParametersMerchant", - "CurrentVersionParametersConditional3DSActionParameters", - "CurrentVersionParametersConditional3DsActionParametersCondition", - "DraftVersion", - "DraftVersionParameters", - "DraftVersionParametersMerchantLockParameters", - "DraftVersionParametersMerchantLockParametersMerchant", - "DraftVersionParametersConditional3DSActionParameters", - "DraftVersionParametersConditional3DsActionParametersCondition", -] - - -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. - """ - - -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. - """ - - -class CurrentVersionParametersConditional3DsActionParametersCondition(BaseModel): - attribute: Optional[ - Literal[ - "MCC", - "COUNTRY", - "CURRENCY", - "MERCHANT_ID", - "DESCRIPTOR", - "TRANSACTION_AMOUNT", - "RISK_SCORE", - "MESSAGE_CATEGORY", - ] - ] = None - """The attribute to target. - - The following attributes may be targeted: - - - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a - business by the types of goods or services it provides. - - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all - ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for - Netherlands Antilles. - - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of - the transaction. - - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor - (merchant). - - `DESCRIPTOR`: Short description of card acceptor. - - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer - fee field in the settlement/cardholder billing currency. This is the amount - the issuer should authorize against unless the issuer is paying the acquirer - fee on behalf of the cardholder. - - `RISK_SCORE`: Network-provided score assessing risk level associated with a - given authentication. Scores are on a range of 0-999, with 0 representing the - lowest risk and 999 representing the highest risk. For Visa transactions, - where the raw score has a range of 0-99, Lithic will normalize the score by - multiplying the raw score by 10x. - - `MESSAGE_CATEGORY`: The category of the authentication being processed. - """ - - operation: Optional[ - Literal["IS_ONE_OF", "IS_NOT_ONE_OF", "MATCHES", "DOES_NOT_MATCH", "IS_GREATER_THAN", "IS_LESS_THAN"] - ] = None - """The operation to apply to the attribute""" - - value: Union[str, int, List[str], None] = None - """A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`""" - - -class CurrentVersionParametersConditional3DSActionParameters(BaseModel): - action: Literal["DECLINE", "CHALLENGE"] - """The action to take if the conditions are met.""" - - conditions: List[CurrentVersionParametersConditional3DsActionParametersCondition] - +__all__ = ["V2PromoteResponse", "CurrentVersion", "CurrentVersionParameters", "DraftVersion", "DraftVersionParameters"] CurrentVersionParameters: TypeAlias = Union[ - ConditionalBlockParameters, - VelocityLimitParams, - CurrentVersionParametersMerchantLockParameters, - CurrentVersionParametersConditional3DSActionParameters, + ConditionalBlockParameters, VelocityLimitParams, MerchantLockParameters, Conditional3DSActionParameters ] @@ -128,96 +27,8 @@ class CurrentVersion(BaseModel): """ -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. - """ - - -class DraftVersionParametersConditional3DsActionParametersCondition(BaseModel): - attribute: Optional[ - Literal[ - "MCC", - "COUNTRY", - "CURRENCY", - "MERCHANT_ID", - "DESCRIPTOR", - "TRANSACTION_AMOUNT", - "RISK_SCORE", - "MESSAGE_CATEGORY", - ] - ] = None - """The attribute to target. - - The following attributes may be targeted: - - - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a - business by the types of goods or services it provides. - - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all - ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for - Netherlands Antilles. - - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of - the transaction. - - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor - (merchant). - - `DESCRIPTOR`: Short description of card acceptor. - - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer - fee field in the settlement/cardholder billing currency. This is the amount - the issuer should authorize against unless the issuer is paying the acquirer - fee on behalf of the cardholder. - - `RISK_SCORE`: Network-provided score assessing risk level associated with a - given authentication. Scores are on a range of 0-999, with 0 representing the - lowest risk and 999 representing the highest risk. For Visa transactions, - where the raw score has a range of 0-99, Lithic will normalize the score by - multiplying the raw score by 10x. - - `MESSAGE_CATEGORY`: The category of the authentication being processed. - """ - - operation: Optional[ - Literal["IS_ONE_OF", "IS_NOT_ONE_OF", "MATCHES", "DOES_NOT_MATCH", "IS_GREATER_THAN", "IS_LESS_THAN"] - ] = None - """The operation to apply to the attribute""" - - value: Union[str, int, List[str], None] = None - """A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`""" - - -class DraftVersionParametersConditional3DSActionParameters(BaseModel): - action: Literal["DECLINE", "CHALLENGE"] - """The action to take if the conditions are met.""" - - conditions: List[DraftVersionParametersConditional3DsActionParametersCondition] - - DraftVersionParameters: TypeAlias = Union[ - ConditionalBlockParameters, - VelocityLimitParams, - DraftVersionParametersMerchantLockParameters, - DraftVersionParametersConditional3DSActionParameters, + ConditionalBlockParameters, VelocityLimitParams, MerchantLockParameters, Conditional3DSActionParameters ] diff --git a/src/lithic/types/auth_rules/v2_retrieve_response.py b/src/lithic/types/auth_rules/v2_retrieve_response.py index 367602ab..bb055733 100644 --- a/src/lithic/types/auth_rules/v2_retrieve_response.py +++ b/src/lithic/types/auth_rules/v2_retrieve_response.py @@ -5,115 +5,14 @@ from ..._models import BaseModel from .velocity_limit_params import VelocityLimitParams +from .merchant_lock_parameters import MerchantLockParameters from .conditional_block_parameters import ConditionalBlockParameters +from .conditional_3ds_action_parameters import Conditional3DSActionParameters -__all__ = [ - "V2RetrieveResponse", - "CurrentVersion", - "CurrentVersionParameters", - "CurrentVersionParametersMerchantLockParameters", - "CurrentVersionParametersMerchantLockParametersMerchant", - "CurrentVersionParametersConditional3DSActionParameters", - "CurrentVersionParametersConditional3DsActionParametersCondition", - "DraftVersion", - "DraftVersionParameters", - "DraftVersionParametersMerchantLockParameters", - "DraftVersionParametersMerchantLockParametersMerchant", - "DraftVersionParametersConditional3DSActionParameters", - "DraftVersionParametersConditional3DsActionParametersCondition", -] - - -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. - """ - - -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. - """ - - -class CurrentVersionParametersConditional3DsActionParametersCondition(BaseModel): - attribute: Optional[ - Literal[ - "MCC", - "COUNTRY", - "CURRENCY", - "MERCHANT_ID", - "DESCRIPTOR", - "TRANSACTION_AMOUNT", - "RISK_SCORE", - "MESSAGE_CATEGORY", - ] - ] = None - """The attribute to target. - - The following attributes may be targeted: - - - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a - business by the types of goods or services it provides. - - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all - ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for - Netherlands Antilles. - - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of - the transaction. - - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor - (merchant). - - `DESCRIPTOR`: Short description of card acceptor. - - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer - fee field in the settlement/cardholder billing currency. This is the amount - the issuer should authorize against unless the issuer is paying the acquirer - fee on behalf of the cardholder. - - `RISK_SCORE`: Network-provided score assessing risk level associated with a - given authentication. Scores are on a range of 0-999, with 0 representing the - lowest risk and 999 representing the highest risk. For Visa transactions, - where the raw score has a range of 0-99, Lithic will normalize the score by - multiplying the raw score by 10x. - - `MESSAGE_CATEGORY`: The category of the authentication being processed. - """ - - operation: Optional[ - Literal["IS_ONE_OF", "IS_NOT_ONE_OF", "MATCHES", "DOES_NOT_MATCH", "IS_GREATER_THAN", "IS_LESS_THAN"] - ] = None - """The operation to apply to the attribute""" - - value: Union[str, int, List[str], None] = None - """A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`""" - - -class CurrentVersionParametersConditional3DSActionParameters(BaseModel): - action: Literal["DECLINE", "CHALLENGE"] - """The action to take if the conditions are met.""" - - conditions: List[CurrentVersionParametersConditional3DsActionParametersCondition] - +__all__ = ["V2RetrieveResponse", "CurrentVersion", "CurrentVersionParameters", "DraftVersion", "DraftVersionParameters"] CurrentVersionParameters: TypeAlias = Union[ - ConditionalBlockParameters, - VelocityLimitParams, - CurrentVersionParametersMerchantLockParameters, - CurrentVersionParametersConditional3DSActionParameters, + ConditionalBlockParameters, VelocityLimitParams, MerchantLockParameters, Conditional3DSActionParameters ] @@ -128,96 +27,8 @@ class CurrentVersion(BaseModel): """ -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. - """ - - -class DraftVersionParametersConditional3DsActionParametersCondition(BaseModel): - attribute: Optional[ - Literal[ - "MCC", - "COUNTRY", - "CURRENCY", - "MERCHANT_ID", - "DESCRIPTOR", - "TRANSACTION_AMOUNT", - "RISK_SCORE", - "MESSAGE_CATEGORY", - ] - ] = None - """The attribute to target. - - The following attributes may be targeted: - - - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a - business by the types of goods or services it provides. - - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all - ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for - Netherlands Antilles. - - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of - the transaction. - - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor - (merchant). - - `DESCRIPTOR`: Short description of card acceptor. - - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer - fee field in the settlement/cardholder billing currency. This is the amount - the issuer should authorize against unless the issuer is paying the acquirer - fee on behalf of the cardholder. - - `RISK_SCORE`: Network-provided score assessing risk level associated with a - given authentication. Scores are on a range of 0-999, with 0 representing the - lowest risk and 999 representing the highest risk. For Visa transactions, - where the raw score has a range of 0-99, Lithic will normalize the score by - multiplying the raw score by 10x. - - `MESSAGE_CATEGORY`: The category of the authentication being processed. - """ - - operation: Optional[ - Literal["IS_ONE_OF", "IS_NOT_ONE_OF", "MATCHES", "DOES_NOT_MATCH", "IS_GREATER_THAN", "IS_LESS_THAN"] - ] = None - """The operation to apply to the attribute""" - - value: Union[str, int, List[str], None] = None - """A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`""" - - -class DraftVersionParametersConditional3DSActionParameters(BaseModel): - action: Literal["DECLINE", "CHALLENGE"] - """The action to take if the conditions are met.""" - - conditions: List[DraftVersionParametersConditional3DsActionParametersCondition] - - DraftVersionParameters: TypeAlias = Union[ - ConditionalBlockParameters, - VelocityLimitParams, - DraftVersionParametersMerchantLockParameters, - DraftVersionParametersConditional3DSActionParameters, + ConditionalBlockParameters, VelocityLimitParams, MerchantLockParameters, Conditional3DSActionParameters ] diff --git a/src/lithic/types/auth_rules/v2_update_response.py b/src/lithic/types/auth_rules/v2_update_response.py index 97b2f875..17494042 100644 --- a/src/lithic/types/auth_rules/v2_update_response.py +++ b/src/lithic/types/auth_rules/v2_update_response.py @@ -5,115 +5,14 @@ from ..._models import BaseModel from .velocity_limit_params import VelocityLimitParams +from .merchant_lock_parameters import MerchantLockParameters from .conditional_block_parameters import ConditionalBlockParameters +from .conditional_3ds_action_parameters import Conditional3DSActionParameters -__all__ = [ - "V2UpdateResponse", - "CurrentVersion", - "CurrentVersionParameters", - "CurrentVersionParametersMerchantLockParameters", - "CurrentVersionParametersMerchantLockParametersMerchant", - "CurrentVersionParametersConditional3DSActionParameters", - "CurrentVersionParametersConditional3DsActionParametersCondition", - "DraftVersion", - "DraftVersionParameters", - "DraftVersionParametersMerchantLockParameters", - "DraftVersionParametersMerchantLockParametersMerchant", - "DraftVersionParametersConditional3DSActionParameters", - "DraftVersionParametersConditional3DsActionParametersCondition", -] - - -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. - """ - - -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. - """ - - -class CurrentVersionParametersConditional3DsActionParametersCondition(BaseModel): - attribute: Optional[ - Literal[ - "MCC", - "COUNTRY", - "CURRENCY", - "MERCHANT_ID", - "DESCRIPTOR", - "TRANSACTION_AMOUNT", - "RISK_SCORE", - "MESSAGE_CATEGORY", - ] - ] = None - """The attribute to target. - - The following attributes may be targeted: - - - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a - business by the types of goods or services it provides. - - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all - ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for - Netherlands Antilles. - - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of - the transaction. - - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor - (merchant). - - `DESCRIPTOR`: Short description of card acceptor. - - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer - fee field in the settlement/cardholder billing currency. This is the amount - the issuer should authorize against unless the issuer is paying the acquirer - fee on behalf of the cardholder. - - `RISK_SCORE`: Network-provided score assessing risk level associated with a - given authentication. Scores are on a range of 0-999, with 0 representing the - lowest risk and 999 representing the highest risk. For Visa transactions, - where the raw score has a range of 0-99, Lithic will normalize the score by - multiplying the raw score by 10x. - - `MESSAGE_CATEGORY`: The category of the authentication being processed. - """ - - operation: Optional[ - Literal["IS_ONE_OF", "IS_NOT_ONE_OF", "MATCHES", "DOES_NOT_MATCH", "IS_GREATER_THAN", "IS_LESS_THAN"] - ] = None - """The operation to apply to the attribute""" - - value: Union[str, int, List[str], None] = None - """A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`""" - - -class CurrentVersionParametersConditional3DSActionParameters(BaseModel): - action: Literal["DECLINE", "CHALLENGE"] - """The action to take if the conditions are met.""" - - conditions: List[CurrentVersionParametersConditional3DsActionParametersCondition] - +__all__ = ["V2UpdateResponse", "CurrentVersion", "CurrentVersionParameters", "DraftVersion", "DraftVersionParameters"] CurrentVersionParameters: TypeAlias = Union[ - ConditionalBlockParameters, - VelocityLimitParams, - CurrentVersionParametersMerchantLockParameters, - CurrentVersionParametersConditional3DSActionParameters, + ConditionalBlockParameters, VelocityLimitParams, MerchantLockParameters, Conditional3DSActionParameters ] @@ -128,96 +27,8 @@ class CurrentVersion(BaseModel): """ -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. - """ - - -class DraftVersionParametersConditional3DsActionParametersCondition(BaseModel): - attribute: Optional[ - Literal[ - "MCC", - "COUNTRY", - "CURRENCY", - "MERCHANT_ID", - "DESCRIPTOR", - "TRANSACTION_AMOUNT", - "RISK_SCORE", - "MESSAGE_CATEGORY", - ] - ] = None - """The attribute to target. - - The following attributes may be targeted: - - - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a - business by the types of goods or services it provides. - - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all - ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for - Netherlands Antilles. - - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of - the transaction. - - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor - (merchant). - - `DESCRIPTOR`: Short description of card acceptor. - - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer - fee field in the settlement/cardholder billing currency. This is the amount - the issuer should authorize against unless the issuer is paying the acquirer - fee on behalf of the cardholder. - - `RISK_SCORE`: Network-provided score assessing risk level associated with a - given authentication. Scores are on a range of 0-999, with 0 representing the - lowest risk and 999 representing the highest risk. For Visa transactions, - where the raw score has a range of 0-99, Lithic will normalize the score by - multiplying the raw score by 10x. - - `MESSAGE_CATEGORY`: The category of the authentication being processed. - """ - - operation: Optional[ - Literal["IS_ONE_OF", "IS_NOT_ONE_OF", "MATCHES", "DOES_NOT_MATCH", "IS_GREATER_THAN", "IS_LESS_THAN"] - ] = None - """The operation to apply to the attribute""" - - value: Union[str, int, List[str], None] = None - """A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`""" - - -class DraftVersionParametersConditional3DSActionParameters(BaseModel): - action: Literal["DECLINE", "CHALLENGE"] - """The action to take if the conditions are met.""" - - conditions: List[DraftVersionParametersConditional3DsActionParametersCondition] - - DraftVersionParameters: TypeAlias = Union[ - ConditionalBlockParameters, - VelocityLimitParams, - DraftVersionParametersMerchantLockParameters, - DraftVersionParametersConditional3DSActionParameters, + ConditionalBlockParameters, VelocityLimitParams, MerchantLockParameters, Conditional3DSActionParameters ] diff --git a/src/lithic/types/transaction.py b/src/lithic/types/transaction.py index 2b068bc3..7d99a4b2 100644 --- a/src/lithic/types/transaction.py +++ b/src/lithic/types/transaction.py @@ -701,6 +701,8 @@ class Event(BaseModel): ] """Type of transaction event""" + account_type: Optional[Literal["CHECKING", "SAVINGS"]] = None + network_specific_data: Optional[EventNetworkSpecificData] = None