From e424839de5a127d48086c9dd1ed5ec7146cdfd6a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 21 Apr 2026 19:11:29 +0000 Subject: [PATCH 1/9] fix(types): make substatus/funding optional, add exemption_type enum value --- .stats.yml | 4 +- src/lithic/resources/accounts.py | 42 ++++++++++--------- ...der_simulate_enrollment_review_response.py | 2 +- .../types/account_holder_update_response.py | 2 +- src/lithic/types/account_update_params.py | 21 ++++++---- src/lithic/types/non_pci_card.py | 6 +-- 6 files changed, 42 insertions(+), 35 deletions(-) diff --git a/.stats.yml b/.stats.yml index 4645bd0f..6d39a89c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 190 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-d29b68bb85936070878d8badaa8a7c5991313285e70a990bc812c838eba85373.yml -openapi_spec_hash: 54b44da68df22eb0ea99f2bc564667a2 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-dc8aacc11d74a1e25c95ba549dd0f4a4e735cbf7562fc6b17b0c81d62fd5475c.yml +openapi_spec_hash: 1906583f260a3e9ace5ae38fd2254763 config_hash: ac8326134e692f3f3bdec82396bbec80 diff --git a/src/lithic/resources/accounts.py b/src/lithic/resources/accounts.py index 703f3b47..073f1320 100644 --- a/src/lithic/resources/accounts.py +++ b/src/lithic/resources/accounts.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Union +from typing import Union, Optional from datetime import datetime from typing_extensions import Literal @@ -85,15 +85,17 @@ def update( lifetime_spend_limit: int | Omit = omit, monthly_spend_limit: int | Omit = omit, state: Literal["ACTIVE", "PAUSED", "CLOSED"] | Omit = omit, - substatus: Literal[ - "FRAUD_IDENTIFIED", - "SUSPICIOUS_ACTIVITY", - "RISK_VIOLATION", - "END_USER_REQUEST", - "ISSUER_REQUEST", - "NOT_ACTIVE", - "INTERNAL_REVIEW", - "OTHER", + substatus: Optional[ + Literal[ + "FRAUD_IDENTIFIED", + "SUSPICIOUS_ACTIVITY", + "RISK_VIOLATION", + "END_USER_REQUEST", + "ISSUER_REQUEST", + "NOT_ACTIVE", + "INTERNAL_REVIEW", + "OTHER", + ] ] | Omit = omit, verification_address: account_update_params.VerificationAddress | Omit = omit, @@ -357,15 +359,17 @@ async def update( lifetime_spend_limit: int | Omit = omit, monthly_spend_limit: int | Omit = omit, state: Literal["ACTIVE", "PAUSED", "CLOSED"] | Omit = omit, - substatus: Literal[ - "FRAUD_IDENTIFIED", - "SUSPICIOUS_ACTIVITY", - "RISK_VIOLATION", - "END_USER_REQUEST", - "ISSUER_REQUEST", - "NOT_ACTIVE", - "INTERNAL_REVIEW", - "OTHER", + substatus: Optional[ + Literal[ + "FRAUD_IDENTIFIED", + "SUSPICIOUS_ACTIVITY", + "RISK_VIOLATION", + "END_USER_REQUEST", + "ISSUER_REQUEST", + "NOT_ACTIVE", + "INTERNAL_REVIEW", + "OTHER", + ] ] | Omit = omit, verification_address: account_update_params.VerificationAddress | Omit = omit, 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 7a8e9b73..067cff10 100644 --- a/src/lithic/types/account_holder_simulate_enrollment_review_response.py +++ b/src/lithic/types/account_holder_simulate_enrollment_review_response.py @@ -336,7 +336,7 @@ class AccountHolderSimulateEnrollmentReviewResponse(BaseModel): exemption_type: Optional[Literal["AUTHORIZED_USER", "PREPAID_CARD_USER"]] = None """The type of KYC exemption for a KYC-Exempt Account Holder. - "None" if the account holder is not KYC-Exempt. + `null` if the account holder is not KYC-Exempt. """ external_id: Optional[str] = None diff --git a/src/lithic/types/account_holder_update_response.py b/src/lithic/types/account_holder_update_response.py index e8d3e882..b46b39c2 100644 --- a/src/lithic/types/account_holder_update_response.py +++ b/src/lithic/types/account_holder_update_response.py @@ -339,7 +339,7 @@ class KYBKYCPatchResponse(BaseModel): exemption_type: Optional[Literal["AUTHORIZED_USER", "PREPAID_CARD_USER"]] = None """The type of KYC exemption for a KYC-Exempt Account Holder. - "None" if the account holder is not KYC-Exempt. + `null` if the account holder is not KYC-Exempt. """ external_id: Optional[str] = None diff --git a/src/lithic/types/account_update_params.py b/src/lithic/types/account_update_params.py index 954590e8..b8a12e19 100644 --- a/src/lithic/types/account_update_params.py +++ b/src/lithic/types/account_update_params.py @@ -2,6 +2,7 @@ from __future__ import annotations +from typing import Optional from typing_extensions import Literal, TypedDict __all__ = ["AccountUpdateParams", "VerificationAddress"] @@ -39,15 +40,17 @@ class AccountUpdateParams(TypedDict, total=False): state: Literal["ACTIVE", "PAUSED", "CLOSED"] """Account states.""" - substatus: Literal[ - "FRAUD_IDENTIFIED", - "SUSPICIOUS_ACTIVITY", - "RISK_VIOLATION", - "END_USER_REQUEST", - "ISSUER_REQUEST", - "NOT_ACTIVE", - "INTERNAL_REVIEW", - "OTHER", + substatus: Optional[ + Literal[ + "FRAUD_IDENTIFIED", + "SUSPICIOUS_ACTIVITY", + "RISK_VIOLATION", + "END_USER_REQUEST", + "ISSUER_REQUEST", + "NOT_ACTIVE", + "INTERNAL_REVIEW", + "OTHER", + ] ] """Account state substatus values: diff --git a/src/lithic/types/non_pci_card.py b/src/lithic/types/non_pci_card.py index 9c1897f5..25345315 100644 --- a/src/lithic/types/non_pci_card.py +++ b/src/lithic/types/non_pci_card.py @@ -11,7 +11,7 @@ class Funding(BaseModel): - """Deprecated: Funding account for the card.""" + """Funding account for a card""" token: str """A globally unique identifier for this FundingAccount.""" @@ -65,8 +65,8 @@ class NonPCICard(BaseModel): created: datetime """An RFC 3339 timestamp for when the card was created. UTC time zone.""" - funding: Funding - """Deprecated: Funding account for the card.""" + funding: Optional[Funding] = None + """Funding account for a card""" last_four: str """Last four digits of the card number.""" From a309c98244ec118cd88eeb7de32d2f79e85d6bbb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 21 Apr 2026 19:35:15 +0000 Subject: [PATCH 2/9] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6d39a89c..ba0cfe28 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 190 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-dc8aacc11d74a1e25c95ba549dd0f4a4e735cbf7562fc6b17b0c81d62fd5475c.yml -openapi_spec_hash: 1906583f260a3e9ace5ae38fd2254763 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-599dd2ac665b09566a84c4871ffb3b7313f6b40d0808b8ab4df63bec608b4f9f.yml +openapi_spec_hash: 429e0ad5e3aae4f63935859c2ac64fdc config_hash: ac8326134e692f3f3bdec82396bbec80 From 0df0d6cf2e2691b4979e5727dd88781229b7e831 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 22 Apr 2026 13:58:08 +0000 Subject: [PATCH 3/9] chore(internal): more robust bootstrap script --- scripts/bootstrap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/bootstrap b/scripts/bootstrap index b430fee3..fe8451e4 100755 --- a/scripts/bootstrap +++ b/scripts/bootstrap @@ -4,7 +4,7 @@ set -e cd "$(dirname "$0")/.." -if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ] && [ -t 0 ]; then +if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "${SKIP_BREW:-}" != "1" ] && [ -t 0 ]; then brew bundle check >/dev/null 2>&1 || { echo -n "==> Install Homebrew dependencies? (y/N): " read -r response From a429a2e6c8915f857d692f567951b03b392791ba Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 24 Apr 2026 15:46:34 +0000 Subject: [PATCH 4/9] feat(api): add AMEX to network enum in settlement reports --- .stats.yml | 4 ++-- src/lithic/resources/reports/settlement/network_totals.py | 4 ++-- .../types/reports/settlement/network_total_list_params.py | 2 +- src/lithic/types/settlement_detail.py | 2 +- src/lithic/types/settlement_summary_details.py | 2 +- tests/api_resources/reports/settlement/test_network_totals.py | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.stats.yml b/.stats.yml index ba0cfe28..90f4d4f1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 190 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-599dd2ac665b09566a84c4871ffb3b7313f6b40d0808b8ab4df63bec608b4f9f.yml -openapi_spec_hash: 429e0ad5e3aae4f63935859c2ac64fdc +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-ab626b78e088455e814b80debc85d420839bc11f95416491fef6a0460f2d95ed.yml +openapi_spec_hash: f6ae1bbed371a5d45927cd63797a9908 config_hash: ac8326134e692f3f3bdec82396bbec80 diff --git a/src/lithic/resources/reports/settlement/network_totals.py b/src/lithic/resources/reports/settlement/network_totals.py index 46781eb9..d1491668 100644 --- a/src/lithic/resources/reports/settlement/network_totals.py +++ b/src/lithic/resources/reports/settlement/network_totals.py @@ -83,7 +83,7 @@ def list( end: Union[str, datetime] | Omit = omit, ending_before: str | Omit = omit, institution_id: str | Omit = omit, - network: Literal["VISA", "MASTERCARD", "MAESTRO", "INTERLINK"] | Omit = omit, + network: Literal["AMEX", "VISA", "MASTERCARD", "MAESTRO", "INTERLINK"] | Omit = omit, page_size: int | Omit = omit, report_date: Union[str, date] | Omit = omit, report_date_begin: Union[str, date] | Omit = omit, @@ -227,7 +227,7 @@ def list( end: Union[str, datetime] | Omit = omit, ending_before: str | Omit = omit, institution_id: str | Omit = omit, - network: Literal["VISA", "MASTERCARD", "MAESTRO", "INTERLINK"] | Omit = omit, + network: Literal["AMEX", "VISA", "MASTERCARD", "MAESTRO", "INTERLINK"] | Omit = omit, page_size: int | Omit = omit, report_date: Union[str, date] | Omit = omit, report_date_begin: Union[str, date] | Omit = omit, diff --git a/src/lithic/types/reports/settlement/network_total_list_params.py b/src/lithic/types/reports/settlement/network_total_list_params.py index 82a82c55..cf8234bf 100644 --- a/src/lithic/types/reports/settlement/network_total_list_params.py +++ b/src/lithic/types/reports/settlement/network_total_list_params.py @@ -33,7 +33,7 @@ class NetworkTotalListParams(TypedDict, total=False): institution_id: str """Institution ID to filter on.""" - network: Literal["VISA", "MASTERCARD", "MAESTRO", "INTERLINK"] + network: Literal["AMEX", "VISA", "MASTERCARD", "MAESTRO", "INTERLINK"] """Network to filter on.""" page_size: int diff --git a/src/lithic/types/settlement_detail.py b/src/lithic/types/settlement_detail.py index a8cd5fa3..ea9b2ade 100644 --- a/src/lithic/types/settlement_detail.py +++ b/src/lithic/types/settlement_detail.py @@ -65,7 +65,7 @@ class SettlementDetail(BaseModel): interchange_gross_amount: int """The total amount of interchange.""" - network: Literal["INTERLINK", "MAESTRO", "MASTERCARD", "UNKNOWN", "VISA"] + network: Literal["AMEX", "INTERLINK", "MAESTRO", "MASTERCARD", "UNKNOWN", "VISA"] """Card network where the transaction took place.""" other_fees_details: OtherFeesDetails diff --git a/src/lithic/types/settlement_summary_details.py b/src/lithic/types/settlement_summary_details.py index 1b04c769..86406db4 100644 --- a/src/lithic/types/settlement_summary_details.py +++ b/src/lithic/types/settlement_summary_details.py @@ -24,7 +24,7 @@ class SettlementSummaryDetails(BaseModel): interchange_gross_amount: Optional[int] = None """The total amount of interchange.""" - network: Optional[Literal["INTERLINK", "MAESTRO", "MASTERCARD", "UNKNOWN", "VISA"]] = None + network: Optional[Literal["AMEX", "INTERLINK", "MAESTRO", "MASTERCARD", "UNKNOWN", "VISA"]] = None """Card network where the transaction took place""" other_fees_gross_amount: Optional[int] = None diff --git a/tests/api_resources/reports/settlement/test_network_totals.py b/tests/api_resources/reports/settlement/test_network_totals.py index 256915ae..4b4da6c1 100644 --- a/tests/api_resources/reports/settlement/test_network_totals.py +++ b/tests/api_resources/reports/settlement/test_network_totals.py @@ -69,7 +69,7 @@ def test_method_list_with_all_params(self, client: Lithic) -> None: end=parse_datetime("2019-12-27T18:11:19.117Z"), ending_before="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", institution_id="institution_id", - network="VISA", + network="AMEX", page_size=1, report_date=parse_date("2019-12-27"), report_date_begin=parse_date("2019-12-27"), @@ -155,7 +155,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncLithic) -> N end=parse_datetime("2019-12-27T18:11:19.117Z"), ending_before="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", institution_id="institution_id", - network="VISA", + network="AMEX", page_size=1, report_date=parse_date("2019-12-27"), report_date_begin=parse_date("2019-12-27"), From 66cbc65975b11d4914b4f3c57b4b7b581cef04d7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 27 Apr 2026 15:04:37 +0000 Subject: [PATCH 5/9] fix: use correct field name format for multipart file arrays --- src/lithic/_qs.py | 8 ++----- src/lithic/_types.py | 3 +++ src/lithic/_utils/_utils.py | 42 ++++++++++++++++++++++++++++++------- tests/test_extract_files.py | 28 ++++++++++++++++++++----- tests/test_files.py | 2 +- 5 files changed, 63 insertions(+), 20 deletions(-) diff --git a/src/lithic/_qs.py b/src/lithic/_qs.py index de8c99bc..4127c19c 100644 --- a/src/lithic/_qs.py +++ b/src/lithic/_qs.py @@ -2,17 +2,13 @@ from typing import Any, List, Tuple, Union, Mapping, TypeVar from urllib.parse import parse_qs, urlencode -from typing_extensions import Literal, get_args +from typing_extensions import get_args -from ._types import NotGiven, not_given +from ._types import NotGiven, ArrayFormat, NestedFormat, not_given from ._utils import flatten _T = TypeVar("_T") - -ArrayFormat = Literal["comma", "repeat", "indices", "brackets"] -NestedFormat = Literal["dots", "brackets"] - PrimitiveData = Union[str, int, float, bool, None] # this should be Data = Union[PrimitiveData, "List[Data]", "Tuple[Data]", "Mapping[str, Data]"] # https://github.com/microsoft/pyright/issues/3555 diff --git a/src/lithic/_types.py b/src/lithic/_types.py index cb48fd28..eb66b5a1 100644 --- a/src/lithic/_types.py +++ b/src/lithic/_types.py @@ -48,6 +48,9 @@ ModelT = TypeVar("ModelT", bound=pydantic.BaseModel) _T = TypeVar("_T") +ArrayFormat = Literal["comma", "repeat", "indices", "brackets"] +NestedFormat = Literal["dots", "brackets"] + # Approximates httpx internal ProxiesTypes and RequestFiles types # while adding support for `PathLike` instances diff --git a/src/lithic/_utils/_utils.py b/src/lithic/_utils/_utils.py index 771859f5..199cd231 100644 --- a/src/lithic/_utils/_utils.py +++ b/src/lithic/_utils/_utils.py @@ -17,11 +17,11 @@ ) from pathlib import Path from datetime import date, datetime -from typing_extensions import TypeGuard +from typing_extensions import TypeGuard, get_args import sniffio -from .._types import Omit, NotGiven, FileTypes, HeadersLike +from .._types import Omit, NotGiven, FileTypes, ArrayFormat, HeadersLike _T = TypeVar("_T") _TupleT = TypeVar("_TupleT", bound=Tuple[object, ...]) @@ -40,25 +40,45 @@ def extract_files( query: Mapping[str, object], *, paths: Sequence[Sequence[str]], + array_format: ArrayFormat = "brackets", ) -> list[tuple[str, FileTypes]]: """Recursively extract files from the given dictionary based on specified paths. A path may look like this ['foo', 'files', '', 'data']. + ``array_format`` controls how ```` segments contribute to the emitted + field name. Supported values: ``"brackets"`` (``foo[]``), ``"repeat"`` and + ``"comma"`` (``foo``), ``"indices"`` (``foo[0]``, ``foo[1]``). + Note: this mutates the given dictionary. """ files: list[tuple[str, FileTypes]] = [] for path in paths: - files.extend(_extract_items(query, path, index=0, flattened_key=None)) + files.extend(_extract_items(query, path, index=0, flattened_key=None, array_format=array_format)) return files +def _array_suffix(array_format: ArrayFormat, array_index: int) -> str: + if array_format == "brackets": + return "[]" + if array_format == "indices": + return f"[{array_index}]" + if array_format == "repeat" or array_format == "comma": + # Both repeat the bare field name for each file part; there is no + # meaningful way to comma-join binary parts. + return "" + raise NotImplementedError( + f"Unknown array_format value: {array_format}, choose from {', '.join(get_args(ArrayFormat))}" + ) + + def _extract_items( obj: object, path: Sequence[str], *, index: int, flattened_key: str | None, + array_format: ArrayFormat, ) -> list[tuple[str, FileTypes]]: try: key = path[index] @@ -75,9 +95,11 @@ def _extract_items( if is_list(obj): files: list[tuple[str, FileTypes]] = [] - for entry in obj: - assert_is_file_content(entry, key=flattened_key + "[]" if flattened_key else "") - files.append((flattened_key + "[]", cast(FileTypes, entry))) + for array_index, entry in enumerate(obj): + suffix = _array_suffix(array_format, array_index) + emitted_key = (flattened_key + suffix) if flattened_key else suffix + assert_is_file_content(entry, key=emitted_key) + files.append((emitted_key, cast(FileTypes, entry))) return files assert_is_file_content(obj, key=flattened_key) @@ -106,6 +128,7 @@ def _extract_items( path, index=index, flattened_key=flattened_key, + array_format=array_format, ) elif is_list(obj): if key != "": @@ -117,9 +140,12 @@ def _extract_items( item, path, index=index, - flattened_key=flattened_key + "[]" if flattened_key is not None else "[]", + flattened_key=( + (flattened_key if flattened_key is not None else "") + _array_suffix(array_format, array_index) + ), + array_format=array_format, ) - for item in obj + for array_index, item in enumerate(obj) ] ) diff --git a/tests/test_extract_files.py b/tests/test_extract_files.py index 83bcdade..2d959bd6 100644 --- a/tests/test_extract_files.py +++ b/tests/test_extract_files.py @@ -4,7 +4,7 @@ import pytest -from lithic._types import FileTypes +from lithic._types import FileTypes, ArrayFormat from lithic._utils import extract_files @@ -37,10 +37,7 @@ def test_multiple_files() -> None: def test_top_level_file_array() -> None: query = {"files": [b"file one", b"file two"], "title": "hello"} - assert extract_files(query, paths=[["files", ""]]) == [ - ("files[]", b"file one"), - ("files[]", b"file two"), - ] + assert extract_files(query, paths=[["files", ""]]) == [("files[]", b"file one"), ("files[]", b"file two")] assert query == {"title": "hello"} @@ -71,3 +68,24 @@ def test_ignores_incorrect_paths( expected: list[tuple[str, FileTypes]], ) -> None: assert extract_files(query, paths=paths) == expected + + +@pytest.mark.parametrize( + "array_format,expected_top_level,expected_nested", + [ + ("brackets", [("files[]", b"a"), ("files[]", b"b")], [("items[][file]", b"a"), ("items[][file]", b"b")]), + ("repeat", [("files", b"a"), ("files", b"b")], [("items[file]", b"a"), ("items[file]", b"b")]), + ("comma", [("files", b"a"), ("files", b"b")], [("items[file]", b"a"), ("items[file]", b"b")]), + ("indices", [("files[0]", b"a"), ("files[1]", b"b")], [("items[0][file]", b"a"), ("items[1][file]", b"b")]), + ], +) +def test_array_format_controls_file_field_names( + array_format: ArrayFormat, + expected_top_level: list[tuple[str, FileTypes]], + expected_nested: list[tuple[str, FileTypes]], +) -> None: + top_level = {"files": [b"a", b"b"]} + assert extract_files(top_level, paths=[["files", ""]], array_format=array_format) == expected_top_level + + nested = {"items": [{"file": b"a"}, {"file": b"b"}]} + assert extract_files(nested, paths=[["items", "", "file"]], array_format=array_format) == expected_nested diff --git a/tests/test_files.py b/tests/test_files.py index 9f7be408..3ab02042 100644 --- a/tests/test_files.py +++ b/tests/test_files.py @@ -131,7 +131,7 @@ def test_extract_files_does_not_mutate_original_nested_array_path(self) -> None: copied = deepcopy_with_paths(original, [["items", "", "file"]]) extracted = extract_files(copied, paths=[["items", "", "file"]]) - assert extracted == [("items[][file]", file1), ("items[][file]", file2)] + assert [entry for _, entry in extracted] == [file1, file2] assert original == { "items": [ {"file": file1, "extra": 1}, From 8e94d661759140b25e202afb48fd00ac63bf68d4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 27 Apr 2026 20:36:34 +0000 Subject: [PATCH 6/9] docs(api): clarify exp_month/exp_year generation in cards create/renew methods --- .stats.yml | 2 +- src/lithic/resources/cards/cards.py | 24 ++++++++++++++++-------- src/lithic/types/card_create_params.py | 8 ++++---- src/lithic/types/card_renew_params.py | 8 ++++---- 4 files changed, 25 insertions(+), 17 deletions(-) diff --git a/.stats.yml b/.stats.yml index 90f4d4f1..d8f17f16 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 190 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-ab626b78e088455e814b80debc85d420839bc11f95416491fef6a0460f2d95ed.yml -openapi_spec_hash: f6ae1bbed371a5d45927cd63797a9908 +openapi_spec_hash: b615a0eb16502b4de874f9ae28491894 config_hash: ac8326134e692f3f3bdec82396bbec80 diff --git a/src/lithic/resources/cards/cards.py b/src/lithic/resources/cards/cards.py index 8b4e7959..3bd8eccd 100644 --- a/src/lithic/resources/cards/cards.py +++ b/src/lithic/resources/cards/cards.py @@ -183,10 +183,12 @@ def create( [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art). exp_month: Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided, - an expiration date will be generated. + an expiration date five years in the future will be generated. Five years is the + maximum expiration date. exp_year: Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is - provided, an expiration date will be generated. + provided, an expiration date five years in the future will be generated. Five + years is the maximum expiration date. memo: Friendly name to identify the card. @@ -1051,10 +1053,12 @@ def renew( carrier: If omitted, the previous carrier will be used. exp_month: Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided, - an expiration date six years in the future will be generated. + an expiration date five years in the future will be generated. Five years is the + maximum expiration date. exp_year: Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is - provided, an expiration date six years in the future will be generated. + provided, an expiration date five years in the future will be generated. Five + years is the maximum expiration date. product_id: Specifies the configuration (e.g. physical card art) that the card should be manufactured with, and only applies to cards of type `PHYSICAL`. This must be @@ -1369,10 +1373,12 @@ async def create( [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art). exp_month: Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided, - an expiration date will be generated. + an expiration date five years in the future will be generated. Five years is the + maximum expiration date. exp_year: Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is - provided, an expiration date will be generated. + provided, an expiration date five years in the future will be generated. Five + years is the maximum expiration date. memo: Friendly name to identify the card. @@ -2237,10 +2243,12 @@ async def renew( carrier: If omitted, the previous carrier will be used. exp_month: Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided, - an expiration date six years in the future will be generated. + an expiration date five years in the future will be generated. Five years is the + maximum expiration date. exp_year: Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is - provided, an expiration date six years in the future will be generated. + provided, an expiration date five years in the future will be generated. Five + years is the maximum expiration date. product_id: Specifies the configuration (e.g. physical card art) that the card should be manufactured with, and only applies to cards of type `PHYSICAL`. This must be diff --git a/src/lithic/types/card_create_params.py b/src/lithic/types/card_create_params.py index bb1c737f..f55c870b 100644 --- a/src/lithic/types/card_create_params.py +++ b/src/lithic/types/card_create_params.py @@ -70,15 +70,15 @@ class CardCreateParams(TypedDict, total=False): exp_month: str """Two digit (MM) expiry month. - If neither `exp_month` nor `exp_year` is provided, an expiration date will be - generated. + If neither `exp_month` nor `exp_year` is provided, an expiration date five years + in the future will be generated. Five years is the maximum expiration date. """ exp_year: str """Four digit (yyyy) expiry year. - If neither `exp_month` nor `exp_year` is provided, an expiration date will be - generated. + If neither `exp_month` nor `exp_year` is provided, an expiration date five years + in the future will be generated. Five years is the maximum expiration date. """ memo: str diff --git a/src/lithic/types/card_renew_params.py b/src/lithic/types/card_renew_params.py index 7f5ac0d8..0e9573cd 100644 --- a/src/lithic/types/card_renew_params.py +++ b/src/lithic/types/card_renew_params.py @@ -20,15 +20,15 @@ class CardRenewParams(TypedDict, total=False): exp_month: str """Two digit (MM) expiry month. - If neither `exp_month` nor `exp_year` is provided, an expiration date six years - in the future will be generated. + If neither `exp_month` nor `exp_year` is provided, an expiration date five years + in the future will be generated. Five years is the maximum expiration date. """ exp_year: str """Four digit (yyyy) expiry year. - If neither `exp_month` nor `exp_year` is provided, an expiration date six years - in the future will be generated. + If neither `exp_month` nor `exp_year` is provided, an expiration date five years + in the future will be generated. Five years is the maximum expiration date. """ product_id: str From 759b6e2ea428bfea52d518cd9dadadac4d4bc393 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 27 Apr 2026 22:32:53 +0000 Subject: [PATCH 7/9] feat: support setting headers via env --- src/lithic/_client.py | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/lithic/_client.py b/src/lithic/_client.py index 4a7a8a88..a9abdb8e 100644 --- a/src/lithic/_client.py +++ b/src/lithic/_client.py @@ -22,7 +22,11 @@ RequestOptions, not_given, ) -from ._utils import is_given, get_async_library +from ._utils import ( + is_given, + is_mapping_t, + get_async_library, +) from ._compat import cached_property from ._version import __version__ from ._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper @@ -197,6 +201,15 @@ def __init__( except KeyError as exc: raise ValueError(f"Unknown environment: {environment}") from exc + custom_headers_env = os.environ.get("LITHIC_CUSTOM_HEADERS") + if custom_headers_env is not None: + parsed: dict[str, str] = {} + for line in custom_headers_env.split("\n"): + colon = line.find(":") + if colon >= 0: + parsed[line[:colon].strip()] = line[colon + 1 :].strip() + default_headers = {**parsed, **(default_headers if is_mapping_t(default_headers) else {})} + super().__init__( version=__version__, base_url=base_url, @@ -612,6 +625,15 @@ def __init__( except KeyError as exc: raise ValueError(f"Unknown environment: {environment}") from exc + custom_headers_env = os.environ.get("LITHIC_CUSTOM_HEADERS") + if custom_headers_env is not None: + parsed: dict[str, str] = {} + for line in custom_headers_env.split("\n"): + colon = line.find(":") + if colon >= 0: + parsed[line[:colon].strip()] = line[colon + 1 :].strip() + default_headers = {**parsed, **(default_headers if is_mapping_t(default_headers) else {})} + super().__init__( version=__version__, base_url=base_url, From 02d196f14c68b906af8ede540b61736b679d68e2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 28 Apr 2026 19:04:32 +0000 Subject: [PATCH 8/9] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index d8f17f16..30879c52 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 190 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-ab626b78e088455e814b80debc85d420839bc11f95416491fef6a0460f2d95ed.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-d6101c64c957742cde9cfdc5d9213ce4e36aa43d045030fa142e27a46b60884a.yml openapi_spec_hash: b615a0eb16502b4de874f9ae28491894 config_hash: ac8326134e692f3f3bdec82396bbec80 From f5502821f5f12a63aba6d38a8ff1ca85e5deafd6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 28 Apr 2026 19:05:06 +0000 Subject: [PATCH 9/9] release: 0.123.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 25 +++++++++++++++++++++++++ pyproject.toml | 2 +- src/lithic/_version.py | 2 +- 4 files changed, 28 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index bd115b20..58ebf7f2 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.122.0" + ".": "0.123.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 3760e200..b628d9ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,30 @@ # Changelog +## 0.123.0 (2026-04-28) + +Full Changelog: [v0.122.0...v0.123.0](https://github.com/lithic-com/lithic-python/compare/v0.122.0...v0.123.0) + +### Features + +* **api:** add AMEX to network enum in settlement reports ([a429a2e](https://github.com/lithic-com/lithic-python/commit/a429a2e6c8915f857d692f567951b03b392791ba)) +* support setting headers via env ([759b6e2](https://github.com/lithic-com/lithic-python/commit/759b6e2ea428bfea52d518cd9dadadac4d4bc393)) + + +### Bug Fixes + +* **types:** make substatus/funding optional, add exemption_type enum value ([e424839](https://github.com/lithic-com/lithic-python/commit/e424839de5a127d48086c9dd1ed5ec7146cdfd6a)) +* use correct field name format for multipart file arrays ([66cbc65](https://github.com/lithic-com/lithic-python/commit/66cbc65975b11d4914b4f3c57b4b7b581cef04d7)) + + +### Chores + +* **internal:** more robust bootstrap script ([0df0d6c](https://github.com/lithic-com/lithic-python/commit/0df0d6cf2e2691b4979e5727dd88781229b7e831)) + + +### Documentation + +* **api:** clarify exp_month/exp_year generation in cards create/renew methods ([8e94d66](https://github.com/lithic-com/lithic-python/commit/8e94d661759140b25e202afb48fd00ac63bf68d4)) + ## 0.122.0 (2026-04-20) Full Changelog: [v0.121.0...v0.122.0](https://github.com/lithic-com/lithic-python/compare/v0.121.0...v0.122.0) diff --git a/pyproject.toml b/pyproject.toml index d67ac65f..bf4d6bbb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "lithic" -version = "0.122.0" +version = "0.123.0" description = "The official Python library for the lithic API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/lithic/_version.py b/src/lithic/_version.py index d7da7751..2236ca43 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.122.0" # x-release-please-version +__version__ = "0.123.0" # x-release-please-version