From 25d22e99426cb96b682c34eff97b659a955e6d7b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 29 Aug 2025 19:15:19 +0000 Subject: [PATCH 1/3] chore(internal): add Sequence related utils --- src/increase/_types.py | 36 ++++++++++++++++++++++++++++++++- src/increase/_utils/__init__.py | 1 + src/increase/_utils/_typing.py | 5 +++++ tests/utils.py | 10 ++++++++- 4 files changed, 50 insertions(+), 2 deletions(-) diff --git a/src/increase/_types.py b/src/increase/_types.py index 1f224398d..5c54a7e80 100644 --- a/src/increase/_types.py +++ b/src/increase/_types.py @@ -13,10 +13,21 @@ Mapping, TypeVar, Callable, + Iterator, Optional, Sequence, ) -from typing_extensions import Set, Literal, Protocol, TypeAlias, TypedDict, override, runtime_checkable +from typing_extensions import ( + Set, + Literal, + Protocol, + TypeAlias, + TypedDict, + SupportsIndex, + overload, + override, + runtime_checkable, +) import httpx import pydantic @@ -217,3 +228,26 @@ class _GenericAlias(Protocol): class HttpxSendArgs(TypedDict, total=False): auth: httpx.Auth follow_redirects: bool + + +_T_co = TypeVar("_T_co", covariant=True) + + +if TYPE_CHECKING: + # This works because str.__contains__ does not accept object (either in typeshed or at runtime) + # https://github.com/hauntsaninja/useful_types/blob/5e9710f3875107d068e7679fd7fec9cfab0eff3b/useful_types/__init__.py#L285 + class SequenceNotStr(Protocol[_T_co]): + @overload + def __getitem__(self, index: SupportsIndex, /) -> _T_co: ... + @overload + def __getitem__(self, index: slice, /) -> Sequence[_T_co]: ... + def __contains__(self, value: object, /) -> bool: ... + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[_T_co]: ... + def index(self, value: Any, start: int = 0, stop: int = ..., /) -> int: ... + def count(self, value: Any, /) -> int: ... + def __reversed__(self) -> Iterator[_T_co]: ... +else: + # just point this to a normal `Sequence` at runtime to avoid having to special case + # deserializing our custom sequence type + SequenceNotStr = Sequence diff --git a/src/increase/_utils/__init__.py b/src/increase/_utils/__init__.py index d4fda26f3..ca547ce52 100644 --- a/src/increase/_utils/__init__.py +++ b/src/increase/_utils/__init__.py @@ -38,6 +38,7 @@ extract_type_arg as extract_type_arg, is_iterable_type as is_iterable_type, is_required_type as is_required_type, + is_sequence_type as is_sequence_type, is_annotated_type as is_annotated_type, is_type_alias_type as is_type_alias_type, strip_annotated_type as strip_annotated_type, diff --git a/src/increase/_utils/_typing.py b/src/increase/_utils/_typing.py index 1bac9542e..845cd6b28 100644 --- a/src/increase/_utils/_typing.py +++ b/src/increase/_utils/_typing.py @@ -26,6 +26,11 @@ def is_list_type(typ: type) -> bool: return (get_origin(typ) or typ) == list +def is_sequence_type(typ: type) -> bool: + origin = get_origin(typ) or typ + return origin == typing_extensions.Sequence or origin == typing.Sequence or origin == _c_abc.Sequence + + def is_iterable_type(typ: type) -> bool: """If the given type is `typing.Iterable[T]`""" origin = get_origin(typ) or typ diff --git a/tests/utils.py b/tests/utils.py index 553f11c59..ed9af8295 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -4,7 +4,7 @@ import inspect import traceback import contextlib -from typing import Any, TypeVar, Iterator, cast +from typing import Any, TypeVar, Iterator, Sequence, cast from datetime import date, datetime from typing_extensions import Literal, get_args, get_origin, assert_type @@ -15,6 +15,7 @@ is_list_type, is_union_type, extract_type_arg, + is_sequence_type, is_annotated_type, is_type_alias_type, ) @@ -71,6 +72,13 @@ def assert_matches_type( if is_list_type(type_): return _assert_list_type(type_, value) + if is_sequence_type(type_): + assert isinstance(value, Sequence) + inner_type = get_args(type_)[0] + for entry in value: # type: ignore + assert_type(inner_type, entry) # type: ignore + return + if origin == str: assert isinstance(value, str) elif origin == int: From 26de7b0ffbae63587dc0a9dd944874eea6202c0f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 29 Aug 2025 21:28:03 +0000 Subject: [PATCH 2/3] feat(api): api update --- .stats.yml | 4 ++-- src/increase/resources/documents.py | 12 ++++++++---- src/increase/resources/entities.py | 4 ++-- src/increase/types/ach_transfer_create_params.py | 8 ++++++-- src/increase/types/document_create_params.py | 10 ++++++++-- src/increase/types/entity_create_params.py | 5 +++-- 6 files changed, 29 insertions(+), 14 deletions(-) diff --git a/.stats.yml b/.stats.yml index 76d80ce71..a123afd0f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 216 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-a3db5141ad8a06aca3ec4fbc0a4414af61ffea1bbd6470b4a9ad13f8b24ed9eb.yml -openapi_spec_hash: 1192108447914f9233f6e0933dd36033 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-4951789bd74367647a7109ac527206883115628aac13b8131b0bc046ead9cc5c.yml +openapi_spec_hash: 924a557a551c40624e4fe4703dec71cc config_hash: 632b628b59d8f0b717153b3d8133f6cb diff --git a/src/increase/resources/documents.py b/src/increase/resources/documents.py index 244ca7b12..772adfe32 100644 --- a/src/increase/resources/documents.py +++ b/src/increase/resources/documents.py @@ -67,9 +67,11 @@ def create( - `account_verification_letter` - An account verification letter. - `funding_instructions` - Funding instructions. - account_verification_letter: An account verification letter. + account_verification_letter: An account verification letter. Required if and only if `category` is + `account_verification_letter`. - funding_instructions: Funding instructions. + funding_instructions: Funding instructions. Required if and only if `category` is + `funding_instructions`. extra_headers: Send extra headers @@ -243,9 +245,11 @@ async def create( - `account_verification_letter` - An account verification letter. - `funding_instructions` - Funding instructions. - account_verification_letter: An account verification letter. + account_verification_letter: An account verification letter. Required if and only if `category` is + `account_verification_letter`. - funding_instructions: Funding instructions. + funding_instructions: Funding instructions. Required if and only if `category` is + `funding_instructions`. extra_headers: Send extra headers diff --git a/src/increase/resources/entities.py b/src/increase/resources/entities.py index 2ba90c0c7..8f7a39fd5 100644 --- a/src/increase/resources/entities.py +++ b/src/increase/resources/entities.py @@ -93,7 +93,7 @@ def create( description: The description you choose to give the entity. government_authority: Details of the Government Authority entity to create. Required if `structure` is - equal to `Government Authority`. + equal to `government_authority`. joint: Details of the joint entity to create. Required if `structure` is equal to `joint`. @@ -651,7 +651,7 @@ async def create( description: The description you choose to give the entity. government_authority: Details of the Government Authority entity to create. Required if `structure` is - equal to `Government Authority`. + equal to `government_authority`. joint: Details of the joint entity to create. Required if `structure` is equal to `joint`. diff --git a/src/increase/types/ach_transfer_create_params.py b/src/increase/types/ach_transfer_create_params.py index aabf372cd..d4b0566cd 100644 --- a/src/increase/types/ach_transfer_create_params.py +++ b/src/increase/types/ach_transfer_create_params.py @@ -193,13 +193,17 @@ class Addenda(TypedDict, total=False): """ freeform: AddendaFreeform - """Unstructured `payment_related_information` passed through with the transfer.""" + """Unstructured `payment_related_information` passed through with the transfer. + + Required if and only if `category` is `freeform`. + """ payment_order_remittance_advice: AddendaPaymentOrderRemittanceAdvice """Structured ASC X12 820 remittance advice records. Please reach out to [support@increase.com](mailto:support@increase.com) for more - information. + information. Required if and only if `category` is + `payment_order_remittance_advice`. """ diff --git a/src/increase/types/document_create_params.py b/src/increase/types/document_create_params.py index 1f4d9245e..986255c7a 100644 --- a/src/increase/types/document_create_params.py +++ b/src/increase/types/document_create_params.py @@ -20,10 +20,16 @@ class DocumentCreateParams(TypedDict, total=False): """ account_verification_letter: AccountVerificationLetter - """An account verification letter.""" + """An account verification letter. + + Required if and only if `category` is `account_verification_letter`. + """ funding_instructions: FundingInstructions - """Funding instructions.""" + """Funding instructions. + + Required if and only if `category` is `funding_instructions`. + """ class AccountVerificationLetter(TypedDict, total=False): diff --git a/src/increase/types/entity_create_params.py b/src/increase/types/entity_create_params.py index 65cff4053..7b43b7df9 100644 --- a/src/increase/types/entity_create_params.py +++ b/src/increase/types/entity_create_params.py @@ -78,7 +78,7 @@ class EntityCreateParams(TypedDict, total=False): government_authority: GovernmentAuthority """Details of the Government Authority entity to create. - Required if `structure` is equal to `Government Authority`. + Required if `structure` is equal to `government_authority`. """ joint: Joint @@ -872,7 +872,8 @@ class TrustTrustee(TypedDict, total=False): individual: TrustTrusteeIndividual """Details of the individual trustee. - Required when the trustee `structure` is equal to `individual`. + Within the trustee object, this is required if `structure` is equal to + `individual`. """ From f9ad6b0d5b637be3232cbd284b80125a8f07a4c1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 29 Aug 2025 21:28:24 +0000 Subject: [PATCH 3/3] release: 0.311.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 13 +++++++++++++ pyproject.toml | 2 +- src/increase/_version.py | 2 +- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index bfd395f2e..269cfb5d4 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.310.0" + ".": "0.311.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index ecfad95a0..9ce26dcf2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 0.311.0 (2025-08-29) + +Full Changelog: [v0.310.0...v0.311.0](https://github.com/Increase/increase-python/compare/v0.310.0...v0.311.0) + +### Features + +* **api:** api update ([26de7b0](https://github.com/Increase/increase-python/commit/26de7b0ffbae63587dc0a9dd944874eea6202c0f)) + + +### Chores + +* **internal:** add Sequence related utils ([25d22e9](https://github.com/Increase/increase-python/commit/25d22e99426cb96b682c34eff97b659a955e6d7b)) + ## 0.310.0 (2025-08-29) Full Changelog: [v0.309.0...v0.310.0](https://github.com/Increase/increase-python/compare/v0.309.0...v0.310.0) diff --git a/pyproject.toml b/pyproject.toml index 7a02658b1..34a0dc541 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "increase" -version = "0.310.0" +version = "0.311.0" description = "The official Python library for the increase API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/increase/_version.py b/src/increase/_version.py index 5eb1d6f3a..7811b46b3 100644 --- a/src/increase/_version.py +++ b/src/increase/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "increase" -__version__ = "0.310.0" # x-release-please-version +__version__ = "0.311.0" # x-release-please-version