From fd0bd4c76074c605667a3dc52dcb2c8bb6159ca1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 4 Sep 2025 19:38:53 +0000 Subject: [PATCH 1/2] feat(api): api update --- .stats.yml | 8 +- api.md | 1 + src/increase/resources/entities.py | 117 +++++++++++++++++++++ src/increase/types/__init__.py | 1 + src/increase/types/entity.py | 23 ++++ src/increase/types/entity_create_params.py | 25 ++++- src/increase/types/entity_update_params.py | 35 ++++++ tests/api_resources/test_entities.py | 106 +++++++++++++++++++ 8 files changed, 311 insertions(+), 5 deletions(-) create mode 100644 src/increase/types/entity_update_params.py diff --git a/.stats.yml b/.stats.yml index 4046227bc..b81bcdb11 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-fbdfb5721d0c46a176ee6d81936d2710556c39cc486c5de246cc17b0503ee408.yml -openapi_spec_hash: 66c900a94b458e5b796ac1d2a5fceb13 -config_hash: 632b628b59d8f0b717153b3d8133f6cb +configured_endpoints: 217 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-1eb1b9beeffa6783ab1a53c794e87a6d6d69ef975941d6213ce9e66fcf487a82.yml +openapi_spec_hash: 246b178a64c9ac4a3e9332e406f6a90f +config_hash: 2a4a1945e6eefa24fa5b0590cf580fb4 diff --git a/api.md b/api.md index 4fc9cf187..217645bfd 100644 --- a/api.md +++ b/api.md @@ -449,6 +449,7 @@ Methods: - client.entities.create(\*\*params) -> Entity - client.entities.retrieve(entity_id) -> Entity +- client.entities.update(entity_id, \*\*params) -> Entity - client.entities.list(\*\*params) -> SyncPage[Entity] - client.entities.archive(entity_id) -> Entity - client.entities.archive_beneficial_owner(entity_id, \*\*params) -> Entity diff --git a/src/increase/resources/entities.py b/src/increase/resources/entities.py index 8f7a39fd5..8c955cafc 100644 --- a/src/increase/resources/entities.py +++ b/src/increase/resources/entities.py @@ -11,6 +11,7 @@ from ..types import ( entity_list_params, entity_create_params, + entity_update_params, entity_confirm_params, entity_update_address_params, entity_update_industry_code_params, @@ -64,6 +65,7 @@ def create( government_authority: entity_create_params.GovernmentAuthority | NotGiven = NOT_GIVEN, joint: entity_create_params.Joint | NotGiven = NOT_GIVEN, natural_person: entity_create_params.NaturalPerson | NotGiven = NOT_GIVEN, + risk_rating: entity_create_params.RiskRating | NotGiven = NOT_GIVEN, supplemental_documents: Iterable[entity_create_params.SupplementalDocument] | NotGiven = NOT_GIVEN, third_party_verification: entity_create_params.ThirdPartyVerification | NotGiven = NOT_GIVEN, trust: entity_create_params.Trust | NotGiven = NOT_GIVEN, @@ -103,6 +105,9 @@ def create( `social_security_number` or `individual_taxpayer_identification_number` identification methods. + risk_rating: An assessment of the entity’s potential risk of involvement in financial crimes, + such as money laundering. + supplemental_documents: Additional documentation associated with the entity. third_party_verification: A reference to data stored in a third-party verification service. Your @@ -131,6 +136,7 @@ def create( "government_authority": government_authority, "joint": joint, "natural_person": natural_person, + "risk_rating": risk_rating, "supplemental_documents": supplemental_documents, "third_party_verification": third_party_verification, "trust": trust, @@ -182,6 +188,53 @@ def retrieve( cast_to=Entity, ) + def update( + self, + entity_id: str, + *, + risk_rating: entity_update_params.RiskRating | NotGiven = NOT_GIVEN, + # 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: + """ + Update an Entity + + Args: + entity_id: The entity identifier. + + risk_rating: An assessment of the entity’s potential risk of involvement in financial crimes, + such as money laundering. + + 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._patch( + f"/entities/{entity_id}", + body=maybe_transform({"risk_rating": risk_rating}, entity_update_params.EntityUpdateParams), + 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, + ) + def list( self, *, @@ -622,6 +675,7 @@ async def create( government_authority: entity_create_params.GovernmentAuthority | NotGiven = NOT_GIVEN, joint: entity_create_params.Joint | NotGiven = NOT_GIVEN, natural_person: entity_create_params.NaturalPerson | NotGiven = NOT_GIVEN, + risk_rating: entity_create_params.RiskRating | NotGiven = NOT_GIVEN, supplemental_documents: Iterable[entity_create_params.SupplementalDocument] | NotGiven = NOT_GIVEN, third_party_verification: entity_create_params.ThirdPartyVerification | NotGiven = NOT_GIVEN, trust: entity_create_params.Trust | NotGiven = NOT_GIVEN, @@ -661,6 +715,9 @@ async def create( `social_security_number` or `individual_taxpayer_identification_number` identification methods. + risk_rating: An assessment of the entity’s potential risk of involvement in financial crimes, + such as money laundering. + supplemental_documents: Additional documentation associated with the entity. third_party_verification: A reference to data stored in a third-party verification service. Your @@ -689,6 +746,7 @@ async def create( "government_authority": government_authority, "joint": joint, "natural_person": natural_person, + "risk_rating": risk_rating, "supplemental_documents": supplemental_documents, "third_party_verification": third_party_verification, "trust": trust, @@ -740,6 +798,53 @@ async def retrieve( cast_to=Entity, ) + async def update( + self, + entity_id: str, + *, + risk_rating: entity_update_params.RiskRating | NotGiven = NOT_GIVEN, + # 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: + """ + Update an Entity + + Args: + entity_id: The entity identifier. + + risk_rating: An assessment of the entity’s potential risk of involvement in financial crimes, + such as money laundering. + + 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._patch( + f"/entities/{entity_id}", + body=await async_maybe_transform({"risk_rating": risk_rating}, entity_update_params.EntityUpdateParams), + 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, + ) + def list( self, *, @@ -1163,6 +1268,9 @@ def __init__(self, entities: EntitiesResource) -> None: self.retrieve = to_raw_response_wrapper( entities.retrieve, ) + self.update = to_raw_response_wrapper( + entities.update, + ) self.list = to_raw_response_wrapper( entities.list, ) @@ -1199,6 +1307,9 @@ def __init__(self, entities: AsyncEntitiesResource) -> None: self.retrieve = async_to_raw_response_wrapper( entities.retrieve, ) + self.update = async_to_raw_response_wrapper( + entities.update, + ) self.list = async_to_raw_response_wrapper( entities.list, ) @@ -1235,6 +1346,9 @@ def __init__(self, entities: EntitiesResource) -> None: self.retrieve = to_streamed_response_wrapper( entities.retrieve, ) + self.update = to_streamed_response_wrapper( + entities.update, + ) self.list = to_streamed_response_wrapper( entities.list, ) @@ -1271,6 +1385,9 @@ def __init__(self, entities: AsyncEntitiesResource) -> None: self.retrieve = async_to_streamed_response_wrapper( entities.retrieve, ) + self.update = async_to_streamed_response_wrapper( + entities.update, + ) self.list = async_to_streamed_response_wrapper( entities.list, ) diff --git a/src/increase/types/__init__.py b/src/increase/types/__init__.py index d84ce1265..eb6eed1a4 100644 --- a/src/increase/types/__init__.py +++ b/src/increase/types/__init__.py @@ -59,6 +59,7 @@ from .digital_wallet_token import DigitalWalletToken as DigitalWalletToken from .document_list_params import DocumentListParams as DocumentListParams from .entity_create_params import EntityCreateParams as EntityCreateParams +from .entity_update_params import EntityUpdateParams as EntityUpdateParams from .export_create_params import ExportCreateParams as ExportCreateParams from .inbound_ach_transfer import InboundACHTransfer as InboundACHTransfer from .account_create_params import AccountCreateParams as AccountCreateParams diff --git a/src/increase/types/entity.py b/src/increase/types/entity.py index 4fdaeebb4..02e494585 100644 --- a/src/increase/types/entity.py +++ b/src/increase/types/entity.py @@ -25,6 +25,7 @@ "NaturalPerson", "NaturalPersonAddress", "NaturalPersonIdentification", + "RiskRating", "ThirdPartyVerification", "Trust", "TrustAddress", @@ -340,6 +341,22 @@ class NaturalPerson(BaseModel): """The person's legal name.""" +class RiskRating(BaseModel): + rated_at: datetime + """ + The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the risk + rating was performed. + """ + + rating: Literal["low", "medium", "high"] + """The rating given to this entity. + + - `low` - Low + - `medium` - Medium + - `high` - High + """ + + class ThirdPartyVerification(BaseModel): reference: str """The reference identifier for the third party verification.""" @@ -581,6 +598,12 @@ class Entity(BaseModel): Will be present if `structure` is equal to `natural_person`. """ + risk_rating: Optional[RiskRating] = None + """ + An assessment of the entity’s potential risk of involvement in financial crimes, + such as money laundering. + """ + status: Literal["active", "archived", "disabled"] """The status of the entity. diff --git a/src/increase/types/entity_create_params.py b/src/increase/types/entity_create_params.py index 7b43b7df9..6f0b97f7c 100644 --- a/src/increase/types/entity_create_params.py +++ b/src/increase/types/entity_create_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List, Union, Iterable -from datetime import date +from datetime import date, datetime from typing_extensions import Literal, Required, Annotated, TypedDict from .._utils import PropertyInfo @@ -35,6 +35,7 @@ "NaturalPersonIdentificationDriversLicense", "NaturalPersonIdentificationOther", "NaturalPersonIdentificationPassport", + "RiskRating", "SupplementalDocument", "ThirdPartyVerification", "Trust", @@ -95,6 +96,12 @@ class EntityCreateParams(TypedDict, total=False): `individual_taxpayer_identification_number` identification methods. """ + risk_rating: RiskRating + """ + An assessment of the entity’s potential risk of involvement in financial crimes, + such as money laundering. + """ + supplemental_documents: Iterable[SupplementalDocument] """Additional documentation associated with the entity.""" @@ -683,6 +690,22 @@ class NaturalPerson(TypedDict, total=False): """ +class RiskRating(TypedDict, total=False): + rated_at: Required[Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]] + """ + The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the risk + rating was performed. + """ + + rating: Required[Literal["low", "medium", "high"]] + """The rating given to this entity. + + - `low` - Low + - `medium` - Medium + - `high` - High + """ + + class SupplementalDocument(TypedDict, total=False): file_id: Required[str] """The identifier of the File containing the document.""" diff --git a/src/increase/types/entity_update_params.py b/src/increase/types/entity_update_params.py new file mode 100644 index 000000000..f0d2fc705 --- /dev/null +++ b/src/increase/types/entity_update_params.py @@ -0,0 +1,35 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from datetime import datetime +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["EntityUpdateParams", "RiskRating"] + + +class EntityUpdateParams(TypedDict, total=False): + risk_rating: RiskRating + """ + An assessment of the entity’s potential risk of involvement in financial crimes, + such as money laundering. + """ + + +class RiskRating(TypedDict, total=False): + rated_at: Required[Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]] + """ + The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the risk + rating was performed. + """ + + rating: Required[Literal["low", "medium", "high"]] + """The rating given to this entity. + + - `low` - Low + - `medium` - Medium + - `high` - High + """ diff --git a/tests/api_resources/test_entities.py b/tests/api_resources/test_entities.py index b0b4e8aeb..a52a87728 100644 --- a/tests/api_resources/test_entities.py +++ b/tests/api_resources/test_entities.py @@ -175,6 +175,10 @@ def test_method_create_with_all_params(self, client: Increase) -> None: "name": "x", "confirmed_no_us_tax_id": True, }, + risk_rating={ + "rated_at": parse_datetime("2019-12-27T18:11:19.117Z"), + "rating": "low", + }, supplemental_documents=[{"file_id": "file_makxrc67oh9l6sg7w9yc"}], third_party_verification={ "reference": "x", @@ -332,6 +336,55 @@ def test_path_params_retrieve(self, client: Increase) -> None: "", ) + @parametrize + def test_method_update(self, client: Increase) -> None: + entity = client.entities.update( + entity_id="entity_n8y8tnk2p9339ti393yi", + ) + assert_matches_type(Entity, entity, path=["response"]) + + @parametrize + def test_method_update_with_all_params(self, client: Increase) -> None: + entity = client.entities.update( + entity_id="entity_n8y8tnk2p9339ti393yi", + risk_rating={ + "rated_at": parse_datetime("2020-01-31T23:59:59Z"), + "rating": "low", + }, + ) + assert_matches_type(Entity, entity, path=["response"]) + + @parametrize + def test_raw_response_update(self, client: Increase) -> None: + response = client.entities.with_raw_response.update( + entity_id="entity_n8y8tnk2p9339ti393yi", + ) + + 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_update(self, client: Increase) -> None: + with client.entities.with_streaming_response.update( + entity_id="entity_n8y8tnk2p9339ti393yi", + ) 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_update(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.update( + entity_id="", + ) + @parametrize def test_method_list(self, client: Increase) -> None: entity = client.entities.list() @@ -1003,6 +1056,10 @@ async def test_method_create_with_all_params(self, async_client: AsyncIncrease) "name": "x", "confirmed_no_us_tax_id": True, }, + risk_rating={ + "rated_at": parse_datetime("2019-12-27T18:11:19.117Z"), + "rating": "low", + }, supplemental_documents=[{"file_id": "file_makxrc67oh9l6sg7w9yc"}], third_party_verification={ "reference": "x", @@ -1160,6 +1217,55 @@ async def test_path_params_retrieve(self, async_client: AsyncIncrease) -> None: "", ) + @parametrize + async def test_method_update(self, async_client: AsyncIncrease) -> None: + entity = await async_client.entities.update( + entity_id="entity_n8y8tnk2p9339ti393yi", + ) + assert_matches_type(Entity, entity, path=["response"]) + + @parametrize + async def test_method_update_with_all_params(self, async_client: AsyncIncrease) -> None: + entity = await async_client.entities.update( + entity_id="entity_n8y8tnk2p9339ti393yi", + risk_rating={ + "rated_at": parse_datetime("2020-01-31T23:59:59Z"), + "rating": "low", + }, + ) + assert_matches_type(Entity, entity, path=["response"]) + + @parametrize + async def test_raw_response_update(self, async_client: AsyncIncrease) -> None: + response = await async_client.entities.with_raw_response.update( + entity_id="entity_n8y8tnk2p9339ti393yi", + ) + + 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_update(self, async_client: AsyncIncrease) -> None: + async with async_client.entities.with_streaming_response.update( + entity_id="entity_n8y8tnk2p9339ti393yi", + ) 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_update(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.update( + entity_id="", + ) + @parametrize async def test_method_list(self, async_client: AsyncIncrease) -> None: entity = await async_client.entities.list() From f17df0a4af620d81297ad2c2439be74c94320266 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 4 Sep 2025 19:39:16 +0000 Subject: [PATCH 2/2] release: 0.313.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ pyproject.toml | 2 +- src/increase/_version.py | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 422745047..d1b100d62 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.312.0" + ".": "0.313.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 65e68bc0e..713ad5052 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.313.0 (2025-09-04) + +Full Changelog: [v0.312.0...v0.313.0](https://github.com/Increase/increase-python/compare/v0.312.0...v0.313.0) + +### Features + +* **api:** api update ([fd0bd4c](https://github.com/Increase/increase-python/commit/fd0bd4c76074c605667a3dc52dcb2c8bb6159ca1)) + ## 0.312.0 (2025-09-04) Full Changelog: [v0.311.0...v0.312.0](https://github.com/Increase/increase-python/compare/v0.311.0...v0.312.0) diff --git a/pyproject.toml b/pyproject.toml index 611c10635..11206893a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "increase" -version = "0.312.0" +version = "0.313.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 4841587ff..6eaef94b3 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.312.0" # x-release-please-version +__version__ = "0.313.0" # x-release-please-version