Skip to content

Commit 2e9651e

Browse files
feat(api): api update
1 parent 9216c9f commit 2e9651e

File tree

6 files changed

+273
-6
lines changed

6 files changed

+273
-6
lines changed

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 236
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-010fcebf036b735c59221760be7726699913ed68102323b49939ddd880a12e32.yml
3-
openapi_spec_hash: 92d7bc1bf2f3034735206e358249ba5c
4-
config_hash: dda988c5565c2f15cc708122984d7691
1+
configured_endpoints: 237
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-defae23482710e9c09a4a09f19b5de303c58f4b3ffd937c6dfafacb4124f4378.yml
3+
openapi_spec_hash: f1404bbd3ac5cbd9cfb952f3c65bb406
4+
config_hash: 896b006f9647a513eda3b228cf17c199

api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,7 @@ from increase.types import EntityBeneficialOwner
516516
Methods:
517517

518518
- <code title="get /entity_beneficial_owners/{entity_beneficial_owner_id}">client.beneficial_owners.<a href="./src/increase/resources/beneficial_owners.py">retrieve</a>(entity_beneficial_owner_id) -> <a href="./src/increase/types/entity_beneficial_owner.py">EntityBeneficialOwner</a></code>
519+
- <code title="patch /entity_beneficial_owners/{entity_beneficial_owner_id}">client.beneficial_owners.<a href="./src/increase/resources/beneficial_owners.py">update</a>(entity_beneficial_owner_id, \*\*<a href="src/increase/types/beneficial_owner_update_params.py">params</a>) -> <a href="./src/increase/types/entity_beneficial_owner.py">EntityBeneficialOwner</a></code>
519520
- <code title="get /entity_beneficial_owners">client.beneficial_owners.<a href="./src/increase/resources/beneficial_owners.py">list</a>(\*\*<a href="src/increase/types/beneficial_owner_list_params.py">params</a>) -> <a href="./src/increase/types/entity_beneficial_owner.py">SyncPage[EntityBeneficialOwner]</a></code>
520521

521522
# SupplementalDocuments

src/increase/resources/beneficial_owners.py

Lines changed: 114 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
import httpx
66

