From 39c3faca288ac586ef500a6e2fb1615c156dfdb4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 12 Mar 2026 16:19:22 +0000 Subject: [PATCH 1/3] feat(api): api update --- .stats.yml | 8 +- api.md | 1 + src/increase/resources/beneficial_owners.py | 137 +++++++++- src/increase/types/__init__.py | 1 + .../types/beneficial_owner_create_params.py | 205 +++++++++++++++ src/increase/types/entity_beneficial_owner.py | 8 + tests/api_resources/test_beneficial_owners.py | 238 +++++++++++++++++- 7 files changed, 592 insertions(+), 6 deletions(-) create mode 100644 src/increase/types/beneficial_owner_create_params.py diff --git a/.stats.yml b/.stats.yml index c29f1d48..3528901c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 236 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-4d9e8a8a1909ef7c96fe28293ab07720938ce09be84687c57e3cf95890a78205.yml -openapi_spec_hash: 4b3867a81a8429bf6ab119f910e72865 -config_hash: e73b1147c039cb3d6a2c56ae5926bca8 +configured_endpoints: 237 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-2c11248a841117464c3d87ee8069761f8fdf1a235557bbc885bcfa13de4107c4.yml +openapi_spec_hash: 6bcd6b02eaff96080fc9f57fd5942502 +config_hash: 81fdd83e44056d1f623e280bc106245d diff --git a/api.md b/api.md index 59ec1bac..b0a9f92e 100644 --- a/api.md +++ b/api.md @@ -513,6 +513,7 @@ from increase.types import EntityBeneficialOwner Methods: +- client.beneficial_owners.create(\*\*params) -> EntityBeneficialOwner - client.beneficial_owners.retrieve(entity_beneficial_owner_id) -> EntityBeneficialOwner - client.beneficial_owners.update(entity_beneficial_owner_id, \*\*params) -> EntityBeneficialOwner - client.beneficial_owners.list(\*\*params) -> SyncPage[EntityBeneficialOwner] diff --git a/src/increase/resources/beneficial_owners.py b/src/increase/resources/beneficial_owners.py index 0ad56c1c..c5117b76 100644 --- a/src/increase/resources/beneficial_owners.py +++ b/src/increase/resources/beneficial_owners.py @@ -2,9 +2,12 @@ from __future__ import annotations +from typing import List +from typing_extensions import Literal + import httpx -from ..types import beneficial_owner_list_params, beneficial_owner_update_params +from ..types import beneficial_owner_list_params, beneficial_owner_create_params, beneficial_owner_update_params from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property @@ -42,6 +45,66 @@ def with_streaming_response(self) -> BeneficialOwnersResourceWithStreamingRespon """ return BeneficialOwnersResourceWithStreamingResponse(self) + def create( + self, + *, + entity_id: str, + individual: beneficial_owner_create_params.Individual, + prongs: List[Literal["ownership", "control"]], + company_title: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> EntityBeneficialOwner: + """ + Create a beneficial owner + + Args: + entity_id: The identifier of the Entity to associate with the new Beneficial Owner. + + individual: Personal details for the beneficial owner. + + prongs: Why this person is considered a beneficial owner of the entity. At least one + option is required, if a person is both a control person and owner, submit an + array containing both. + + company_title: This person's role or title within the entity. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + return self._post( + "/entity_beneficial_owners", + body=maybe_transform( + { + "entity_id": entity_id, + "individual": individual, + "prongs": prongs, + "company_title": company_title, + }, + beneficial_owner_create_params.BeneficialOwnerCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=EntityBeneficialOwner, + ) + def retrieve( self, entity_beneficial_owner_id: str, @@ -273,6 +336,66 @@ def with_streaming_response(self) -> AsyncBeneficialOwnersResourceWithStreamingR """ return AsyncBeneficialOwnersResourceWithStreamingResponse(self) + async def create( + self, + *, + entity_id: str, + individual: beneficial_owner_create_params.Individual, + prongs: List[Literal["ownership", "control"]], + company_title: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> EntityBeneficialOwner: + """ + Create a beneficial owner + + Args: + entity_id: The identifier of the Entity to associate with the new Beneficial Owner. + + individual: Personal details for the beneficial owner. + + prongs: Why this person is considered a beneficial owner of the entity. At least one + option is required, if a person is both a control person and owner, submit an + array containing both. + + company_title: This person's role or title within the entity. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + return await self._post( + "/entity_beneficial_owners", + body=await async_maybe_transform( + { + "entity_id": entity_id, + "individual": individual, + "prongs": prongs, + "company_title": company_title, + }, + beneficial_owner_create_params.BeneficialOwnerCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=EntityBeneficialOwner, + ) + async def retrieve( self, entity_beneficial_owner_id: str, @@ -488,6 +611,9 @@ class BeneficialOwnersResourceWithRawResponse: def __init__(self, beneficial_owners: BeneficialOwnersResource) -> None: self._beneficial_owners = beneficial_owners + self.create = to_raw_response_wrapper( + beneficial_owners.create, + ) self.retrieve = to_raw_response_wrapper( beneficial_owners.retrieve, ) @@ -506,6 +632,9 @@ class AsyncBeneficialOwnersResourceWithRawResponse: def __init__(self, beneficial_owners: AsyncBeneficialOwnersResource) -> None: self._beneficial_owners = beneficial_owners + self.create = async_to_raw_response_wrapper( + beneficial_owners.create, + ) self.retrieve = async_to_raw_response_wrapper( beneficial_owners.retrieve, ) @@ -524,6 +653,9 @@ class BeneficialOwnersResourceWithStreamingResponse: def __init__(self, beneficial_owners: BeneficialOwnersResource) -> None: self._beneficial_owners = beneficial_owners + self.create = to_streamed_response_wrapper( + beneficial_owners.create, + ) self.retrieve = to_streamed_response_wrapper( beneficial_owners.retrieve, ) @@ -542,6 +674,9 @@ class AsyncBeneficialOwnersResourceWithStreamingResponse: def __init__(self, beneficial_owners: AsyncBeneficialOwnersResource) -> None: self._beneficial_owners = beneficial_owners + self.create = async_to_streamed_response_wrapper( + beneficial_owners.create, + ) self.retrieve = async_to_streamed_response_wrapper( beneficial_owners.retrieve, ) diff --git a/src/increase/types/__init__.py b/src/increase/types/__init__.py index 8543aee3..18bb99f0 100644 --- a/src/increase/types/__init__.py +++ b/src/increase/types/__init__.py @@ -123,6 +123,7 @@ from .intrafi_exclusion_list_params import IntrafiExclusionListParams as IntrafiExclusionListParams from .oauth_application_list_params import OAuthApplicationListParams as OAuthApplicationListParams from .account_transfer_create_params import AccountTransferCreateParams as AccountTransferCreateParams +from .beneficial_owner_create_params import BeneficialOwnerCreateParams as BeneficialOwnerCreateParams from .beneficial_owner_update_params import BeneficialOwnerUpdateParams as BeneficialOwnerUpdateParams from .card_push_transfer_list_params import CardPushTransferListParams as CardPushTransferListParams from .event_subscription_list_params import EventSubscriptionListParams as EventSubscriptionListParams diff --git a/src/increase/types/beneficial_owner_create_params.py b/src/increase/types/beneficial_owner_create_params.py new file mode 100644 index 00000000..36ed82d9 --- /dev/null +++ b/src/increase/types/beneficial_owner_create_params.py @@ -0,0 +1,205 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Union +from datetime import date +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = [ + "BeneficialOwnerCreateParams", + "Individual", + "IndividualAddress", + "IndividualIdentification", + "IndividualIdentificationDriversLicense", + "IndividualIdentificationOther", + "IndividualIdentificationPassport", +] + + +class BeneficialOwnerCreateParams(TypedDict, total=False): + entity_id: Required[str] + """The identifier of the Entity to associate with the new Beneficial Owner.""" + + individual: Required[Individual] + """Personal details for the beneficial owner.""" + + prongs: Required[List[Literal["ownership", "control"]]] + """Why this person is considered a beneficial owner of the entity. + + At least one option is required, if a person is both a control person and owner, + submit an array containing both. + """ + + company_title: str + """This person's role or title within the entity.""" + + +class IndividualAddress(TypedDict, total=False): + """The individual's physical address. + + Mail receiving locations like PO Boxes and PMB's are disallowed. + """ + + city: Required[str] + """The city, district, town, or village of the address.""" + + country: Required[str] + """The two-letter ISO 3166-1 alpha-2 code for the country of the address.""" + + line1: Required[str] + """The first line of the address. This is usually the street number and street.""" + + line2: str + """The second line of the address. This might be the floor or room number.""" + + state: str + """ + The two-letter United States Postal Service (USPS) abbreviation for the US + state, province, or region of the address. Required in certain countries. + """ + + zip: str + """The ZIP or postal code of the address. Required in certain countries.""" + + +class IndividualIdentificationDriversLicense(TypedDict, total=False): + """Information about the United States driver's license used for identification. + + Required if `method` is equal to `drivers_license`. + """ + + expiration_date: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]] + """The driver's license's expiration date in YYYY-MM-DD format.""" + + file_id: Required[str] + """The identifier of the File containing the front of the driver's license.""" + + state: Required[str] + """The state that issued the provided driver's license.""" + + back_file_id: str + """The identifier of the File containing the back of the driver's license.""" + + +class IndividualIdentificationOther(TypedDict, total=False): + """Information about the identification document provided. + + Required if `method` is equal to `other`. + """ + + country: Required[str] + """ + The two-character ISO 3166-1 code representing the country that issued the + document (e.g., `US`). + """ + + description: Required[str] + """A description of the document submitted.""" + + file_id: Required[str] + """The identifier of the File containing the front of the document.""" + + back_file_id: str + """The identifier of the File containing the back of the document. + + Not every document has a reverse side. + """ + + expiration_date: Annotated[Union[str, date], PropertyInfo(format="iso8601")] + """The document's expiration date in YYYY-MM-DD format.""" + + +class IndividualIdentificationPassport(TypedDict, total=False): + """Information about the passport used for identification. + + Required if `method` is equal to `passport`. + """ + + country: Required[str] + """ + The two-character ISO 3166-1 code representing the country that issued the + document (e.g., `US`). + """ + + expiration_date: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]] + """The passport's expiration date in YYYY-MM-DD format.""" + + file_id: Required[str] + """The identifier of the File containing the passport.""" + + +class IndividualIdentification(TypedDict, total=False, extra_items=object): # type: ignore[call-arg] + """A means of verifying the person's identity.""" + + method: Required[ + Literal[ + "social_security_number", + "individual_taxpayer_identification_number", + "passport", + "drivers_license", + "other", + ] + ] + """A method that can be used to verify the individual's identity. + + - `social_security_number` - A social security number. + - `individual_taxpayer_identification_number` - An individual taxpayer + identification number (ITIN). + - `passport` - A passport number. + - `drivers_license` - A driver's license number. + - `other` - Another identifying document. + """ + + number: Required[str] + """ + An identification number that can be used to verify the individual's identity, + such as a social security number. + """ + + drivers_license: IndividualIdentificationDriversLicense + """Information about the United States driver's license used for identification. + + Required if `method` is equal to `drivers_license`. + """ + + other: IndividualIdentificationOther + """Information about the identification document provided. + + Required if `method` is equal to `other`. + """ + + passport: IndividualIdentificationPassport + """Information about the passport used for identification. + + Required if `method` is equal to `passport`. + """ + + +class Individual(TypedDict, total=False): + """Personal details for the beneficial owner.""" + + address: Required[IndividualAddress] + """The individual's physical address. + + Mail receiving locations like PO Boxes and PMB's are disallowed. + """ + + date_of_birth: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]] + """The person's date of birth in YYYY-MM-DD format.""" + + identification: Required[IndividualIdentification] + """A means of verifying the person's identity.""" + + name: Required[str] + """The person's legal name.""" + + confirmed_no_us_tax_id: bool + """ + The identification method for an individual can only be a passport, driver's + license, or other document if you've confirmed the individual does not have a US + tax id (either a Social Security Number or Individual Taxpayer Identification + Number). + """ diff --git a/src/increase/types/entity_beneficial_owner.py b/src/increase/types/entity_beneficial_owner.py index 1fc813c1..d16d5cf1 100644 --- a/src/increase/types/entity_beneficial_owner.py +++ b/src/increase/types/entity_beneficial_owner.py @@ -104,6 +104,14 @@ class EntityBeneficialOwner(BaseModel): Beneficial Owner was created. """ + idempotency_key: Optional[str] = None + """The idempotency key you chose for this object. + + This value is unique across Increase and is used to ensure that a request is + only processed once. Learn more about + [idempotency](https://increase.com/documentation/idempotency-keys). + """ + individual: Individual """Personal details for the beneficial owner.""" diff --git a/tests/api_resources/test_beneficial_owners.py b/tests/api_resources/test_beneficial_owners.py index 4e58345c..7ab7279d 100644 --- a/tests/api_resources/test_beneficial_owners.py +++ b/tests/api_resources/test_beneficial_owners.py @@ -9,7 +9,9 @@ from increase import Increase, AsyncIncrease from tests.utils import assert_matches_type -from increase.types import EntityBeneficialOwner +from increase.types import ( + EntityBeneficialOwner, +) from increase._utils import parse_date from increase.pagination import SyncPage, AsyncPage @@ -19,6 +21,123 @@ class TestBeneficialOwners: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @parametrize + def test_method_create(self, client: Increase) -> None: + beneficial_owner = client.beneficial_owners.create( + entity_id="entity_n8y8tnk2p9339ti393yi", + individual={ + "address": { + "city": "New York", + "country": "US", + "line1": "33 Liberty Street", + }, + "date_of_birth": parse_date("1970-01-31"), + "identification": { + "method": "social_security_number", + "number": "078051120", + }, + "name": "Ian Crease", + }, + prongs=["control"], + ) + assert_matches_type(EntityBeneficialOwner, beneficial_owner, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Increase) -> None: + beneficial_owner = client.beneficial_owners.create( + entity_id="entity_n8y8tnk2p9339ti393yi", + individual={ + "address": { + "city": "New York", + "country": "US", + "line1": "33 Liberty Street", + "line2": "x", + "state": "NY", + "zip": "10045", + }, + "date_of_birth": parse_date("1970-01-31"), + "identification": { + "method": "social_security_number", + "number": "078051120", + "drivers_license": { + "expiration_date": parse_date("2019-12-27"), + "file_id": "file_id", + "state": "x", + "back_file_id": "back_file_id", + }, + "other": { + "country": "x", + "description": "x", + "file_id": "file_id", + "back_file_id": "back_file_id", + "expiration_date": parse_date("2019-12-27"), + }, + "passport": { + "country": "x", + "expiration_date": parse_date("2019-12-27"), + "file_id": "file_id", + }, + }, + "name": "Ian Crease", + "confirmed_no_us_tax_id": True, + }, + prongs=["control"], + company_title="CEO", + ) + assert_matches_type(EntityBeneficialOwner, beneficial_owner, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Increase) -> None: + response = client.beneficial_owners.with_raw_response.create( + entity_id="entity_n8y8tnk2p9339ti393yi", + individual={ + "address": { + "city": "New York", + "country": "US", + "line1": "33 Liberty Street", + }, + "date_of_birth": parse_date("1970-01-31"), + "identification": { + "method": "social_security_number", + "number": "078051120", + }, + "name": "Ian Crease", + }, + prongs=["control"], + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + beneficial_owner = response.parse() + assert_matches_type(EntityBeneficialOwner, beneficial_owner, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Increase) -> None: + with client.beneficial_owners.with_streaming_response.create( + entity_id="entity_n8y8tnk2p9339ti393yi", + individual={ + "address": { + "city": "New York", + "country": "US", + "line1": "33 Liberty Street", + }, + "date_of_birth": parse_date("1970-01-31"), + "identification": { + "method": "social_security_number", + "number": "078051120", + }, + "name": "Ian Crease", + }, + prongs=["control"], + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + beneficial_owner = response.parse() + assert_matches_type(EntityBeneficialOwner, beneficial_owner, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize def test_method_retrieve(self, client: Increase) -> None: beneficial_owner = client.beneficial_owners.retrieve( @@ -225,6 +344,123 @@ class TestAsyncBeneficialOwners: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) + @parametrize + async def test_method_create(self, async_client: AsyncIncrease) -> None: + beneficial_owner = await async_client.beneficial_owners.create( + entity_id="entity_n8y8tnk2p9339ti393yi", + individual={ + "address": { + "city": "New York", + "country": "US", + "line1": "33 Liberty Street", + }, + "date_of_birth": parse_date("1970-01-31"), + "identification": { + "method": "social_security_number", + "number": "078051120", + }, + "name": "Ian Crease", + }, + prongs=["control"], + ) + assert_matches_type(EntityBeneficialOwner, beneficial_owner, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncIncrease) -> None: + beneficial_owner = await async_client.beneficial_owners.create( + entity_id="entity_n8y8tnk2p9339ti393yi", + individual={ + "address": { + "city": "New York", + "country": "US", + "line1": "33 Liberty Street", + "line2": "x", + "state": "NY", + "zip": "10045", + }, + "date_of_birth": parse_date("1970-01-31"), + "identification": { + "method": "social_security_number", + "number": "078051120", + "drivers_license": { + "expiration_date": parse_date("2019-12-27"), + "file_id": "file_id", + "state": "x", + "back_file_id": "back_file_id", + }, + "other": { + "country": "x", + "description": "x", + "file_id": "file_id", + "back_file_id": "back_file_id", + "expiration_date": parse_date("2019-12-27"), + }, + "passport": { + "country": "x", + "expiration_date": parse_date("2019-12-27"), + "file_id": "file_id", + }, + }, + "name": "Ian Crease", + "confirmed_no_us_tax_id": True, + }, + prongs=["control"], + company_title="CEO", + ) + assert_matches_type(EntityBeneficialOwner, beneficial_owner, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncIncrease) -> None: + response = await async_client.beneficial_owners.with_raw_response.create( + entity_id="entity_n8y8tnk2p9339ti393yi", + individual={ + "address": { + "city": "New York", + "country": "US", + "line1": "33 Liberty Street", + }, + "date_of_birth": parse_date("1970-01-31"), + "identification": { + "method": "social_security_number", + "number": "078051120", + }, + "name": "Ian Crease", + }, + prongs=["control"], + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + beneficial_owner = await response.parse() + assert_matches_type(EntityBeneficialOwner, beneficial_owner, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncIncrease) -> None: + async with async_client.beneficial_owners.with_streaming_response.create( + entity_id="entity_n8y8tnk2p9339ti393yi", + individual={ + "address": { + "city": "New York", + "country": "US", + "line1": "33 Liberty Street", + }, + "date_of_birth": parse_date("1970-01-31"), + "identification": { + "method": "social_security_number", + "number": "078051120", + }, + "name": "Ian Crease", + }, + prongs=["control"], + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + beneficial_owner = await response.parse() + assert_matches_type(EntityBeneficialOwner, beneficial_owner, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize async def test_method_retrieve(self, async_client: AsyncIncrease) -> None: beneficial_owner = await async_client.beneficial_owners.retrieve( From 910abf5ad3122dceeed4114fb355bb4864275522 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 12 Mar 2026 16:28:06 +0000 Subject: [PATCH 2/3] feat(api): api update --- .stats.yml | 8 +- api.md | 1 - src/increase/resources/entities.py | 119 +------ src/increase/types/__init__.py | 3 - .../entity_create_beneficial_owner_params.py | 215 ------------- tests/api_resources/test_entities.py | 300 +----------------- 6 files changed, 6 insertions(+), 640 deletions(-) delete mode 100644 src/increase/types/entity_create_beneficial_owner_params.py diff --git a/.stats.yml b/.stats.yml index 3528901c..89d1fa6c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 237 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-2c11248a841117464c3d87ee8069761f8fdf1a235557bbc885bcfa13de4107c4.yml -openapi_spec_hash: 6bcd6b02eaff96080fc9f57fd5942502 -config_hash: 81fdd83e44056d1f623e280bc106245d +configured_endpoints: 236 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-5c95dd79214af830e2e7fb34ab05f98bde9213311d5e2d59f9a816a8e0369b85.yml +openapi_spec_hash: ec66c2961a8b90e06ea57f934d8d75db +config_hash: 25d7d7aa4882db6189b4b53e8e249e80 diff --git a/api.md b/api.md index b0a9f92e..0d68ea18 100644 --- a/api.md +++ b/api.md @@ -501,7 +501,6 @@ Methods: - client.entities.update(entity_id, \*\*params) -> Entity - client.entities.list(\*\*params) -> SyncPage[Entity] - client.entities.archive(entity_id) -> Entity -- client.entities.create_beneficial_owner(entity_id, \*\*params) -> Entity # BeneficialOwners diff --git a/src/increase/resources/entities.py b/src/increase/resources/entities.py index 3d535c6f..b5b0808c 100644 --- a/src/increase/resources/entities.py +++ b/src/increase/resources/entities.py @@ -8,12 +8,7 @@ import httpx -from ..types import ( - entity_list_params, - entity_create_params, - entity_update_params, - entity_create_beneficial_owner_params, -) +from ..types import entity_list_params, entity_create_params, entity_update_params from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property @@ -376,56 +371,6 @@ def archive( cast_to=Entity, ) - def create_beneficial_owner( - self, - entity_id: str, - *, - beneficial_owner: entity_create_beneficial_owner_params.BeneficialOwner, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - idempotency_key: str | None = None, - ) -> Entity: - """ - Create a beneficial owner for a corporate Entity - - Args: - entity_id: The identifier of the Entity to associate with the new Beneficial Owner. - - beneficial_owner: The identifying details of anyone controlling or owning 25% or more of the - corporation. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - - idempotency_key: Specify a custom idempotency key for this request - """ - if not entity_id: - raise ValueError(f"Expected a non-empty value for `entity_id` but received {entity_id!r}") - return self._post( - f"/entities/{entity_id}/create_beneficial_owner", - body=maybe_transform( - {"beneficial_owner": beneficial_owner}, - entity_create_beneficial_owner_params.EntityCreateBeneficialOwnerParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - idempotency_key=idempotency_key, - ), - cast_to=Entity, - ) - class AsyncEntitiesResource(AsyncAPIResource): @cached_property @@ -772,56 +717,6 @@ async def archive( cast_to=Entity, ) - async def create_beneficial_owner( - self, - entity_id: str, - *, - beneficial_owner: entity_create_beneficial_owner_params.BeneficialOwner, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - idempotency_key: str | None = None, - ) -> Entity: - """ - Create a beneficial owner for a corporate Entity - - Args: - entity_id: The identifier of the Entity to associate with the new Beneficial Owner. - - beneficial_owner: The identifying details of anyone controlling or owning 25% or more of the - corporation. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - - idempotency_key: Specify a custom idempotency key for this request - """ - if not entity_id: - raise ValueError(f"Expected a non-empty value for `entity_id` but received {entity_id!r}") - return await self._post( - f"/entities/{entity_id}/create_beneficial_owner", - body=await async_maybe_transform( - {"beneficial_owner": beneficial_owner}, - entity_create_beneficial_owner_params.EntityCreateBeneficialOwnerParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - idempotency_key=idempotency_key, - ), - cast_to=Entity, - ) - class EntitiesResourceWithRawResponse: def __init__(self, entities: EntitiesResource) -> None: @@ -842,9 +737,6 @@ def __init__(self, entities: EntitiesResource) -> None: self.archive = to_raw_response_wrapper( entities.archive, ) - self.create_beneficial_owner = to_raw_response_wrapper( - entities.create_beneficial_owner, - ) class AsyncEntitiesResourceWithRawResponse: @@ -866,9 +758,6 @@ def __init__(self, entities: AsyncEntitiesResource) -> None: self.archive = async_to_raw_response_wrapper( entities.archive, ) - self.create_beneficial_owner = async_to_raw_response_wrapper( - entities.create_beneficial_owner, - ) class EntitiesResourceWithStreamingResponse: @@ -890,9 +779,6 @@ def __init__(self, entities: EntitiesResource) -> None: self.archive = to_streamed_response_wrapper( entities.archive, ) - self.create_beneficial_owner = to_streamed_response_wrapper( - entities.create_beneficial_owner, - ) class AsyncEntitiesResourceWithStreamingResponse: @@ -914,6 +800,3 @@ def __init__(self, entities: AsyncEntitiesResource) -> None: self.archive = async_to_streamed_response_wrapper( entities.archive, ) - self.create_beneficial_owner = async_to_streamed_response_wrapper( - entities.create_beneficial_owner, - ) diff --git a/src/increase/types/__init__.py b/src/increase/types/__init__.py index 18bb99f0..994a8c3d 100644 --- a/src/increase/types/__init__.py +++ b/src/increase/types/__init__.py @@ -168,9 +168,6 @@ from .wire_drawdown_request_create_params import WireDrawdownRequestCreateParams as WireDrawdownRequestCreateParams from .card_purchase_supplement_list_params import CardPurchaseSupplementListParams as CardPurchaseSupplementListParams from .inbound_wire_transfer_reverse_params import InboundWireTransferReverseParams as InboundWireTransferReverseParams -from .entity_create_beneficial_owner_params import ( - EntityCreateBeneficialOwnerParams as EntityCreateBeneficialOwnerParams, -) from .intrafi_account_enrollment_list_params import ( IntrafiAccountEnrollmentListParams as IntrafiAccountEnrollmentListParams, ) diff --git a/src/increase/types/entity_create_beneficial_owner_params.py b/src/increase/types/entity_create_beneficial_owner_params.py deleted file mode 100644 index e3091081..00000000 --- a/src/increase/types/entity_create_beneficial_owner_params.py +++ /dev/null @@ -1,215 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Union -from datetime import date -from typing_extensions import Literal, Required, Annotated, TypedDict - -from .._utils import PropertyInfo - -__all__ = [ - "EntityCreateBeneficialOwnerParams", - "BeneficialOwner", - "BeneficialOwnerIndividual", - "BeneficialOwnerIndividualAddress", - "BeneficialOwnerIndividualIdentification", - "BeneficialOwnerIndividualIdentificationDriversLicense", - "BeneficialOwnerIndividualIdentificationOther", - "BeneficialOwnerIndividualIdentificationPassport", -] - - -class EntityCreateBeneficialOwnerParams(TypedDict, total=False): - beneficial_owner: Required[BeneficialOwner] - """ - The identifying details of anyone controlling or owning 25% or more of the - corporation. - """ - - -class BeneficialOwnerIndividualAddress(TypedDict, total=False): - """The individual's physical address. - - Mail receiving locations like PO Boxes and PMB's are disallowed. - """ - - city: Required[str] - """The city, district, town, or village of the address.""" - - country: Required[str] - """The two-letter ISO 3166-1 alpha-2 code for the country of the address.""" - - line1: Required[str] - """The first line of the address. This is usually the street number and street.""" - - line2: str - """The second line of the address. This might be the floor or room number.""" - - state: str - """ - The two-letter United States Postal Service (USPS) abbreviation for the US - state, province, or region of the address. Required in certain countries. - """ - - zip: str - """The ZIP or postal code of the address. Required in certain countries.""" - - -class BeneficialOwnerIndividualIdentificationDriversLicense(TypedDict, total=False): - """Information about the United States driver's license used for identification. - - Required if `method` is equal to `drivers_license`. - """ - - expiration_date: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]] - """The driver's license's expiration date in YYYY-MM-DD format.""" - - file_id: Required[str] - """The identifier of the File containing the front of the driver's license.""" - - state: Required[str] - """The state that issued the provided driver's license.""" - - back_file_id: str - """The identifier of the File containing the back of the driver's license.""" - - -class BeneficialOwnerIndividualIdentificationOther(TypedDict, total=False): - """Information about the identification document provided. - - Required if `method` is equal to `other`. - """ - - country: Required[str] - """ - The two-character ISO 3166-1 code representing the country that issued the - document (e.g., `US`). - """ - - description: Required[str] - """A description of the document submitted.""" - - file_id: Required[str] - """The identifier of the File containing the front of the document.""" - - back_file_id: str - """The identifier of the File containing the back of the document. - - Not every document has a reverse side. - """ - - expiration_date: Annotated[Union[str, date], PropertyInfo(format="iso8601")] - """The document's expiration date in YYYY-MM-DD format.""" - - -class BeneficialOwnerIndividualIdentificationPassport(TypedDict, total=False): - """Information about the passport used for identification. - - Required if `method` is equal to `passport`. - """ - - country: Required[str] - """ - The two-character ISO 3166-1 code representing the country that issued the - document (e.g., `US`). - """ - - expiration_date: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]] - """The passport's expiration date in YYYY-MM-DD format.""" - - file_id: Required[str] - """The identifier of the File containing the passport.""" - - -class BeneficialOwnerIndividualIdentification(TypedDict, total=False, extra_items=object): # type: ignore[call-arg] - """A means of verifying the person's identity.""" - - method: Required[ - Literal[ - "social_security_number", - "individual_taxpayer_identification_number", - "passport", - "drivers_license", - "other", - ] - ] - """A method that can be used to verify the individual's identity. - - - `social_security_number` - A social security number. - - `individual_taxpayer_identification_number` - An individual taxpayer - identification number (ITIN). - - `passport` - A passport number. - - `drivers_license` - A driver's license number. - - `other` - Another identifying document. - """ - - number: Required[str] - """ - An identification number that can be used to verify the individual's identity, - such as a social security number. - """ - - drivers_license: BeneficialOwnerIndividualIdentificationDriversLicense - """Information about the United States driver's license used for identification. - - Required if `method` is equal to `drivers_license`. - """ - - other: BeneficialOwnerIndividualIdentificationOther - """Information about the identification document provided. - - Required if `method` is equal to `other`. - """ - - passport: BeneficialOwnerIndividualIdentificationPassport - """Information about the passport used for identification. - - Required if `method` is equal to `passport`. - """ - - -class BeneficialOwnerIndividual(TypedDict, total=False): - """Personal details for the beneficial owner.""" - - address: Required[BeneficialOwnerIndividualAddress] - """The individual's physical address. - - Mail receiving locations like PO Boxes and PMB's are disallowed. - """ - - date_of_birth: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]] - """The person's date of birth in YYYY-MM-DD format.""" - - identification: Required[BeneficialOwnerIndividualIdentification] - """A means of verifying the person's identity.""" - - name: Required[str] - """The person's legal name.""" - - confirmed_no_us_tax_id: bool - """ - The identification method for an individual can only be a passport, driver's - license, or other document if you've confirmed the individual does not have a US - tax id (either a Social Security Number or Individual Taxpayer Identification - Number). - """ - - -class BeneficialOwner(TypedDict, total=False, extra_items=object): # type: ignore[call-arg] - """ - The identifying details of anyone controlling or owning 25% or more of the corporation. - """ - - individual: Required[BeneficialOwnerIndividual] - """Personal details for the beneficial owner.""" - - prongs: Required[List[Literal["ownership", "control"]]] - """Why this person is considered a beneficial owner of the entity. - - At least one option is required, if a person is both a control person and owner, - submit an array containing both. - """ - - company_title: str - """This person's role or title within the entity.""" diff --git a/tests/api_resources/test_entities.py b/tests/api_resources/test_entities.py index d26d5046..e71fa561 100644 --- a/tests/api_resources/test_entities.py +++ b/tests/api_resources/test_entities.py @@ -9,9 +9,7 @@ from increase import Increase, AsyncIncrease from tests.utils import assert_matches_type -from increase.types import ( - Entity, -) +from increase.types import Entity from increase._utils import parse_date, parse_datetime from increase.pagination import SyncPage, AsyncPage @@ -521,154 +519,6 @@ def test_path_params_archive(self, client: Increase) -> None: "", ) - @parametrize - def test_method_create_beneficial_owner(self, client: Increase) -> None: - entity = client.entities.create_beneficial_owner( - entity_id="entity_n8y8tnk2p9339ti393yi", - beneficial_owner={ - "individual": { - "address": { - "city": "New York", - "country": "US", - "line1": "33 Liberty Street", - }, - "date_of_birth": parse_date("1970-01-31"), - "identification": { - "method": "social_security_number", - "number": "078051120", - }, - "name": "Ian Crease", - }, - "prongs": ["control"], - }, - ) - assert_matches_type(Entity, entity, path=["response"]) - - @parametrize - def test_method_create_beneficial_owner_with_all_params(self, client: Increase) -> None: - entity = client.entities.create_beneficial_owner( - entity_id="entity_n8y8tnk2p9339ti393yi", - beneficial_owner={ - "individual": { - "address": { - "city": "New York", - "country": "US", - "line1": "33 Liberty Street", - "line2": "x", - "state": "NY", - "zip": "10045", - }, - "date_of_birth": parse_date("1970-01-31"), - "identification": { - "method": "social_security_number", - "number": "078051120", - "drivers_license": { - "expiration_date": parse_date("2019-12-27"), - "file_id": "file_id", - "state": "x", - "back_file_id": "back_file_id", - }, - "other": { - "country": "x", - "description": "x", - "file_id": "file_id", - "back_file_id": "back_file_id", - "expiration_date": parse_date("2019-12-27"), - }, - "passport": { - "country": "x", - "expiration_date": parse_date("2019-12-27"), - "file_id": "file_id", - }, - }, - "name": "Ian Crease", - "confirmed_no_us_tax_id": True, - }, - "prongs": ["control"], - "company_title": "CEO", - }, - ) - assert_matches_type(Entity, entity, path=["response"]) - - @parametrize - def test_raw_response_create_beneficial_owner(self, client: Increase) -> None: - response = client.entities.with_raw_response.create_beneficial_owner( - entity_id="entity_n8y8tnk2p9339ti393yi", - beneficial_owner={ - "individual": { - "address": { - "city": "New York", - "country": "US", - "line1": "33 Liberty Street", - }, - "date_of_birth": parse_date("1970-01-31"), - "identification": { - "method": "social_security_number", - "number": "078051120", - }, - "name": "Ian Crease", - }, - "prongs": ["control"], - }, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - entity = response.parse() - assert_matches_type(Entity, entity, path=["response"]) - - @parametrize - def test_streaming_response_create_beneficial_owner(self, client: Increase) -> None: - with client.entities.with_streaming_response.create_beneficial_owner( - entity_id="entity_n8y8tnk2p9339ti393yi", - beneficial_owner={ - "individual": { - "address": { - "city": "New York", - "country": "US", - "line1": "33 Liberty Street", - }, - "date_of_birth": parse_date("1970-01-31"), - "identification": { - "method": "social_security_number", - "number": "078051120", - }, - "name": "Ian Crease", - }, - "prongs": ["control"], - }, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - entity = response.parse() - assert_matches_type(Entity, entity, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_create_beneficial_owner(self, client: Increase) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `entity_id` but received ''"): - client.entities.with_raw_response.create_beneficial_owner( - entity_id="", - beneficial_owner={ - "individual": { - "address": { - "city": "New York", - "country": "US", - "line1": "33 Liberty Street", - }, - "date_of_birth": parse_date("1970-01-31"), - "identification": { - "method": "social_security_number", - "number": "078051120", - }, - "name": "Ian Crease", - }, - "prongs": ["control"], - }, - ) - class TestAsyncEntities: parametrize = pytest.mark.parametrize( @@ -1174,151 +1024,3 @@ async def test_path_params_archive(self, async_client: AsyncIncrease) -> None: await async_client.entities.with_raw_response.archive( "", ) - - @parametrize - async def test_method_create_beneficial_owner(self, async_client: AsyncIncrease) -> None: - entity = await async_client.entities.create_beneficial_owner( - entity_id="entity_n8y8tnk2p9339ti393yi", - beneficial_owner={ - "individual": { - "address": { - "city": "New York", - "country": "US", - "line1": "33 Liberty Street", - }, - "date_of_birth": parse_date("1970-01-31"), - "identification": { - "method": "social_security_number", - "number": "078051120", - }, - "name": "Ian Crease", - }, - "prongs": ["control"], - }, - ) - assert_matches_type(Entity, entity, path=["response"]) - - @parametrize - async def test_method_create_beneficial_owner_with_all_params(self, async_client: AsyncIncrease) -> None: - entity = await async_client.entities.create_beneficial_owner( - entity_id="entity_n8y8tnk2p9339ti393yi", - beneficial_owner={ - "individual": { - "address": { - "city": "New York", - "country": "US", - "line1": "33 Liberty Street", - "line2": "x", - "state": "NY", - "zip": "10045", - }, - "date_of_birth": parse_date("1970-01-31"), - "identification": { - "method": "social_security_number", - "number": "078051120", - "drivers_license": { - "expiration_date": parse_date("2019-12-27"), - "file_id": "file_id", - "state": "x", - "back_file_id": "back_file_id", - }, - "other": { - "country": "x", - "description": "x", - "file_id": "file_id", - "back_file_id": "back_file_id", - "expiration_date": parse_date("2019-12-27"), - }, - "passport": { - "country": "x", - "expiration_date": parse_date("2019-12-27"), - "file_id": "file_id", - }, - }, - "name": "Ian Crease", - "confirmed_no_us_tax_id": True, - }, - "prongs": ["control"], - "company_title": "CEO", - }, - ) - assert_matches_type(Entity, entity, path=["response"]) - - @parametrize - async def test_raw_response_create_beneficial_owner(self, async_client: AsyncIncrease) -> None: - response = await async_client.entities.with_raw_response.create_beneficial_owner( - entity_id="entity_n8y8tnk2p9339ti393yi", - beneficial_owner={ - "individual": { - "address": { - "city": "New York", - "country": "US", - "line1": "33 Liberty Street", - }, - "date_of_birth": parse_date("1970-01-31"), - "identification": { - "method": "social_security_number", - "number": "078051120", - }, - "name": "Ian Crease", - }, - "prongs": ["control"], - }, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - entity = await response.parse() - assert_matches_type(Entity, entity, path=["response"]) - - @parametrize - async def test_streaming_response_create_beneficial_owner(self, async_client: AsyncIncrease) -> None: - async with async_client.entities.with_streaming_response.create_beneficial_owner( - entity_id="entity_n8y8tnk2p9339ti393yi", - beneficial_owner={ - "individual": { - "address": { - "city": "New York", - "country": "US", - "line1": "33 Liberty Street", - }, - "date_of_birth": parse_date("1970-01-31"), - "identification": { - "method": "social_security_number", - "number": "078051120", - }, - "name": "Ian Crease", - }, - "prongs": ["control"], - }, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - entity = await response.parse() - assert_matches_type(Entity, entity, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_create_beneficial_owner(self, async_client: AsyncIncrease) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `entity_id` but received ''"): - await async_client.entities.with_raw_response.create_beneficial_owner( - entity_id="", - beneficial_owner={ - "individual": { - "address": { - "city": "New York", - "country": "US", - "line1": "33 Liberty Street", - }, - "date_of_birth": parse_date("1970-01-31"), - "identification": { - "method": "social_security_number", - "number": "078051120", - }, - "name": "Ian Crease", - }, - "prongs": ["control"], - }, - ) From 8bec8875aceec35d927c525af2a81122896d9a9c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 12 Mar 2026 16:28:32 +0000 Subject: [PATCH 3/3] release: 0.436.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 9 +++++++++ pyproject.toml | 2 +- src/increase/_version.py | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index d260e00d..878ea368 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.435.0" + ".": "0.436.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 90ee33dd..e2472f78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 0.436.0 (2026-03-12) + +Full Changelog: [v0.435.0...v0.436.0](https://github.com/Increase/increase-python/compare/v0.435.0...v0.436.0) + +### Features + +* **api:** api update ([910abf5](https://github.com/Increase/increase-python/commit/910abf5ad3122dceeed4114fb355bb4864275522)) +* **api:** api update ([39c3fac](https://github.com/Increase/increase-python/commit/39c3faca288ac586ef500a6e2fb1615c156dfdb4)) + ## 0.435.0 (2026-03-12) Full Changelog: [v0.434.0...v0.435.0](https://github.com/Increase/increase-python/compare/v0.434.0...v0.435.0) diff --git a/pyproject.toml b/pyproject.toml index c0463bc1..02c59830 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "increase" -version = "0.435.0" +version = "0.436.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 c5b62955..80b67182 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.435.0" # x-release-please-version +__version__ = "0.436.0" # x-release-please-version