44
55import httpx
66
7- from ..types import beneficial_owner_list_params
7+ from ..types import beneficial_owner_list_params , beneficial_owner_update_params
88from .._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
1010from .._compat import cached_property
1111from .._resource import SyncAPIResource , AsyncAPIResource
1212from .._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 )
0 commit comments