diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 988e843f..b6700282 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.116.0" + ".": "0.117.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 31a62cc4..eba290a5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 184 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-a45946df228eec554b3cd2491f658bd5a45cb91509da0a9f92d50468ea88072f.yml -openapi_spec_hash: 24c7c13e1e7385cab5442ca66091ffc6 -config_hash: 50031f78031362c2e4900222b9ce7ada +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-ee8607f0a2cdcaee420935050334a439db8dd097be83023fccdaf1d6f9a7de14.yml +openapi_spec_hash: 0f21c68cdddb7c5bd99f42356d507393 +config_hash: fb5070d41fcabdedbc084b83964b592a diff --git a/CHANGELOG.md b/CHANGELOG.md index 9bbf5ae5..b82d9dc5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,22 @@ # Changelog +## 0.117.0 (2026-03-05) + +Full Changelog: [v0.116.0...v0.117.0](https://github.com/lithic-com/lithic-python/compare/v0.116.0...v0.117.0) + +### Features + +* **api:** add action_counts to rule performance reports and code to authorization actions ([8301127](https://github.com/lithic-com/lithic-python/commit/8301127ce01926ad8290614abe4f2b636a120cbf)) +* **api:** Add Hold API for financial account fund reservations ([a476549](https://github.com/lithic-com/lithic-python/commit/a4765491913a1ca262ee53a1a988a79e05a77542)) +* **api:** Remove deprecated beneficial owner entities field ([4160169](https://github.com/lithic-com/lithic-python/commit/4160169460138e469b75e642346a573a2f43c55e)) + + +### Chores + +* fix webhook parsing tests ([0f10f64](https://github.com/lithic-com/lithic-python/commit/0f10f64e04f189436e48423da8639768bb6d88a3)) +* **internal:** codegen related update ([83f9164](https://github.com/lithic-com/lithic-python/commit/83f9164040f73e7f585d0f05e37bb24f97f57115)) +* **internal:** codegen related update ([089f0d7](https://github.com/lithic-com/lithic-python/commit/089f0d7d6935e896cc9304ebc9535521f8353456)) + ## 0.116.0 (2026-02-27) Full Changelog: [v0.115.0...v0.116.0](https://github.com/lithic-com/lithic-python/compare/v0.115.0...v0.116.0) diff --git a/api.md b/api.md index 81c83721..e247a6e0 100644 --- a/api.md +++ b/api.md @@ -96,6 +96,7 @@ Types: from lithic.types.auth_rules import ( AuthRule, AuthRuleCondition, + BacktestStats, Conditional3DSActionParameters, ConditionalACHActionParameters, ConditionalAttribute, @@ -106,7 +107,7 @@ from lithic.types.auth_rules import ( ConditionalValue, EventStream, MerchantLockParameters, - RuleStats, + ReportStats, VelocityLimitParams, VelocityLimitPeriod, V2ListResultsResponse, diff --git a/pyproject.toml b/pyproject.toml index 18c9a87e..33fa6251 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "lithic" -version = "0.116.0" +version = "0.117.0" description = "The official Python library for the lithic API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/scripts/mock b/scripts/mock index 0b28f6ea..bcf3b392 100755 --- a/scripts/mock +++ b/scripts/mock @@ -21,11 +21,22 @@ echo "==> Starting mock server with URL ${URL}" # Run prism mock on the given spec if [ "$1" == "--daemon" ]; then + # Pre-install the package so the download doesn't eat into the startup timeout + npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism --version + npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" &> .prism.log & - # Wait for server to come online + # Wait for server to come online (max 30s) echo -n "Waiting for server" + attempts=0 while ! grep -q "✖ fatal\|Prism is listening" ".prism.log" ; do + attempts=$((attempts + 1)) + if [ "$attempts" -ge 300 ]; then + echo + echo "Timed out waiting for Prism server to start" + cat .prism.log + exit 1 + fi echo -n "." sleep 0.1 done diff --git a/src/lithic/_version.py b/src/lithic/_version.py index d7f6788a..39276f3d 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.116.0" # x-release-please-version +__version__ = "0.117.0" # x-release-please-version diff --git a/src/lithic/resources/account_holders/account_holders.py b/src/lithic/resources/account_holders/account_holders.py index ee283367..a4de68a6 100644 --- a/src/lithic/resources/account_holders/account_holders.py +++ b/src/lithic/resources/account_holders/account_holders.py @@ -79,7 +79,6 @@ def create( nature_of_business: str, tos_timestamp: str, workflow: Literal["KYB_BASIC", "KYB_BYO"], - beneficial_owner_entities: Iterable[account_holder_create_params.KYBBeneficialOwnerEntity] | Omit = omit, external_id: str | Omit = omit, kyb_passed_timestamp: str | Omit = omit, naics_code: str | Omit = omit, @@ -130,8 +129,6 @@ def create( workflow: Specifies the type of KYB workflow to run. - beneficial_owner_entities: Deprecated. - external_id: A user provided id that can be used to link an account holder with an external system @@ -381,7 +378,6 @@ def create( | Literal["KYC_BASIC", "KYC_BYO"] | Literal["KYC_EXEMPT"] | Omit = omit, - beneficial_owner_entities: Iterable[account_holder_create_params.KYBBeneficialOwnerEntity] | Omit = omit, external_id: str | Omit = omit, kyb_passed_timestamp: str | Omit = omit, naics_code: str | Omit = omit, @@ -414,7 +410,6 @@ def create( "nature_of_business": nature_of_business, "tos_timestamp": tos_timestamp, "workflow": workflow, - "beneficial_owner_entities": beneficial_owner_entities, "external_id": external_id, "kyb_passed_timestamp": kyb_passed_timestamp, "naics_code": naics_code, @@ -478,8 +473,6 @@ def update( self, account_holder_token: str, *, - beneficial_owner_entities: Iterable[account_holder_update_params.KYBPatchRequestBeneficialOwnerEntity] - | Omit = omit, beneficial_owner_individuals: Iterable[account_holder_update_params.KYBPatchRequestBeneficialOwnerIndividual] | Omit = omit, business_entity: account_holder_update_params.KYBPatchRequestBusinessEntity | Omit = omit, @@ -508,8 +501,6 @@ def update( the program that the calling API key manages. Args: - beneficial_owner_entities: Deprecated. - beneficial_owner_individuals: You must submit a list of all direct and indirect individuals with 25% or more ownership in the company. A maximum of 4 beneficial owners can be submitted. If no individual owns 25% of the company you do not need to send beneficial owner @@ -658,8 +649,6 @@ def update( self, account_holder_token: str, *, - beneficial_owner_entities: Iterable[account_holder_update_params.KYBPatchRequestBeneficialOwnerEntity] - | Omit = omit, beneficial_owner_individuals: Iterable[account_holder_update_params.KYBPatchRequestBeneficialOwnerIndividual] | Omit = omit, business_entity: account_holder_update_params.KYBPatchRequestBusinessEntity | Omit = omit, @@ -693,7 +682,6 @@ def update( f"/v1/account_holders/{account_holder_token}", body=maybe_transform( { - "beneficial_owner_entities": beneficial_owner_entities, "beneficial_owner_individuals": beneficial_owner_individuals, "business_entity": business_entity, "control_person": control_person, @@ -1169,7 +1157,6 @@ async def create( nature_of_business: str, tos_timestamp: str, workflow: Literal["KYB_BASIC", "KYB_BYO"], - beneficial_owner_entities: Iterable[account_holder_create_params.KYBBeneficialOwnerEntity] | Omit = omit, external_id: str | Omit = omit, kyb_passed_timestamp: str | Omit = omit, naics_code: str | Omit = omit, @@ -1220,8 +1207,6 @@ async def create( workflow: Specifies the type of KYB workflow to run. - beneficial_owner_entities: Deprecated. - external_id: A user provided id that can be used to link an account holder with an external system @@ -1471,7 +1456,6 @@ async def create( | Literal["KYC_BASIC", "KYC_BYO"] | Literal["KYC_EXEMPT"] | Omit = omit, - beneficial_owner_entities: Iterable[account_holder_create_params.KYBBeneficialOwnerEntity] | Omit = omit, external_id: str | Omit = omit, kyb_passed_timestamp: str | Omit = omit, naics_code: str | Omit = omit, @@ -1504,7 +1488,6 @@ async def create( "nature_of_business": nature_of_business, "tos_timestamp": tos_timestamp, "workflow": workflow, - "beneficial_owner_entities": beneficial_owner_entities, "external_id": external_id, "kyb_passed_timestamp": kyb_passed_timestamp, "naics_code": naics_code, @@ -1568,8 +1551,6 @@ async def update( self, account_holder_token: str, *, - beneficial_owner_entities: Iterable[account_holder_update_params.KYBPatchRequestBeneficialOwnerEntity] - | Omit = omit, beneficial_owner_individuals: Iterable[account_holder_update_params.KYBPatchRequestBeneficialOwnerIndividual] | Omit = omit, business_entity: account_holder_update_params.KYBPatchRequestBusinessEntity | Omit = omit, @@ -1598,8 +1579,6 @@ async def update( the program that the calling API key manages. Args: - beneficial_owner_entities: Deprecated. - beneficial_owner_individuals: You must submit a list of all direct and indirect individuals with 25% or more ownership in the company. A maximum of 4 beneficial owners can be submitted. If no individual owns 25% of the company you do not need to send beneficial owner @@ -1748,8 +1727,6 @@ async def update( self, account_holder_token: str, *, - beneficial_owner_entities: Iterable[account_holder_update_params.KYBPatchRequestBeneficialOwnerEntity] - | Omit = omit, beneficial_owner_individuals: Iterable[account_holder_update_params.KYBPatchRequestBeneficialOwnerIndividual] | Omit = omit, business_entity: account_holder_update_params.KYBPatchRequestBusinessEntity | Omit = omit, @@ -1783,7 +1760,6 @@ async def update( f"/v1/account_holders/{account_holder_token}", body=await async_maybe_transform( { - "beneficial_owner_entities": beneficial_owner_entities, "beneficial_owner_individuals": beneficial_owner_individuals, "business_entity": business_entity, "control_person": control_person, diff --git a/src/lithic/resources/account_holders/entities.py b/src/lithic/resources/account_holders/entities.py index ebc307b6..2f72deb9 100644 --- a/src/lithic/resources/account_holders/entities.py +++ b/src/lithic/resources/account_holders/entities.py @@ -60,8 +60,8 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EntityCreateResponse: """ - Create a new beneficial owner or replace the control person entity on an - existing KYB account holder. This endpoint is only applicable for account + Create a new beneficial owner individual or replace the control person entity on + an existing KYB account holder. This endpoint is only applicable for account holders enrolled through a KYB workflow with the Persona KYB provider. A new control person can only replace the existing one. A maximum of 4 beneficial owners can be associated with an account holder. @@ -133,10 +133,10 @@ def delete( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AccountHolderEntity: - """Deactivate a beneficial owner entity on an existing KYB account holder. + """Deactivate a beneficial owner individual on an existing KYB account holder. Only - beneficial owner entities can be deactivated. + beneficial owner individuals can be deactivated. Args: extra_headers: Send extra headers @@ -202,8 +202,8 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EntityCreateResponse: """ - Create a new beneficial owner or replace the control person entity on an - existing KYB account holder. This endpoint is only applicable for account + Create a new beneficial owner individual or replace the control person entity on + an existing KYB account holder. This endpoint is only applicable for account holders enrolled through a KYB workflow with the Persona KYB provider. A new control person can only replace the existing one. A maximum of 4 beneficial owners can be associated with an account holder. @@ -275,10 +275,10 @@ async def delete( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AccountHolderEntity: - """Deactivate a beneficial owner entity on an existing KYB account holder. + """Deactivate a beneficial owner individual on an existing KYB account holder. Only - beneficial owner entities can be deactivated. + beneficial owner individuals can be deactivated. Args: extra_headers: Send extra headers diff --git a/src/lithic/resources/auth_rules/v2/v2.py b/src/lithic/resources/auth_rules/v2/v2.py index 5e207bb1..59a7ad20 100644 --- a/src/lithic/resources/auth_rules/v2/v2.py +++ b/src/lithic/resources/auth_rules/v2/v2.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Any, List, Union, Optional, cast -from datetime import date +from datetime import date, datetime from typing_extensions import Literal, overload import httpx @@ -634,6 +634,8 @@ def list_results( self, *, auth_rule_token: str | Omit = omit, + begin: Union[str, datetime] | Omit = omit, + end: Union[str, datetime] | Omit = omit, ending_before: str | Omit = omit, event_token: str | Omit = omit, has_actions: bool | Omit = omit, @@ -658,6 +660,12 @@ def list_results( Args: auth_rule_token: Filter by Auth Rule token + begin: Date string in RFC 3339 format. Only events evaluated after the specified time + will be included. UTC time zone. + + end: Date string in RFC 3339 format. Only events evaluated before the specified time + will be included. UTC time zone. + ending_before: A cursor representing an item's token before which a page of results should end. Used to retrieve the previous page of results before this item. @@ -690,6 +698,8 @@ def list_results( query=maybe_transform( { "auth_rule_token": auth_rule_token, + "begin": begin, + "end": end, "ending_before": ending_before, "event_token": event_token, "has_actions": has_actions, @@ -1442,6 +1452,8 @@ def list_results( self, *, auth_rule_token: str | Omit = omit, + begin: Union[str, datetime] | Omit = omit, + end: Union[str, datetime] | Omit = omit, ending_before: str | Omit = omit, event_token: str | Omit = omit, has_actions: bool | Omit = omit, @@ -1466,6 +1478,12 @@ def list_results( Args: auth_rule_token: Filter by Auth Rule token + begin: Date string in RFC 3339 format. Only events evaluated after the specified time + will be included. UTC time zone. + + end: Date string in RFC 3339 format. Only events evaluated before the specified time + will be included. UTC time zone. + ending_before: A cursor representing an item's token before which a page of results should end. Used to retrieve the previous page of results before this item. @@ -1498,6 +1516,8 @@ def list_results( query=maybe_transform( { "auth_rule_token": auth_rule_token, + "begin": begin, + "end": end, "ending_before": ending_before, "event_token": event_token, "has_actions": has_actions, diff --git a/src/lithic/resources/payments.py b/src/lithic/resources/payments.py index 59d0d978..9235899b 100644 --- a/src/lithic/resources/payments.py +++ b/src/lithic/resources/payments.py @@ -66,6 +66,7 @@ def create( method_attributes: payment_create_params.MethodAttributes, type: Literal["COLLECTION", "PAYMENT"], token: str | Omit = omit, + hold: payment_create_params.Hold | Omit = omit, memo: str | Omit = omit, user_defined_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -82,6 +83,8 @@ def create( token: Customer-provided token that will serve as an idempotency token. This token will become the transaction token. + hold: Optional hold to settle when this payment is initiated. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -101,6 +104,7 @@ def create( "method_attributes": method_attributes, "type": type, "token": token, + "hold": hold, "memo": memo, "user_defined_id": user_defined_id, }, @@ -566,6 +570,7 @@ async def create( method_attributes: payment_create_params.MethodAttributes, type: Literal["COLLECTION", "PAYMENT"], token: str | Omit = omit, + hold: payment_create_params.Hold | Omit = omit, memo: str | Omit = omit, user_defined_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -582,6 +587,8 @@ async def create( token: Customer-provided token that will serve as an idempotency token. This token will become the transaction token. + hold: Optional hold to settle when this payment is initiated. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -601,6 +608,7 @@ async def create( "method_attributes": method_attributes, "type": type, "token": token, + "hold": hold, "memo": memo, "user_defined_id": user_defined_id, }, diff --git a/src/lithic/types/account_holder.py b/src/lithic/types/account_holder.py index bf384966..bf46732c 100644 --- a/src/lithic/types/account_holder.py +++ b/src/lithic/types/account_holder.py @@ -10,7 +10,6 @@ __all__ = [ "AccountHolder", - "BeneficialOwnerEntity", "BeneficialOwnerIndividual", "BusinessEntity", "ControlPerson", @@ -19,42 +18,6 @@ ] -class BeneficialOwnerEntity(BaseModel): - address: Address - """ - Business's physical address - PO boxes, UPS drops, and FedEx drops are not - acceptable; APO/FPO are acceptable. - """ - - dba_business_name: str - """ - Any name that the business operates under that is not its legal business name - (if applicable). - """ - - entity_token: str - """Globally unique identifier for the entity.""" - - government_id: str - """Government-issued identification number. - - US Federal Employer Identification Numbers (EIN) are currently supported, - entered as full nine-digits, with or without hyphens. - """ - - legal_business_name: str - """Legal (formal) business name.""" - - phone_numbers: List[str] - """ - One or more of the business's phone number(s), entered as a list in E.164 - format. - """ - - parent_company: Optional[str] = None - """Parent company name (if applicable).""" - - class BeneficialOwnerIndividual(BaseModel): """Information about an individual associated with an account holder. @@ -229,9 +192,6 @@ class AccountHolder(BaseModel): account_token: Optional[str] = None """Globally unique identifier for the account.""" - beneficial_owner_entities: Optional[List[BeneficialOwnerEntity]] = None - """Deprecated.""" - beneficial_owner_individuals: Optional[List[BeneficialOwnerIndividual]] = None """ Only present when user_type == "BUSINESS". You must submit a list of all direct diff --git a/src/lithic/types/account_holder_create_params.py b/src/lithic/types/account_holder_create_params.py index 2c0a27cb..fca3dbe3 100644 --- a/src/lithic/types/account_holder_create_params.py +++ b/src/lithic/types/account_holder_create_params.py @@ -14,7 +14,6 @@ "KYBBeneficialOwnerIndividual", "KYBBusinessEntity", "KYBControlPerson", - "KYBBeneficialOwnerEntity", "KYBDelegated", "KYBDelegatedBusinessEntity", "KYBDelegatedBeneficialOwnerIndividual", @@ -70,9 +69,6 @@ class KYB(TypedDict, total=False): workflow: Required[Literal["KYB_BASIC", "KYB_BYO"]] """Specifies the type of KYB workflow to run.""" - beneficial_owner_entities: Iterable[KYBBeneficialOwnerEntity] - """Deprecated.""" - external_id: str """ A user provided id that can be used to link an account holder with an external @@ -211,39 +207,6 @@ class KYBControlPerson(TypedDict, total=False): """Individual's phone number, entered in E.164 format.""" -class KYBBeneficialOwnerEntity(TypedDict, total=False): - address: Required[Address] - """ - Business's physical address - PO boxes, UPS drops, and FedEx drops are not - acceptable; APO/FPO are acceptable. - """ - - government_id: Required[str] - """Government-issued identification number. - - US Federal Employer Identification Numbers (EIN) are currently supported, - entered as full nine-digits, with or without hyphens. - """ - - legal_business_name: Required[str] - """Legal (formal) business name.""" - - phone_numbers: Required[SequenceNotStr[str]] - """ - One or more of the business's phone number(s), entered as a list in E.164 - format. - """ - - dba_business_name: str - """ - Any name that the business operates under that is not its legal business name - (if applicable). - """ - - parent_company: str - """Parent company name (if applicable).""" - - class KYBDelegated(TypedDict, total=False): business_entity: Required[KYBDelegatedBusinessEntity] """Information for business for which the account is being opened.""" diff --git a/src/lithic/types/account_holder_simulate_enrollment_review_response.py b/src/lithic/types/account_holder_simulate_enrollment_review_response.py index b2785883..7a8e9b73 100644 --- a/src/lithic/types/account_holder_simulate_enrollment_review_response.py +++ b/src/lithic/types/account_holder_simulate_enrollment_review_response.py @@ -283,9 +283,6 @@ class AccountHolderSimulateEnrollmentReviewResponse(BaseModel): account_token: Optional[str] = None """Globally unique identifier for the account.""" - beneficial_owner_entities: Optional[List[KYBBusinessEntity]] = None - """Deprecated.""" - beneficial_owner_individuals: Optional[List[BeneficialOwnerIndividual]] = None """Only present when user_type == "BUSINESS". diff --git a/src/lithic/types/account_holder_update_params.py b/src/lithic/types/account_holder_update_params.py index 2551e6c4..934d9f51 100644 --- a/src/lithic/types/account_holder_update_params.py +++ b/src/lithic/types/account_holder_update_params.py @@ -11,7 +11,6 @@ __all__ = [ "AccountHolderUpdateParams", "KYBPatchRequest", - "KYBPatchRequestBeneficialOwnerEntity", "KYBPatchRequestBeneficialOwnerIndividual", "KYBPatchRequestBusinessEntity", "KYBPatchRequestControlPerson", @@ -22,9 +21,6 @@ class KYBPatchRequest(TypedDict, total=False): - beneficial_owner_entities: Iterable[KYBPatchRequestBeneficialOwnerEntity] - """Deprecated.""" - beneficial_owner_individuals: Iterable[KYBPatchRequestBeneficialOwnerIndividual] """ You must submit a list of all direct and indirect individuals with 25% or more @@ -75,42 +71,6 @@ class KYBPatchRequest(TypedDict, total=False): """Company website URL.""" -class KYBPatchRequestBeneficialOwnerEntity(TypedDict, total=False): - entity_token: Required[str] - """Globally unique identifier for an entity.""" - - address: AddressUpdateParam - """ - Business''s physical address - PO boxes, UPS drops, and FedEx drops are not - acceptable; APO/FPO are acceptable. - """ - - dba_business_name: str - """ - Any name that the business operates under that is not its legal business name - (if applicable). - """ - - government_id: str - """Government-issued identification number. - - US Federal Employer Identification Numbers (EIN) are currently supported, - entered as full nine-digits, with or without hyphens. - """ - - legal_business_name: str - """Legal (formal) business name.""" - - parent_company: str - """Parent company name (if applicable).""" - - phone_numbers: SequenceNotStr[str] - """ - One or more of the business's phone number(s), entered as a list in E.164 - format. - """ - - class KYBPatchRequestBeneficialOwnerIndividual(TypedDict, total=False): """Individuals associated with a KYB application. Phone number is optional.""" diff --git a/src/lithic/types/account_holder_update_response.py b/src/lithic/types/account_holder_update_response.py index 304b81de..e8d3e882 100644 --- a/src/lithic/types/account_holder_update_response.py +++ b/src/lithic/types/account_holder_update_response.py @@ -286,9 +286,6 @@ class KYBKYCPatchResponse(BaseModel): account_token: Optional[str] = None """Globally unique identifier for the account.""" - beneficial_owner_entities: Optional[List[KYBBusinessEntity]] = None - """Deprecated.""" - beneficial_owner_individuals: Optional[List[KybkycPatchResponseBeneficialOwnerIndividual]] = None """Only present when user_type == "BUSINESS". diff --git a/src/lithic/types/account_holder_updated_webhook_event.py b/src/lithic/types/account_holder_updated_webhook_event.py index 34bfa0fc..f0d756e2 100644 --- a/src/lithic/types/account_holder_updated_webhook_event.py +++ b/src/lithic/types/account_holder_updated_webhook_event.py @@ -156,9 +156,6 @@ class KYBPayloadUpdateRequestControlPerson(BaseModel): class KYBPayloadUpdateRequest(BaseModel): """Original request to update the account holder.""" - beneficial_owner_entities: Optional[List[KYBBusinessEntity]] = None - """Deprecated.""" - beneficial_owner_individuals: Optional[List[KYBPayloadUpdateRequestBeneficialOwnerIndividual]] = None """ You must submit a list of all direct and indirect individuals with 25% or more diff --git a/src/lithic/types/auth_rules/__init__.py b/src/lithic/types/auth_rules/__init__.py index b064d781..a580f180 100644 --- a/src/lithic/types/auth_rules/__init__.py +++ b/src/lithic/types/auth_rules/__init__.py @@ -3,8 +3,9 @@ from __future__ import annotations from .auth_rule import AuthRule as AuthRule -from .rule_stats import RuleStats as RuleStats from .event_stream import EventStream as EventStream +from .report_stats import ReportStats as ReportStats +from .backtest_stats import BacktestStats as BacktestStats from .v2_list_params import V2ListParams as V2ListParams from .v2_draft_params import V2DraftParams as V2DraftParams from .v2_create_params import V2CreateParams as V2CreateParams diff --git a/src/lithic/types/auth_rules/rule_stats.py b/src/lithic/types/auth_rules/backtest_stats.py similarity index 80% rename from src/lithic/types/auth_rules/rule_stats.py rename to src/lithic/types/auth_rules/backtest_stats.py index b3e621f9..19b66503 100644 --- a/src/lithic/types/auth_rules/rule_stats.py +++ b/src/lithic/types/auth_rules/backtest_stats.py @@ -6,13 +6,10 @@ from ..._models import BaseModel -__all__ = ["RuleStats", "Example"] +__all__ = ["BacktestStats", "Example"] class Example(BaseModel): - approved: Optional[bool] = None - """Whether the rule would have approved the request.""" - decision: Optional[Literal["APPROVED", "DECLINED", "CHALLENGED"]] = None """The decision made by the rule for this event.""" @@ -23,18 +20,18 @@ class Example(BaseModel): """The timestamp of the event.""" -class RuleStats(BaseModel): +class BacktestStats(BaseModel): approved: Optional[int] = None """ The total number of historical transactions approved by this rule during the - relevant period, or the number of transactions that would have been approved if + backtest period, or the number of transactions that would have been approved if the rule was evaluated in shadow mode. """ challenged: Optional[int] = None """ The total number of historical transactions challenged by this rule during the - relevant period, or the number of transactions that would have been challenged + backtest period, or the number of transactions that would have been challenged if the rule was evaluated in shadow mode. Currently applicable only for 3DS Auth Rules. """ @@ -42,7 +39,7 @@ class RuleStats(BaseModel): declined: Optional[int] = None """ The total number of historical transactions declined by this rule during the - relevant period, or the number of transactions that would have been declined if + backtest period, or the number of transactions that would have been declined if the rule was evaluated in shadow mode. """ diff --git a/src/lithic/types/auth_rules/conditional_ach_action_parameters.py b/src/lithic/types/auth_rules/conditional_ach_action_parameters.py index 38601fb7..3d47407b 100644 --- a/src/lithic/types/auth_rules/conditional_ach_action_parameters.py +++ b/src/lithic/types/auth_rules/conditional_ach_action_parameters.py @@ -7,10 +7,10 @@ from .conditional_value import ConditionalValue from .conditional_operation import ConditionalOperation -__all__ = ["ConditionalACHActionParameters", "Action", "ActionApproveAction", "ActionReturnAction", "Condition"] +__all__ = ["ConditionalACHActionParameters", "Action", "ActionApproveActionACH", "ActionReturnAction", "Condition"] -class ActionApproveAction(BaseModel): +class ActionApproveActionACH(BaseModel): type: Literal["APPROVE"] """Approve the ACH transaction""" @@ -98,7 +98,7 @@ class ActionReturnAction(BaseModel): """Return the ACH transaction""" -Action: TypeAlias = Union[ActionApproveAction, ActionReturnAction] +Action: TypeAlias = Union[ActionApproveActionACH, ActionReturnAction] class Condition(BaseModel): diff --git a/src/lithic/types/auth_rules/conditional_ach_action_parameters_param.py b/src/lithic/types/auth_rules/conditional_ach_action_parameters_param.py index a11fdafd..85929fd3 100644 --- a/src/lithic/types/auth_rules/conditional_ach_action_parameters_param.py +++ b/src/lithic/types/auth_rules/conditional_ach_action_parameters_param.py @@ -9,10 +9,10 @@ from .conditional_operation import ConditionalOperation from .conditional_value_param import ConditionalValueParam -__all__ = ["ConditionalACHActionParametersParam", "Action", "ActionApproveAction", "ActionReturnAction", "Condition"] +__all__ = ["ConditionalACHActionParametersParam", "Action", "ActionApproveActionACH", "ActionReturnAction", "Condition"] -class ActionApproveAction(TypedDict, total=False): +class ActionApproveActionACH(TypedDict, total=False): type: Required[Literal["APPROVE"]] """Approve the ACH transaction""" @@ -102,7 +102,7 @@ class ActionReturnAction(TypedDict, total=False): """Return the ACH transaction""" -Action: TypeAlias = Union[ActionApproveAction, ActionReturnAction] +Action: TypeAlias = Union[ActionApproveActionACH, ActionReturnAction] class Condition(TypedDict, total=False): diff --git a/src/lithic/types/auth_rules/conditional_tokenization_action_parameters.py b/src/lithic/types/auth_rules/conditional_tokenization_action_parameters.py index 316a9324..a0cd2e6c 100644 --- a/src/lithic/types/auth_rules/conditional_tokenization_action_parameters.py +++ b/src/lithic/types/auth_rules/conditional_tokenization_action_parameters.py @@ -10,13 +10,13 @@ __all__ = [ "ConditionalTokenizationActionParameters", "Action", - "ActionDeclineAction", + "ActionDeclineActionTokenization", "ActionRequireTfaAction", "Condition", ] -class ActionDeclineAction(BaseModel): +class ActionDeclineActionTokenization(BaseModel): type: Literal["DECLINE"] """Decline the tokenization request""" @@ -66,7 +66,7 @@ class ActionRequireTfaAction(BaseModel): """Reason code for requiring two-factor authentication""" -Action: TypeAlias = Union[ActionDeclineAction, ActionRequireTfaAction] +Action: TypeAlias = Union[ActionDeclineActionTokenization, ActionRequireTfaAction] class Condition(BaseModel): diff --git a/src/lithic/types/auth_rules/conditional_tokenization_action_parameters_param.py b/src/lithic/types/auth_rules/conditional_tokenization_action_parameters_param.py index 3943c21b..5f8d411b 100644 --- a/src/lithic/types/auth_rules/conditional_tokenization_action_parameters_param.py +++ b/src/lithic/types/auth_rules/conditional_tokenization_action_parameters_param.py @@ -12,13 +12,13 @@ __all__ = [ "ConditionalTokenizationActionParametersParam", "Action", - "ActionDeclineAction", + "ActionDeclineActionTokenization", "ActionRequireTfaAction", "Condition", ] -class ActionDeclineAction(TypedDict, total=False): +class ActionDeclineActionTokenization(TypedDict, total=False): type: Required[Literal["DECLINE"]] """Decline the tokenization request""" @@ -64,7 +64,7 @@ class ActionRequireTfaAction(TypedDict, total=False): """Reason code for requiring two-factor authentication""" -Action: TypeAlias = Union[ActionDeclineAction, ActionRequireTfaAction] +Action: TypeAlias = Union[ActionDeclineActionTokenization, ActionRequireTfaAction] class Condition(TypedDict, total=False): diff --git a/src/lithic/types/auth_rules/report_stats.py b/src/lithic/types/auth_rules/report_stats.py new file mode 100644 index 00000000..a0796364 --- /dev/null +++ b/src/lithic/types/auth_rules/report_stats.py @@ -0,0 +1,294 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Union, Optional +from datetime import datetime +from typing_extensions import Literal, TypeAlias + +from ..._models import BaseModel + +__all__ = [ + "ReportStats", + "Example", + "ExampleAction", + "ExampleActionDeclineActionAuthorization", + "ExampleActionChallengeActionAuthorization", + "ExampleActionResultAuthentication3DSAction", + "ExampleActionDeclineActionTokenization", + "ExampleActionRequireTfaAction", + "ExampleActionApproveActionACH", + "ExampleActionReturnAction", +] + + +class ExampleActionDeclineActionAuthorization(BaseModel): + code: Literal[ + "ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED", + "ACCOUNT_DELINQUENT", + "ACCOUNT_INACTIVE", + "ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED", + "ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED", + "ACCOUNT_PAUSED", + "ACCOUNT_UNDER_REVIEW", + "ADDRESS_INCORRECT", + "APPROVED", + "AUTH_RULE_ALLOWED_COUNTRY", + "AUTH_RULE_ALLOWED_MCC", + "AUTH_RULE_BLOCKED_COUNTRY", + "AUTH_RULE_BLOCKED_MCC", + "AUTH_RULE", + "CARD_CLOSED", + "CARD_CRYPTOGRAM_VALIDATION_FAILURE", + "CARD_EXPIRED", + "CARD_EXPIRY_DATE_INCORRECT", + "CARD_INVALID", + "CARD_NOT_ACTIVATED", + "CARD_PAUSED", + "CARD_PIN_INCORRECT", + "CARD_RESTRICTED", + "CARD_SECURITY_CODE_INCORRECT", + "CARD_SPEND_LIMIT_EXCEEDED", + "CONTACT_CARD_ISSUER", + "CUSTOMER_ASA_TIMEOUT", + "CUSTOM_ASA_RESULT", + "DECLINED", + "DO_NOT_HONOR", + "DRIVER_NUMBER_INVALID", + "FORMAT_ERROR", + "INSUFFICIENT_FUNDING_SOURCE_BALANCE", + "INSUFFICIENT_FUNDS", + "LITHIC_SYSTEM_ERROR", + "LITHIC_SYSTEM_RATE_LIMIT", + "MALFORMED_ASA_RESPONSE", + "MERCHANT_INVALID", + "MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE", + "MERCHANT_NOT_PERMITTED", + "OVER_REVERSAL_ATTEMPTED", + "PIN_BLOCKED", + "PROGRAM_CARD_SPEND_LIMIT_EXCEEDED", + "PROGRAM_SUSPENDED", + "PROGRAM_USAGE_RESTRICTION", + "REVERSAL_UNMATCHED", + "SECURITY_VIOLATION", + "SINGLE_USE_CARD_REATTEMPTED", + "SUSPECTED_FRAUD", + "TRANSACTION_INVALID", + "TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL", + "TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER", + "TRANSACTION_PREVIOUSLY_COMPLETED", + "UNAUTHORIZED_MERCHANT", + "VEHICLE_NUMBER_INVALID", + "CARDHOLDER_CHALLENGED", + "CARDHOLDER_CHALLENGE_FAILED", + ] + """The detailed result code explaining the specific reason for the decline""" + + type: Literal["DECLINE"] + + +class ExampleActionChallengeActionAuthorization(BaseModel): + type: Literal["CHALLENGE"] + + +class ExampleActionResultAuthentication3DSAction(BaseModel): + type: Literal["DECLINE", "CHALLENGE"] + + +class ExampleActionDeclineActionTokenization(BaseModel): + type: Literal["DECLINE"] + """Decline the tokenization request""" + + reason: Optional[ + Literal[ + "ACCOUNT_SCORE_1", + "DEVICE_SCORE_1", + "ALL_WALLET_DECLINE_REASONS_PRESENT", + "WALLET_RECOMMENDED_DECISION_RED", + "CVC_MISMATCH", + "CARD_EXPIRY_MONTH_MISMATCH", + "CARD_EXPIRY_YEAR_MISMATCH", + "CARD_INVALID_STATE", + "CUSTOMER_RED_PATH", + "INVALID_CUSTOMER_RESPONSE", + "NETWORK_FAILURE", + "GENERIC_DECLINE", + "DIGITAL_CARD_ART_REQUIRED", + ] + ] = None + """Reason code for declining the tokenization request""" + + +class ExampleActionRequireTfaAction(BaseModel): + type: Literal["REQUIRE_TFA"] + """Require two-factor authentication for the tokenization request""" + + reason: Optional[ + Literal[ + "WALLET_RECOMMENDED_TFA", + "SUSPICIOUS_ACTIVITY", + "DEVICE_RECENTLY_LOST", + "TOO_MANY_RECENT_ATTEMPTS", + "TOO_MANY_RECENT_TOKENS", + "TOO_MANY_DIFFERENT_CARDHOLDERS", + "OUTSIDE_HOME_TERRITORY", + "HAS_SUSPENDED_TOKENS", + "HIGH_RISK", + "ACCOUNT_SCORE_LOW", + "DEVICE_SCORE_LOW", + "CARD_STATE_TFA", + "HARDCODED_TFA", + "CUSTOMER_RULE_TFA", + "DEVICE_HOST_CARD_EMULATION", + ] + ] = None + """Reason code for requiring two-factor authentication""" + + +class ExampleActionApproveActionACH(BaseModel): + type: Literal["APPROVE"] + """Approve the ACH transaction""" + + +class ExampleActionReturnAction(BaseModel): + code: Literal[ + "R01", + "R02", + "R03", + "R04", + "R05", + "R06", + "R07", + "R08", + "R09", + "R10", + "R11", + "R12", + "R13", + "R14", + "R15", + "R16", + "R17", + "R18", + "R19", + "R20", + "R21", + "R22", + "R23", + "R24", + "R25", + "R26", + "R27", + "R28", + "R29", + "R30", + "R31", + "R32", + "R33", + "R34", + "R35", + "R36", + "R37", + "R38", + "R39", + "R40", + "R41", + "R42", + "R43", + "R44", + "R45", + "R46", + "R47", + "R50", + "R51", + "R52", + "R53", + "R61", + "R62", + "R67", + "R68", + "R69", + "R70", + "R71", + "R72", + "R73", + "R74", + "R75", + "R76", + "R77", + "R80", + "R81", + "R82", + "R83", + "R84", + "R85", + ] + """NACHA return code to use when returning the transaction. + + Note that the list of available return codes is subject to an allowlist + configured at the program level + """ + + type: Literal["RETURN"] + """Return the ACH transaction""" + + +ExampleAction: TypeAlias = Union[ + ExampleActionDeclineActionAuthorization, + ExampleActionChallengeActionAuthorization, + ExampleActionResultAuthentication3DSAction, + ExampleActionDeclineActionTokenization, + ExampleActionRequireTfaAction, + ExampleActionApproveActionACH, + ExampleActionReturnAction, +] + + +class Example(BaseModel): + actions: Optional[List[ExampleAction]] = None + """The actions taken by the rule for this event.""" + + approved: Optional[bool] = None + """Whether the rule would have approved the request.""" + + decision: Optional[Literal["APPROVED", "DECLINED", "CHALLENGED"]] = None + """The decision made by the rule for this event.""" + + event_token: Optional[str] = None + """The event token.""" + + timestamp: Optional[datetime] = None + """The timestamp of the event.""" + + +class ReportStats(BaseModel): + action_counts: Optional[Dict[str, int]] = None + """ + A mapping of action types to the number of times that action was returned by + this rule during the relevant period. Actions are the possible outcomes of a + rule evaluation, such as DECLINE, CHALLENGE, REQUIRE_TFA, etc. In case rule + didn't trigger any action, it's counted under NO_ACTION key. + """ + + approved: Optional[int] = None + """ + The total number of historical transactions approved by this rule during the + relevant period, or the number of transactions that would have been approved if + the rule was evaluated in shadow mode. + """ + + challenged: Optional[int] = None + """ + The total number of historical transactions challenged by this rule during the + relevant period, or the number of transactions that would have been challenged + if the rule was evaluated in shadow mode. Currently applicable only for 3DS Auth + Rules. + """ + + declined: Optional[int] = None + """ + The total number of historical transactions declined by this rule during the + relevant period, or the number of transactions that would have been declined if + the rule was evaluated in shadow mode. + """ + + examples: Optional[List[Example]] = None + """Example events and their outcomes.""" diff --git a/src/lithic/types/auth_rules/v2/backtest_results.py b/src/lithic/types/auth_rules/v2/backtest_results.py index 5496ba32..54314cc0 100644 --- a/src/lithic/types/auth_rules/v2/backtest_results.py +++ b/src/lithic/types/auth_rules/v2/backtest_results.py @@ -4,15 +4,15 @@ from datetime import datetime from ...._models import BaseModel -from ..rule_stats import RuleStats +from ..backtest_stats import BacktestStats __all__ = ["BacktestResults", "Results", "SimulationParameters"] class Results(BaseModel): - current_version: Optional[RuleStats] = None + current_version: Optional[BacktestStats] = None - draft_version: Optional[RuleStats] = None + draft_version: Optional[BacktestStats] = None class SimulationParameters(BaseModel): diff --git a/src/lithic/types/auth_rules/v2_list_results_params.py b/src/lithic/types/auth_rules/v2_list_results_params.py index 32ba0cd2..15da9449 100644 --- a/src/lithic/types/auth_rules/v2_list_results_params.py +++ b/src/lithic/types/auth_rules/v2_list_results_params.py @@ -2,7 +2,11 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing import Union +from datetime import datetime +from typing_extensions import Annotated, TypedDict + +from ..._utils import PropertyInfo __all__ = ["V2ListResultsParams"] @@ -11,6 +15,18 @@ class V2ListResultsParams(TypedDict, total=False): auth_rule_token: str """Filter by Auth Rule token""" + begin: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] + """Date string in RFC 3339 format. + + Only events evaluated after the specified time will be included. UTC time zone. + """ + + end: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] + """Date string in RFC 3339 format. + + Only events evaluated before the specified time will be included. UTC time zone. + """ + ending_before: str """A cursor representing an item's token before which a page of results should end. diff --git a/src/lithic/types/auth_rules/v2_list_results_response.py b/src/lithic/types/auth_rules/v2_list_results_response.py index 4d8ecd76..d53cafb7 100644 --- a/src/lithic/types/auth_rules/v2_list_results_response.py +++ b/src/lithic/types/auth_rules/v2_list_results_response.py @@ -10,26 +10,101 @@ "V2ListResultsResponse", "AuthorizationResult", "AuthorizationResultAction", + "AuthorizationResultActionDeclineActionAuthorization", + "AuthorizationResultActionChallengeActionAuthorization", "Authentication3DSResult", "Authentication3DsResultAction", "TokenizationResult", "TokenizationResultAction", - "TokenizationResultActionDeclineAction", + "TokenizationResultActionDeclineActionTokenization", "TokenizationResultActionRequireTfaAction", "ACHResult", "ACHResultAction", - "ACHResultActionApproveAction", + "ACHResultActionApproveActionACH", "ACHResultActionReturnAction", ] -class AuthorizationResultAction(BaseModel): - type: Literal["DECLINE", "CHALLENGE"] +class AuthorizationResultActionDeclineActionAuthorization(BaseModel): + code: Literal[ + "ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED", + "ACCOUNT_DELINQUENT", + "ACCOUNT_INACTIVE", + "ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED", + "ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED", + "ACCOUNT_PAUSED", + "ACCOUNT_UNDER_REVIEW", + "ADDRESS_INCORRECT", + "APPROVED", + "AUTH_RULE_ALLOWED_COUNTRY", + "AUTH_RULE_ALLOWED_MCC", + "AUTH_RULE_BLOCKED_COUNTRY", + "AUTH_RULE_BLOCKED_MCC", + "AUTH_RULE", + "CARD_CLOSED", + "CARD_CRYPTOGRAM_VALIDATION_FAILURE", + "CARD_EXPIRED", + "CARD_EXPIRY_DATE_INCORRECT", + "CARD_INVALID", + "CARD_NOT_ACTIVATED", + "CARD_PAUSED", + "CARD_PIN_INCORRECT", + "CARD_RESTRICTED", + "CARD_SECURITY_CODE_INCORRECT", + "CARD_SPEND_LIMIT_EXCEEDED", + "CONTACT_CARD_ISSUER", + "CUSTOMER_ASA_TIMEOUT", + "CUSTOM_ASA_RESULT", + "DECLINED", + "DO_NOT_HONOR", + "DRIVER_NUMBER_INVALID", + "FORMAT_ERROR", + "INSUFFICIENT_FUNDING_SOURCE_BALANCE", + "INSUFFICIENT_FUNDS", + "LITHIC_SYSTEM_ERROR", + "LITHIC_SYSTEM_RATE_LIMIT", + "MALFORMED_ASA_RESPONSE", + "MERCHANT_INVALID", + "MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE", + "MERCHANT_NOT_PERMITTED", + "OVER_REVERSAL_ATTEMPTED", + "PIN_BLOCKED", + "PROGRAM_CARD_SPEND_LIMIT_EXCEEDED", + "PROGRAM_SUSPENDED", + "PROGRAM_USAGE_RESTRICTION", + "REVERSAL_UNMATCHED", + "SECURITY_VIOLATION", + "SINGLE_USE_CARD_REATTEMPTED", + "SUSPECTED_FRAUD", + "TRANSACTION_INVALID", + "TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL", + "TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER", + "TRANSACTION_PREVIOUSLY_COMPLETED", + "UNAUTHORIZED_MERCHANT", + "VEHICLE_NUMBER_INVALID", + "CARDHOLDER_CHALLENGED", + "CARDHOLDER_CHALLENGE_FAILED", + ] + """The detailed result code explaining the specific reason for the decline""" + + type: Literal["DECLINE"] explanation: Optional[str] = None """Optional explanation for why this action was taken""" +class AuthorizationResultActionChallengeActionAuthorization(BaseModel): + type: Literal["CHALLENGE"] + + explanation: Optional[str] = None + """Optional explanation for why this action was taken""" + + +AuthorizationResultAction: TypeAlias = Union[ + AuthorizationResultActionDeclineActionAuthorization, AuthorizationResultActionChallengeActionAuthorization +] + + class AuthorizationResult(BaseModel): token: str """Globally unique identifier for the evaluation""" @@ -89,7 +164,7 @@ class Authentication3DSResult(BaseModel): """Version of the rule that was evaluated""" -class TokenizationResultActionDeclineAction(BaseModel): +class TokenizationResultActionDeclineActionTokenization(BaseModel): type: Literal["DECLINE"] """Decline the tokenization request""" @@ -146,7 +221,7 @@ class TokenizationResultActionRequireTfaAction(BaseModel): TokenizationResultAction: TypeAlias = Union[ - TokenizationResultActionDeclineAction, TokenizationResultActionRequireTfaAction + TokenizationResultActionDeclineActionTokenization, TokenizationResultActionRequireTfaAction ] @@ -176,7 +251,7 @@ class TokenizationResult(BaseModel): """Version of the rule that was evaluated""" -class ACHResultActionApproveAction(BaseModel): +class ACHResultActionApproveActionACH(BaseModel): type: Literal["APPROVE"] """Approve the ACH transaction""" @@ -270,7 +345,7 @@ class ACHResultActionReturnAction(BaseModel): """Optional explanation for why this action was taken""" -ACHResultAction: TypeAlias = Union[ACHResultActionApproveAction, ACHResultActionReturnAction] +ACHResultAction: TypeAlias = Union[ACHResultActionApproveActionACH, ACHResultActionReturnAction] class ACHResult(BaseModel): diff --git a/src/lithic/types/auth_rules/v2_retrieve_report_response.py b/src/lithic/types/auth_rules/v2_retrieve_report_response.py index 27169af6..9545791e 100644 --- a/src/lithic/types/auth_rules/v2_retrieve_report_response.py +++ b/src/lithic/types/auth_rules/v2_retrieve_report_response.py @@ -4,19 +4,19 @@ from typing import List, Optional from ..._models import BaseModel -from .rule_stats import RuleStats +from .report_stats import ReportStats __all__ = ["V2RetrieveReportResponse", "DailyStatistic"] class DailyStatistic(BaseModel): - current_version_statistics: Optional[RuleStats] = None + current_version_statistics: Optional[ReportStats] = None """Detailed statistics for the current version of the rule.""" date: datetime.date """The date (UTC) for which the statistics are reported.""" - draft_version_statistics: Optional[RuleStats] = None + draft_version_statistics: Optional[ReportStats] = None """Detailed statistics for the draft version of the rule.""" diff --git a/src/lithic/types/kyb_param.py b/src/lithic/types/kyb_param.py index b02c8749..a67a8d12 100644 --- a/src/lithic/types/kyb_param.py +++ b/src/lithic/types/kyb_param.py @@ -8,7 +8,7 @@ from .._types import SequenceNotStr from .shared_params.address import Address -__all__ = ["KYBParam", "BeneficialOwnerIndividual", "BusinessEntity", "ControlPerson", "BeneficialOwnerEntity"] +__all__ = ["KYBParam", "BeneficialOwnerIndividual", "BusinessEntity", "ControlPerson"] class BeneficialOwnerIndividual(TypedDict, total=False): @@ -125,39 +125,6 @@ class ControlPerson(TypedDict, total=False): """Individual's phone number, entered in E.164 format.""" -class BeneficialOwnerEntity(TypedDict, total=False): - address: Required[Address] - """ - Business's physical address - PO boxes, UPS drops, and FedEx drops are not - acceptable; APO/FPO are acceptable. - """ - - government_id: Required[str] - """Government-issued identification number. - - US Federal Employer Identification Numbers (EIN) are currently supported, - entered as full nine-digits, with or without hyphens. - """ - - legal_business_name: Required[str] - """Legal (formal) business name.""" - - phone_numbers: Required[SequenceNotStr[str]] - """ - One or more of the business's phone number(s), entered as a list in E.164 - format. - """ - - dba_business_name: str - """ - Any name that the business operates under that is not its legal business name - (if applicable). - """ - - parent_company: str - """Parent company name (if applicable).""" - - class KYBParam(TypedDict, total=False): beneficial_owner_individuals: Required[Iterable[BeneficialOwnerIndividual]] """ @@ -203,9 +170,6 @@ class KYBParam(TypedDict, total=False): workflow: Required[Literal["KYB_BASIC", "KYB_BYO"]] """Specifies the type of KYB workflow to run.""" - beneficial_owner_entities: Iterable[BeneficialOwnerEntity] - """Deprecated.""" - external_id: str """ A user provided id that can be used to link an account holder with an external diff --git a/src/lithic/types/parsed_webhook_event.py b/src/lithic/types/parsed_webhook_event.py index a9db122e..1ce1f75f 100644 --- a/src/lithic/types/parsed_webhook_event.py +++ b/src/lithic/types/parsed_webhook_event.py @@ -221,9 +221,6 @@ class KYBPayloadUpdateRequestControlPerson(BaseModel): class KYBPayloadUpdateRequest(BaseModel): """Original request to update the account holder.""" - beneficial_owner_entities: Optional[List[KYBBusinessEntity]] = None - """Deprecated.""" - beneficial_owner_individuals: Optional[List[KYBPayloadUpdateRequestBeneficialOwnerIndividual]] = None """ You must submit a list of all direct and indirect individuals with 25% or more diff --git a/src/lithic/types/payment_create_params.py b/src/lithic/types/payment_create_params.py index 9e32e71d..c4f01ed9 100644 --- a/src/lithic/types/payment_create_params.py +++ b/src/lithic/types/payment_create_params.py @@ -5,7 +5,7 @@ from typing import Optional from typing_extensions import Literal, Required, TypedDict -__all__ = ["PaymentCreateParams", "MethodAttributes"] +__all__ = ["PaymentCreateParams", "MethodAttributes", "Hold"] class PaymentCreateParams(TypedDict, total=False): @@ -27,6 +27,9 @@ class PaymentCreateParams(TypedDict, total=False): This token will become the transaction token. """ + hold: Hold + """Optional hold to settle when this payment is initiated.""" + memo: str user_defined_id: str @@ -39,3 +42,10 @@ class MethodAttributes(TypedDict, total=False): """Number of days to hold the ACH payment""" addenda: Optional[str] + + +class Hold(TypedDict, total=False): + """Optional hold to settle when this payment is initiated.""" + + token: Required[str] + """Token of the hold to settle when this payment is initiated.""" diff --git a/tests/api_resources/auth_rules/test_v2.py b/tests/api_resources/auth_rules/test_v2.py index b7f3939c..c59bac30 100644 --- a/tests/api_resources/auth_rules/test_v2.py +++ b/tests/api_resources/auth_rules/test_v2.py @@ -9,7 +9,7 @@ from lithic import Lithic, AsyncLithic from tests.utils import assert_matches_type -from lithic._utils import parse_date +from lithic._utils import parse_date, parse_datetime from lithic.pagination import SyncCursorPage, AsyncCursorPage from lithic.types.auth_rules import ( AuthRule, @@ -588,6 +588,8 @@ def test_method_list_results(self, client: Lithic) -> None: def test_method_list_results_with_all_params(self, client: Lithic) -> None: v2 = client.auth_rules.v2.list_results( auth_rule_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + begin=parse_datetime("2019-12-27T18:11:19.117Z"), + end=parse_datetime("2019-12-27T18:11:19.117Z"), ending_before="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", event_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", has_actions=True, @@ -1317,6 +1319,8 @@ async def test_method_list_results(self, async_client: AsyncLithic) -> None: async def test_method_list_results_with_all_params(self, async_client: AsyncLithic) -> None: v2 = await async_client.auth_rules.v2.list_results( auth_rule_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + begin=parse_datetime("2019-12-27T18:11:19.117Z"), + end=parse_datetime("2019-12-27T18:11:19.117Z"), ending_before="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", event_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", has_actions=True, diff --git a/tests/api_resources/test_account_holders.py b/tests/api_resources/test_account_holders.py index a01b2b4d..e95517f1 100644 --- a/tests/api_resources/test_account_holders.py +++ b/tests/api_resources/test_account_holders.py @@ -132,23 +132,6 @@ def test_method_create_with_all_params_overload_1(self, client: Lithic) -> None: nature_of_business="Software company selling solutions to the restaurant industry", tos_timestamp="2018-05-29T21:16:05Z", workflow="KYB_BASIC", - beneficial_owner_entities=[ - { - "address": { - "address1": "123 Old Forest Way", - "city": "Omaha", - "country": "USA", - "postal_code": "68022", - "state": "NE", - "address2": "address2", - }, - "government_id": "114-123-1513", - "legal_business_name": "Acme, Inc.", - "phone_numbers": ["+15555555555"], - "dba_business_name": "dba_business_name", - "parent_company": "parent_company", - } - ], external_id="external_id", kyb_passed_timestamp="2018-05-29T21:16:05Z", naics_code="541512", @@ -630,24 +613,6 @@ def test_method_update_overload_1(self, client: Lithic) -> None: def test_method_update_with_all_params_overload_1(self, client: Lithic) -> None: account_holder = client.account_holders.update( account_holder_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - beneficial_owner_entities=[ - { - "entity_token": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "address": { - "address1": "123 Old Forest Way", - "address2": "address2", - "city": "Omaha", - "country": "USA", - "postal_code": "68022", - "state": "NE", - }, - "dba_business_name": "dba_business_name", - "government_id": "114-123-1513", - "legal_business_name": "Acme, Inc.", - "parent_company": "parent_company", - "phone_numbers": ["+15555555555"], - } - ], beneficial_owner_individuals=[ { "entity_token": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", @@ -1224,23 +1189,6 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn nature_of_business="Software company selling solutions to the restaurant industry", tos_timestamp="2018-05-29T21:16:05Z", workflow="KYB_BASIC", - beneficial_owner_entities=[ - { - "address": { - "address1": "123 Old Forest Way", - "city": "Omaha", - "country": "USA", - "postal_code": "68022", - "state": "NE", - "address2": "address2", - }, - "government_id": "114-123-1513", - "legal_business_name": "Acme, Inc.", - "phone_numbers": ["+15555555555"], - "dba_business_name": "dba_business_name", - "parent_company": "parent_company", - } - ], external_id="external_id", kyb_passed_timestamp="2018-05-29T21:16:05Z", naics_code="541512", @@ -1722,24 +1670,6 @@ async def test_method_update_overload_1(self, async_client: AsyncLithic) -> None async def test_method_update_with_all_params_overload_1(self, async_client: AsyncLithic) -> None: account_holder = await async_client.account_holders.update( account_holder_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - beneficial_owner_entities=[ - { - "entity_token": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "address": { - "address1": "123 Old Forest Way", - "address2": "address2", - "city": "Omaha", - "country": "USA", - "postal_code": "68022", - "state": "NE", - }, - "dba_business_name": "dba_business_name", - "government_id": "114-123-1513", - "legal_business_name": "Acme, Inc.", - "parent_company": "parent_company", - "phone_numbers": ["+15555555555"], - } - ], beneficial_owner_individuals=[ { "entity_token": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", diff --git a/tests/api_resources/test_payments.py b/tests/api_resources/test_payments.py index 5a17ca96..864c5031 100644 --- a/tests/api_resources/test_payments.py +++ b/tests/api_resources/test_payments.py @@ -53,6 +53,7 @@ def test_method_create_with_all_params(self, client: Lithic) -> None: }, type="COLLECTION", token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + hold={"token": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, memo="memo", user_defined_id="user_defined_id", ) @@ -475,6 +476,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncLithic) -> }, type="COLLECTION", token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + hold={"token": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}, memo="memo", user_defined_id="user_defined_id", ) diff --git a/tests/api_resources/test_webhooks.py b/tests/api_resources/test_webhooks.py index a2aab3ce..759050fb 100644 --- a/tests/api_resources/test_webhooks.py +++ b/tests/api_resources/test_webhooks.py @@ -22,7 +22,6 @@ class TestWebhooks: timestamp = "1676312382" fake_now = datetime.fromtimestamp(float(timestamp), tz=timezone.utc) - payload = """{"card_token":"sit Lorem ipsum, accusantium repellendus possimus","created_at":"elit. placeat libero architecto molestias, sit","account_token":"elit.","issuer_decision":"magnam, libero esse Lorem ipsum magnam, magnam,","tokenization_attempt_id":"illum dolor repellendus libero esse accusantium","wallet_decisioning_info":{"device_score":"placeat architecto"},"digital_wallet_token_metadata":{"status":"reprehenderit dolor","token_requestor_id":"possimus","payment_account_info":{"account_holder_data":{"phone_number":"libero","email_address":"nobis molestias, veniam culpa! quas elit. quas libero esse architecto placeat"},"pan_unique_reference":"adipisicing odit magnam, odit"}}}""" signature = "Dwa0AHInLL3XFo2sxcHamOQDrJNi7F654S3L6skMAOI=" headers = { @@ -173,7 +172,6 @@ class TestAsyncWebhooks: timestamp = "1676312382" fake_now = datetime.fromtimestamp(float(timestamp), tz=timezone.utc) - payload = """{"card_token":"sit Lorem ipsum, accusantium repellendus possimus","created_at":"elit. placeat libero architecto molestias, sit","account_token":"elit.","issuer_decision":"magnam, libero esse Lorem ipsum magnam, magnam,","tokenization_attempt_id":"illum dolor repellendus libero esse accusantium","wallet_decisioning_info":{"device_score":"placeat architecto"},"digital_wallet_token_metadata":{"status":"reprehenderit dolor","token_requestor_id":"possimus","payment_account_info":{"account_holder_data":{"phone_number":"libero","email_address":"nobis molestias, veniam culpa! quas elit. quas libero esse architecto placeat"},"pan_unique_reference":"adipisicing odit magnam, odit"}}}""" signature = "Dwa0AHInLL3XFo2sxcHamOQDrJNi7F654S3L6skMAOI=" headers = {