7-
from ..types import beneficial_owner_list_params
7+
from ..types import beneficial_owner_list_params, beneficial_owner_update_params
88
from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
9-
from .._utils import maybe_transform
9+
from .._utils import maybe_transform, async_maybe_transform
1010
from .._compat import cached_property
1111
from .._resource import SyncAPIResource, AsyncAPIResource
1212
from .._response import (
@@ -79,6 +79,55 @@ def retrieve(
7979
cast_to=EntityBeneficialOwner,
8080
)
8181

82+
def update(
83+
self,
84+
entity_beneficial_owner_id: str,
85+
*,
86+
address: beneficial_owner_update_params.Address | Omit = omit,
87+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
88+
# The extra values given here take precedence over values defined on the client or passed to this method.
89+
extra_headers: Headers | None = None,
90+
extra_query: Query | None = None,
91+
extra_body: Body | None = None,
92+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
93+
idempotency_key: str | None = None,
94+
) -> EntityBeneficialOwner:
95+
"""
96+
Update a Beneficial Owner
97+
98+
Args:
99+
entity_beneficial_owner_id: The identifier of the Beneficial Owner to update.
100+
101+
address: The individual's physical address. Mail receiving locations like PO Boxes and
102+
PMB's are disallowed.
103+
104+
extra_headers: Send extra headers
105+
106+
extra_query: Add additional query parameters to the request
107+
108+
extra_body: Add additional JSON properties to the request
109+
110+
timeout: Override the client-level default timeout for this request, in seconds
111+
112+
idempotency_key: Specify a custom idempotency key for this request
113+
"""
114+
if not entity_beneficial_owner_id:
115+
raise ValueError(
116+
f"Expected a non-empty value for `entity_beneficial_owner_id` but received {entity_beneficial_owner_id!r}"
117+
)
118+
return self._patch(
119+
f"/entity_beneficial_owners/{entity_beneficial_owner_id}",
120+
body=maybe_transform({"address": address}, beneficial_owner_update_params.BeneficialOwnerUpdateParams),
121+
options=make_request_options(
122+
extra_headers=extra_headers,
123+
extra_query=extra_query,
124+
extra_body=extra_body,
125+
timeout=timeout,
126+
idempotency_key=idempotency_key,
127+
),
128+
cast_to=EntityBeneficialOwner,
129+
)
130+
82131
def list(
83132
self,
84133
*,
@@ -197,6 +246,57 @@ async def retrieve(
197246
cast_to=EntityBeneficialOwner,
198247
)
199248

249+
async def update(
250+
self,
251+
entity_beneficial_owner_id: str,
252+
*,
253+
address: beneficial_owner_update_params.Address | Omit = omit,
254+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
255+
# The extra values given here take precedence over values defined on the client or passed to this method.
256+
extra_headers: Headers | None = None,
257+
extra_query: Query | None = None,
258+
extra_body: Body | None = None,
259+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
260+
idempotency_key: str | None = None,
261+
) -> EntityBeneficialOwner:
262+
"""
263+
Update a Beneficial Owner
264+
265+
Args:
266+
entity_beneficial_owner_id: The identifier of the Beneficial Owner to update.
267+
268+
address: The individual's physical address. Mail receiving locations like PO Boxes and
269+
PMB's are disallowed.
270+
271+
extra_headers: Send extra headers
272+
273+
extra_query: Add additional query parameters to the request
274+
275+
extra_body: Add additional JSON properties to the request
276+
277+
timeout: Override the client-level default timeout for this request, in seconds
278+
279+
idempotency_key: Specify a custom idempotency key for this request
280+
"""
281+
if not entity_beneficial_owner_id:
282+
raise ValueError(
283+
f"Expected a non-empty value for `entity_beneficial_owner_id` but received {entity_beneficial_owner_id!r}"
284+
)
285+
return await self._patch(
286+
f"/entity_beneficial_owners/{entity_beneficial_owner_id}",
287+
body=await async_maybe_transform(
288+
{"address": address}, beneficial_owner_update_params.BeneficialOwnerUpdateParams
289+
),
290+
options=make_request_options(
291+
extra_headers=extra_headers,
292+
extra_query=extra_query,
293+
extra_body=extra_body,
294+
timeout=timeout,
295+
idempotency_key=idempotency_key,
296+
),
297+
cast_to=EntityBeneficialOwner,
298+
)
299+
200300
def list(
201301
self,
202302
*,
@@ -265,6 +365,9 @@ def __init__(self, beneficial_owners: BeneficialOwnersResource) -> None:
265365
self.retrieve = to_raw_response_wrapper(
266366
beneficial_owners.retrieve,
267367
)
368+
self.update = to_raw_response_wrapper(
369+
beneficial_owners.update,
370+
)
268371
self.list = to_raw_response_wrapper(
269372
beneficial_owners.list,
270373
)
@@ -277,6 +380,9 @@ def __init__(self, beneficial_owners: AsyncBeneficialOwnersResource) -> None:
277380
self.retrieve = async_to_raw_response_wrapper(
278381
beneficial_owners.retrieve,
279382
)
383+
self.update = async_to_raw_response_wrapper(
384+
beneficial_owners.update,
385+
)
280386
self.list = async_to_raw_response_wrapper(
281387
beneficial_owners.list,
282388
)
@@ -289,6 +395,9 @@ def __init__(self, beneficial_owners: BeneficialOwnersResource) -> None:
289395
self.retrieve = to_streamed_response_wrapper(
290396
beneficial_owners.retrieve,
291397
)
398+
self.update = to_streamed_response_wrapper(
399+
beneficial_owners.update,
400+
)
292401
self.list = to_streamed_response_wrapper(
293402
beneficial_owners.list,
294403
)
@@ -301,6 +410,9 @@ def __init__(self, beneficial_owners: AsyncBeneficialOwnersResource) -> None:
301410
self.retrieve = async_to_streamed_response_wrapper(
302411
beneficial_owners.retrieve,
303412
)
413+
self.update = async_to_streamed_response_wrapper(
414+
beneficial_owners.update,
415+
)
304416
self.list = async_to_streamed_response_wrapper(
305417
beneficial_owners.list,
306418
)

src/increase/types/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@
123123
from .intrafi_exclusion_list_params import IntrafiExclusionListParams as IntrafiExclusionListParams
124124
from .oauth_application_list_params import OAuthApplicationListParams as OAuthApplicationListParams
125125
from .account_transfer_create_params import AccountTransferCreateParams as AccountTransferCreateParams
126+
from .beneficial_owner_update_params import BeneficialOwnerUpdateParams as BeneficialOwnerUpdateParams
126127
from .card_push_transfer_list_params import CardPushTransferListParams as CardPushTransferListParams
127128
from .event_subscription_list_params import EventSubscriptionListParams as EventSubscriptionListParams
128129
from .external_account_create_params import ExternalAccountCreateParams as ExternalAccountCreateParams
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing_extensions import Required, TypedDict
6+
7+
__all__ = ["BeneficialOwnerUpdateParams", "Address"]
8+
9+
10+
class BeneficialOwnerUpdateParams(TypedDict, total=False):
11+
address: Address
12+
"""The individual's physical address.
13+
14+
Mail receiving locations like PO Boxes and PMB's are disallowed.
15+
"""
16+
17+
18+
class Address(TypedDict, total=False):
19+
"""The individual's physical address.
20+
21+
Mail receiving locations like PO Boxes and PMB's are disallowed.
22+
"""
23+
24+
city: Required[str]
25+
"""The city, district, town, or village of the address."""
26+
27+
country: Required[str]
28+
"""The two-letter ISO 3166-1 alpha-2 code for the country of the address."""
29+
30+
line1: Required[str]
31+
"""The first line of the address. This is usually the street number and street."""
32+
33+
line2: str
34+
"""The second line of the address. This might be the floor or room number."""
35+
36+
state: str
37+
"""
38+
The two-letter United States Postal Service (USPS) abbreviation for the US
39+
state, province, or region of the address. Required in certain countries.
40+
"""
41+
42+
zip: str
43+
"""The ZIP or postal code of the address. Required in certain countries."""

tests/api_resources/test_beneficial_owners.py

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,61 @@ def test_path_params_retrieve(self, client: Increase) -> None:
5858
"",
5959
)
6060

61+
@parametrize
62+
def test_method_update(self, client: Increase) -> None:
63+
beneficial_owner = client.beneficial_owners.update(
64+
entity_beneficial_owner_id="entity_setup_beneficial_owner_submission_vgkyk7dj5eb4sfhdbkx7",
65+
)
66+
assert_matches_type(EntityBeneficialOwner, beneficial_owner, path=["response"])
67+
68+
@parametrize
69+
def test_method_update_with_all_params(self, client: Increase) -> None:
70+
beneficial_owner = client.beneficial_owners.update(
71+
entity_beneficial_owner_id="entity_setup_beneficial_owner_submission_vgkyk7dj5eb4sfhdbkx7",
72+
address={
73+
"city": "New York",
74+
"country": "US",
75+
"line1": "33 Liberty Street",
76+
"line2": "Unit 2",
77+
"state": "NY",
78+
"zip": "10045",
79+
},
80+
)
81+
assert_matches_type(EntityBeneficialOwner, beneficial_owner, path=["response"])
82+
83+
@parametrize
84+
def test_raw_response_update(self, client: Increase) -> None:
85+
response = client.beneficial_owners.with_raw_response.update(
86+
entity_beneficial_owner_id="entity_setup_beneficial_owner_submission_vgkyk7dj5eb4sfhdbkx7",
87+
)
88+
89+
assert response.is_closed is True
90+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
91+
beneficial_owner = response.parse()
92+
assert_matches_type(EntityBeneficialOwner, beneficial_owner, path=["response"])
93+
94+
@parametrize
95+
def test_streaming_response_update(self, client: Increase) -> None:
96+
with client.beneficial_owners.with_streaming_response.update(
97+
entity_beneficial_owner_id="entity_setup_beneficial_owner_submission_vgkyk7dj5eb4sfhdbkx7",
98+
) as response:
99+
assert not response.is_closed
100+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
101+
102+
beneficial_owner = response.parse()
103+
assert_matches_type(EntityBeneficialOwner, beneficial_owner, path=["response"])
104+
105+
assert cast(Any, response.is_closed) is True
106+
107+
@parametrize
108+
def test_path_params_update(self, client: Increase) -> None:
109+
with pytest.raises(
110+
ValueError, match=r"Expected a non-empty value for `entity_beneficial_owner_id` but received ''"
111+
):
112+
client.beneficial_owners.with_raw_response.update(
113+
entity_beneficial_owner_id="",
114+
)
115+
61116
@parametrize
62117
def test_method_list(self, client: Increase) -> None:
63118
beneficial_owner = client.beneficial_owners.list(
@@ -145,6 +200,61 @@ async def test_path_params_retrieve(self, async_client: AsyncIncrease) -> None:
145200
"",
146201
)
147202

203+
@parametrize
204+
async def test_method_update(self, async_client: AsyncIncrease) -> None:
205+
beneficial_owner = await async_client.beneficial_owners.update(
206+
entity_beneficial_owner_id="entity_setup_beneficial_owner_submission_vgkyk7dj5eb4sfhdbkx7",
207+
)
208+
assert_matches_type(EntityBeneficialOwner, beneficial_owner, path=["response"])
209+
210+
@parametrize
211+
async def test_method_update_with_all_params(self, async_client: AsyncIncrease) -> None:
212+
beneficial_owner = await async_client.beneficial_owners.update(
213+
entity_beneficial_owner_id="entity_setup_beneficial_owner_submission_vgkyk7dj5eb4sfhdbkx7",
214+
address={
215+
"city": "New York",
216+
"country": "US",
217+
"line1": "33 Liberty Street",
218+
"line2": "Unit 2",
219+
"state": "NY",
220+
"zip": "10045",
221+
},
222+
)
223+
assert_matches_type(EntityBeneficialOwner, beneficial_owner, path=["response"])
224+
225+
@parametrize
226+
async def test_raw_response_update(self, async_client: AsyncIncrease) -> None:
227+
response = await async_client.beneficial_owners.with_raw_response.update(
228+
entity_beneficial_owner_id="entity_setup_beneficial_owner_submission_vgkyk7dj5eb4sfhdbkx7",
229+
)
230+
231+
assert response.is_closed is True
232+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
233+
beneficial_owner = await response.parse()
234+
assert_matches_type(EntityBeneficialOwner, beneficial_owner, path=["response"])
235+
236+
@parametrize
237+
async def test_streaming_response_update(self, async_client: AsyncIncrease) -> None:
238+
async with async_client.beneficial_owners.with_streaming_response.update(
239+
entity_beneficial_owner_id="entity_setup_beneficial_owner_submission_vgkyk7dj5eb4sfhdbkx7",
240+
) as response:
241+
assert not response.is_closed
242+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
243+
244+
beneficial_owner = await response.parse()
245+
assert_matches_type(EntityBeneficialOwner, beneficial_owner, path=["response"])
246+
247+
assert cast(Any, response.is_closed) is True
248+
249+
@parametrize
250+
async def test_path_params_update(self, async_client: AsyncIncrease) -> None:
251+
with pytest.raises(
252+
ValueError, match=r"Expected a non-empty value for `entity_beneficial_owner_id` but received ''"
253+
):
254+
await async_client.beneficial_owners.with_raw_response.update(
255+
entity_beneficial_owner_id="",
256+
)
257+
148258
@parametrize
149259
async def test_method_list(self, async_client: AsyncIncrease) -> None:
150260
beneficial_owner = await async_client.beneficial_owners.list(

0 commit comments

Comments
 (0)