Skip to content

Commit ef7a0e0

Browse files
feat(api): api update
1 parent bc0ede3 commit ef7a0e0

File tree

4 files changed

+218
-6
lines changed

4 files changed

+218
-6
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 237
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-defae23482710e9c09a4a09f19b5de303c58f4b3ffd937c6dfafacb4124f4378.yml
3-
openapi_spec_hash: f1404bbd3ac5cbd9cfb952f3c65bb406
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-aceacff825bf677100a4d4554b2b3dad7ba442bbe26bc7f18b4153c54c3624e8.yml
3+
openapi_spec_hash: 7fa7a382bd4d1db423b5345a8535d23b
44
config_hash: 896b006f9647a513eda3b228cf17c199

src/increase/resources/beneficial_owners.py

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ def update(
8484
entity_beneficial_owner_id: str,
8585
*,
8686
address: beneficial_owner_update_params.Address | Omit = omit,
87+
confirmed_no_us_tax_id: bool | Omit = omit,
88+
identification: beneficial_owner_update_params.Identification | Omit = omit,
8789
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
8890
# The extra values given here take precedence over values defined on the client or passed to this method.
8991
extra_headers: Headers | None = None,
@@ -101,6 +103,13 @@ def update(
101103
address: The individual's physical address. Mail receiving locations like PO Boxes and
102104
PMB's are disallowed.
103105
106+
confirmed_no_us_tax_id: The identification method for an individual can only be a passport, driver's
107+
license, or other document if you've confirmed the individual does not have a US
108+
tax id (either a Social Security Number or Individual Taxpayer Identification
109+
Number).
110+
111+
identification: A means of verifying the person's identity.
112+
104113
extra_headers: Send extra headers
105114
106115
extra_query: Add additional query parameters to the request
@@ -117,7 +126,14 @@ def update(
117126
)
118127
return self._patch(
119128
f"/entity_beneficial_owners/{entity_beneficial_owner_id}",
120-
body=maybe_transform({"address": address}, beneficial_owner_update_params.BeneficialOwnerUpdateParams),
129+
body=maybe_transform(
130+
{
131+
"address": address,
132+
"confirmed_no_us_tax_id": confirmed_no_us_tax_id,
133+
"identification": identification,
134+
},
135+
beneficial_owner_update_params.BeneficialOwnerUpdateParams,
136+
),
121137
options=make_request_options(
122138
extra_headers=extra_headers,
123139
extra_query=extra_query,
@@ -251,6 +267,8 @@ async def update(
251267
entity_beneficial_owner_id: str,
252268
*,
253269
address: beneficial_owner_update_params.Address | Omit = omit,
270+
confirmed_no_us_tax_id: bool | Omit = omit,
271+
identification: beneficial_owner_update_params.Identification | Omit = omit,
254272
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
255273
# The extra values given here take precedence over values defined on the client or passed to this method.
256274
extra_headers: Headers | None = None,
@@ -268,6 +286,13 @@ async def update(
268286
address: The individual's physical address. Mail receiving locations like PO Boxes and
269287
PMB's are disallowed.
270288
289+
confirmed_no_us_tax_id: The identification method for an individual can only be a passport, driver's
290+
license, or other document if you've confirmed the individual does not have a US
291+
tax id (either a Social Security Number or Individual Taxpayer Identification
292+
Number).
293+
294+
identification: A means of verifying the person's identity.
295+
271296
extra_headers: Send extra headers
272297
273298
extra_query: Add additional query parameters to the request
@@ -285,7 +310,12 @@ async def update(
285310
return await self._patch(
286311
f"/entity_beneficial_owners/{entity_beneficial_owner_id}",
287312
body=await async_maybe_transform(
288-
{"address": address}, beneficial_owner_update_params.BeneficialOwnerUpdateParams
313+
{
314+
"address": address,
315+
"confirmed_no_us_tax_id": confirmed_no_us_tax_id,
316+
"identification": identification,
317+
},
318+
beneficial_owner_update_params.BeneficialOwnerUpdateParams,
289319
),
290320
options=make_request_options(
291321
extra_headers=extra_headers,

src/increase/types/beneficial_owner_update_params.py

Lines changed: 137 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,20 @@
22

33
from __future__ import annotations
44

5-
from typing_extensions import Required, TypedDict
5+
from typing import Union
6+
from datetime import date
7+
from typing_extensions import Literal, Required, Annotated, TypedDict
68

7-
__all__ = ["BeneficialOwnerUpdateParams", "Address"]
9+
from .._utils import PropertyInfo
10+
11+
__all__ = [
12+
"BeneficialOwnerUpdateParams",
13+
"Address",
14+
"Identification",
15+
"IdentificationDriversLicense",
16+
"IdentificationOther",
17+
"IdentificationPassport",
18+
]
819

920

1021
class BeneficialOwnerUpdateParams(TypedDict, total=False):
@@ -14,6 +25,17 @@ class BeneficialOwnerUpdateParams(TypedDict, total=False):
1425
Mail receiving locations like PO Boxes and PMB's are disallowed.
1526
"""
1627

28+
confirmed_no_us_tax_id: bool
29+
"""
30+
The identification method for an individual can only be a passport, driver's
31+
license, or other document if you've confirmed the individual does not have a US
32+
tax id (either a Social Security Number or Individual Taxpayer Identification
33+
Number).
34+
"""
35+
36+
identification: Identification
37+
"""A means of verifying the person's identity."""
38+
1739

1840
class Address(TypedDict, total=False):
1941
"""The individual's physical address.
@@ -41,3 +63,116 @@ class Address(TypedDict, total=False):
4163

4264
zip: str
4365
"""The ZIP or postal code of the address. Required in certain countries."""
66+
67+
68+
class IdentificationDriversLicense(TypedDict, total=False):
69+
"""Information about the United States driver's license used for identification.
70+
71+
Required if `method` is equal to `drivers_license`.
72+
"""
73+
74+
expiration_date: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]]
75+
"""The driver's license's expiration date in YYYY-MM-DD format."""
76+
77+
file_id: Required[str]
78+
"""The identifier of the File containing the front of the driver's license."""
79+
80+
state: Required[str]
81+
"""The state that issued the provided driver's license."""
82+
83+
back_file_id: str
84+
"""The identifier of the File containing the back of the driver's license."""
85+
86+
87+
class IdentificationOther(TypedDict, total=False):
88+
"""Information about the identification document provided.
89+
90+
Required if `method` is equal to `other`.
91+
"""
92+
93+
country: Required[str]
94+
"""
95+
The two-character ISO 3166-1 code representing the country that issued the
96+
document (e.g., `US`).
97+
"""
98+
99+
description: Required[str]
100+
"""A description of the document submitted."""
101+
102+
file_id: Required[str]
103+
"""The identifier of the File containing the front of the document."""
104+
105+
back_file_id: str
106+
"""The identifier of the File containing the back of the document.
107+
108+
Not every document has a reverse side.
109+
"""
110+
111+
expiration_date: Annotated[Union[str, date], PropertyInfo(format="iso8601")]
112+
"""The document's expiration date in YYYY-MM-DD format."""
113+
114+
115+
class IdentificationPassport(TypedDict, total=False):
116+
"""Information about the passport used for identification.
117+
118+
Required if `method` is equal to `passport`.
119+
"""
120+
121+
country: Required[str]
122+
"""
123+
The two-character ISO 3166-1 code representing the country that issued the
124+
document (e.g., `US`).
125+
"""
126+
127+
expiration_date: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]]
128+
"""The passport's expiration date in YYYY-MM-DD format."""
129+
130+
file_id: Required[str]
131+
"""The identifier of the File containing the passport."""
132+
133+
134+
class Identification(TypedDict, total=False, extra_items=object): # type: ignore[call-arg]
135+
"""A means of verifying the person's identity."""
136+
137+
method: Required[
138+
Literal[
139+
"social_security_number",
140+
"individual_taxpayer_identification_number",
141+
"passport",
142+
"drivers_license",
143+
"other",
144+
]
145+
]
146+
"""A method that can be used to verify the individual's identity.
147+
148+
- `social_security_number` - A social security number.
149+
- `individual_taxpayer_identification_number` - An individual taxpayer
150+
identification number (ITIN).
151+
- `passport` - A passport number.
152+
- `drivers_license` - A driver's license number.
153+
- `other` - Another identifying document.
154+
"""
155+
156+
number: Required[str]
157+
"""
158+
An identification number that can be used to verify the individual's identity,
159+
such as a social security number.
160+
"""
161+
162+
drivers_license: IdentificationDriversLicense
163+
"""Information about the United States driver's license used for identification.
164+
165+
Required if `method` is equal to `drivers_license`.
166+
"""
167+
168+
other: IdentificationOther
169+
"""Information about the identification document provided.
170+
171+
Required if `method` is equal to `other`.
172+
"""
173+
174+
passport: IdentificationPassport
175+
"""Information about the passport used for identification.
176+
177+
Required if `method` is equal to `passport`.
178+
"""

tests/api_resources/test_beneficial_owners.py

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from increase import Increase, AsyncIncrease
1111
from tests.utils import assert_matches_type
1212
from increase.types import EntityBeneficialOwner
13+
from increase._utils import parse_date
1314
from increase.pagination import SyncPage, AsyncPage
1415

1516
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -77,6 +78,29 @@ def test_method_update_with_all_params(self, client: Increase) -> None:
7778
"state": "NY",
7879
"zip": "10045",
7980
},
81+
confirmed_no_us_tax_id=True,
82+
identification={
83+
"method": "social_security_number",
84+
"number": "xxxx",
85+
"drivers_license": {
86+
"expiration_date": parse_date("2019-12-27"),
87+
"file_id": "file_id",
88+
"state": "x",
89+
"back_file_id": "back_file_id",
90+
},
91+
"other": {
92+
"country": "x",
93+
"description": "x",
94+
"file_id": "file_id",
95+
"back_file_id": "back_file_id",
96+
"expiration_date": parse_date("2019-12-27"),
97+
},
98+
"passport": {
99+
"country": "x",
100+
"expiration_date": parse_date("2019-12-27"),
101+
"file_id": "file_id",
102+
},
103+
},
80104
)
81105
assert_matches_type(EntityBeneficialOwner, beneficial_owner, path=["response"])
82106

@@ -219,6 +243,29 @@ async def test_method_update_with_all_params(self, async_client: AsyncIncrease)
219243
"state": "NY",
220244
"zip": "10045",
221245
},
246+
confirmed_no_us_tax_id=True,
247+
identification={
248+
"method": "social_security_number",
249+
"number": "xxxx",
250+
"drivers_license": {
251+
"expiration_date": parse_date("2019-12-27"),
252+
"file_id": "file_id",
253+
"state": "x",
254+
"back_file_id": "back_file_id",
255+
},
256+
"other": {
257+
"country": "x",
258+
"description": "x",
259+
"file_id": "file_id",
260+
"back_file_id": "back_file_id",
261+
"expiration_date": parse_date("2019-12-27"),
262+
},
263+
"passport": {
264+
"country": "x",
265+
"expiration_date": parse_date("2019-12-27"),
266+
"file_id": "file_id",
267+
},
268+
},
222269
)
223270
assert_matches_type(EntityBeneficialOwner, beneficial_owner, path=["response"])
224271

0 commit comments

Comments
 (0)