Skip to content

Commit 7eff40d

Browse files
feat(api): api update
1 parent 323b5bd commit 7eff40d

File tree

2 files changed

+229
-4
lines changed

2 files changed

+229
-4
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: 236
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-456b3255914e823b9e463f97ff81124dfabefae6f102e0f295bf33b7cfb1b780.yml
3-
openapi_spec_hash: ccbeda7ba9b61f9a8c2f9f4cf7a65dce
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-d5ad75c7a80acd1cb3ff0483fa0b5b2eb9d73287f107f53a8fb3a3a0b6a32ed8.yml
3+
openapi_spec_hash: da73faf476df3eddcf0ac51c38dd1b17
44
config_hash: 25d7d7aa4882db6189b4b53e8e249e80

entity.go

Lines changed: 227 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ func (r *EntityService) Archive(ctx context.Context, entityID string, opts ...op
106106
}
107107

108108
// Entities are the legal entities that own accounts. They can be people,
109-
// corporations, partnerships, government authorities, or trusts.
109+
// corporations, partnerships, government authorities, or trusts. To learn more,
110+
// see [Entities](/documentation/entities).
110111
type Entity struct {
111112
// The entity's identifier.
112113
ID string `json:"id" api:"required"`
@@ -155,7 +156,9 @@ type Entity struct {
155156
Trust EntityTrust `json:"trust" api:"required,nullable"`
156157
// A constant representing the object's type. For this resource it will always be
157158
// `entity`.
158-
Type EntityType `json:"type" api:"required"`
159+
Type EntityType `json:"type" api:"required"`
160+
// The validation results for the entity.
161+
Validation EntityValidation `json:"validation" api:"required,nullable"`
159162
ExtraFields map[string]interface{} `json:"-" api:"extrafields"`
160163
JSON entityJSON `json:"-"`
161164
}
@@ -179,6 +182,7 @@ type entityJSON struct {
179182
ThirdPartyVerification apijson.Field
180183
Trust apijson.Field
181184
Type apijson.Field
185+
Validation apijson.Field
182186
raw string
183187
ExtraFields map[string]apijson.Field
184188
}
@@ -1354,6 +1358,227 @@ func (r EntityType) IsKnown() bool {
13541358
return false
13551359
}
13561360

1361+
// The validation results for the entity.
1362+
type EntityValidation struct {
1363+
// The list of issues that need to be addressed.
1364+
Issues []EntityValidationIssue `json:"issues" api:"required"`
1365+
// The validation status for the entity. If the status is `invalid`, the `issues`
1366+
// array will be populated.
1367+
Status EntityValidationStatus `json:"status" api:"required"`
1368+
JSON entityValidationJSON `json:"-"`
1369+
}
1370+
1371+
// entityValidationJSON contains the JSON metadata for the struct
1372+
// [EntityValidation]
1373+
type entityValidationJSON struct {
1374+
Issues apijson.Field
1375+
Status apijson.Field
1376+
raw string
1377+
ExtraFields map[string]apijson.Field
1378+
}
1379+
1380+
func (r *EntityValidation) UnmarshalJSON(data []byte) (err error) {
1381+
return apijson.UnmarshalRoot(data, r)
1382+
}
1383+
1384+
func (r entityValidationJSON) RawJSON() string {
1385+
return r.raw
1386+
}
1387+
1388+
type EntityValidationIssue struct {
1389+
// Details when the issue is with a beneficial owner's address.
1390+
BeneficialOwnerAddress EntityValidationIssuesBeneficialOwnerAddress `json:"beneficial_owner_address" api:"required,nullable"`
1391+
// Details when the issue is with a beneficial owner's identity verification.
1392+
BeneficialOwnerIdentity EntityValidationIssuesBeneficialOwnerIdentity `json:"beneficial_owner_identity" api:"required,nullable"`
1393+
// The type of issue. We may add additional possible values for this enum over
1394+
// time; your application should be able to handle such additions gracefully.
1395+
Category EntityValidationIssuesCategory `json:"category" api:"required"`
1396+
// Details when the issue is with the entity's address.
1397+
EntityAddress EntityValidationIssuesEntityAddress `json:"entity_address" api:"required,nullable"`
1398+
// Details when the issue is with the entity's tax ID.
1399+
EntityTaxIdentifier EntityValidationIssuesEntityTaxIdentifier `json:"entity_tax_identifier" api:"required,nullable"`
1400+
JSON entityValidationIssueJSON `json:"-"`
1401+
}
1402+
1403+
// entityValidationIssueJSON contains the JSON metadata for the struct
1404+
// [EntityValidationIssue]
1405+
type entityValidationIssueJSON struct {
1406+
BeneficialOwnerAddress apijson.Field
1407+
BeneficialOwnerIdentity apijson.Field
1408+
Category apijson.Field
1409+
EntityAddress apijson.Field
1410+
EntityTaxIdentifier apijson.Field
1411+
raw string
1412+
ExtraFields map[string]apijson.Field
1413+
}
1414+
1415+
func (r *EntityValidationIssue) UnmarshalJSON(data []byte) (err error) {
1416+
return apijson.UnmarshalRoot(data, r)
1417+
}
1418+
1419+
func (r entityValidationIssueJSON) RawJSON() string {
1420+
return r.raw
1421+
}
1422+
1423+
// Details when the issue is with a beneficial owner's address.
1424+
type EntityValidationIssuesBeneficialOwnerAddress struct {
1425+
// The ID of the beneficial owner.
1426+
BeneficialOwnerID string `json:"beneficial_owner_id" api:"required"`
1427+
// The reason the address is invalid.
1428+
Reason EntityValidationIssuesBeneficialOwnerAddressReason `json:"reason" api:"required"`
1429+
JSON entityValidationIssuesBeneficialOwnerAddressJSON `json:"-"`
1430+
}
1431+
1432+
// entityValidationIssuesBeneficialOwnerAddressJSON contains the JSON metadata for
1433+
// the struct [EntityValidationIssuesBeneficialOwnerAddress]
1434+
type entityValidationIssuesBeneficialOwnerAddressJSON struct {
1435+
BeneficialOwnerID apijson.Field
1436+
Reason apijson.Field
1437+
raw string
1438+
ExtraFields map[string]apijson.Field
1439+
}
1440+
1441+
func (r *EntityValidationIssuesBeneficialOwnerAddress) UnmarshalJSON(data []byte) (err error) {
1442+
return apijson.UnmarshalRoot(data, r)
1443+
}
1444+
1445+
func (r entityValidationIssuesBeneficialOwnerAddressJSON) RawJSON() string {
1446+
return r.raw
1447+
}
1448+
1449+
// The reason the address is invalid.
1450+
type EntityValidationIssuesBeneficialOwnerAddressReason string
1451+
1452+
const (
1453+
EntityValidationIssuesBeneficialOwnerAddressReasonMailboxAddress EntityValidationIssuesBeneficialOwnerAddressReason = "mailbox_address"
1454+
)
1455+
1456+
func (r EntityValidationIssuesBeneficialOwnerAddressReason) IsKnown() bool {
1457+
switch r {
1458+
case EntityValidationIssuesBeneficialOwnerAddressReasonMailboxAddress:
1459+
return true
1460+
}
1461+
return false
1462+
}
1463+
1464+
// Details when the issue is with a beneficial owner's identity verification.
1465+
type EntityValidationIssuesBeneficialOwnerIdentity struct {
1466+
// The ID of the beneficial owner.
1467+
BeneficialOwnerID string `json:"beneficial_owner_id" api:"required"`
1468+
JSON entityValidationIssuesBeneficialOwnerIdentityJSON `json:"-"`
1469+
}
1470+
1471+
// entityValidationIssuesBeneficialOwnerIdentityJSON contains the JSON metadata for
1472+
// the struct [EntityValidationIssuesBeneficialOwnerIdentity]
1473+
type entityValidationIssuesBeneficialOwnerIdentityJSON struct {
1474+
BeneficialOwnerID apijson.Field
1475+
raw string
1476+
ExtraFields map[string]apijson.Field
1477+
}
1478+
1479+
func (r *EntityValidationIssuesBeneficialOwnerIdentity) UnmarshalJSON(data []byte) (err error) {
1480+
return apijson.UnmarshalRoot(data, r)
1481+
}
1482+
1483+
func (r entityValidationIssuesBeneficialOwnerIdentityJSON) RawJSON() string {
1484+
return r.raw
1485+
}
1486+
1487+
// The type of issue. We may add additional possible values for this enum over
1488+
// time; your application should be able to handle such additions gracefully.
1489+
type EntityValidationIssuesCategory string
1490+
1491+
const (
1492+
EntityValidationIssuesCategoryEntityTaxIdentifier EntityValidationIssuesCategory = "entity_tax_identifier"
1493+
EntityValidationIssuesCategoryEntityAddress EntityValidationIssuesCategory = "entity_address"
1494+
EntityValidationIssuesCategoryBeneficialOwnerIdentity EntityValidationIssuesCategory = "beneficial_owner_identity"
1495+
EntityValidationIssuesCategoryBeneficialOwnerAddress EntityValidationIssuesCategory = "beneficial_owner_address"
1496+
)
1497+
1498+
func (r EntityValidationIssuesCategory) IsKnown() bool {
1499+
switch r {
1500+
case EntityValidationIssuesCategoryEntityTaxIdentifier, EntityValidationIssuesCategoryEntityAddress, EntityValidationIssuesCategoryBeneficialOwnerIdentity, EntityValidationIssuesCategoryBeneficialOwnerAddress:
1501+
return true
1502+
}
1503+
return false
1504+
}
1505+
1506+
// Details when the issue is with the entity's address.
1507+
type EntityValidationIssuesEntityAddress struct {
1508+
// The reason the address is invalid.
1509+
Reason EntityValidationIssuesEntityAddressReason `json:"reason" api:"required"`
1510+
JSON entityValidationIssuesEntityAddressJSON `json:"-"`
1511+
}
1512+
1513+
// entityValidationIssuesEntityAddressJSON contains the JSON metadata for the
1514+
// struct [EntityValidationIssuesEntityAddress]
1515+
type entityValidationIssuesEntityAddressJSON struct {
1516+
Reason apijson.Field
1517+
raw string
1518+
ExtraFields map[string]apijson.Field
1519+
}
1520+
1521+
func (r *EntityValidationIssuesEntityAddress) UnmarshalJSON(data []byte) (err error) {
1522+
return apijson.UnmarshalRoot(data, r)
1523+
}
1524+
1525+
func (r entityValidationIssuesEntityAddressJSON) RawJSON() string {
1526+
return r.raw
1527+
}
1528+
1529+
// The reason the address is invalid.
1530+
type EntityValidationIssuesEntityAddressReason string
1531+
1532+
const (
1533+
EntityValidationIssuesEntityAddressReasonMailboxAddress EntityValidationIssuesEntityAddressReason = "mailbox_address"
1534+
)
1535+
1536+
func (r EntityValidationIssuesEntityAddressReason) IsKnown() bool {
1537+
switch r {
1538+
case EntityValidationIssuesEntityAddressReasonMailboxAddress:
1539+
return true
1540+
}
1541+
return false
1542+
}
1543+
1544+
// Details when the issue is with the entity's tax ID.
1545+
type EntityValidationIssuesEntityTaxIdentifier struct {
1546+
JSON entityValidationIssuesEntityTaxIdentifierJSON `json:"-"`
1547+
}
1548+
1549+
// entityValidationIssuesEntityTaxIdentifierJSON contains the JSON metadata for the
1550+
// struct [EntityValidationIssuesEntityTaxIdentifier]
1551+
type entityValidationIssuesEntityTaxIdentifierJSON struct {
1552+
raw string
1553+
ExtraFields map[string]apijson.Field
1554+
}
1555+
1556+
func (r *EntityValidationIssuesEntityTaxIdentifier) UnmarshalJSON(data []byte) (err error) {
1557+
return apijson.UnmarshalRoot(data, r)
1558+
}
1559+
1560+
func (r entityValidationIssuesEntityTaxIdentifierJSON) RawJSON() string {
1561+
return r.raw
1562+
}
1563+
1564+
// The validation status for the entity. If the status is `invalid`, the `issues`
1565+
// array will be populated.
1566+
type EntityValidationStatus string
1567+
1568+
const (
1569+
EntityValidationStatusPending EntityValidationStatus = "pending"
1570+
EntityValidationStatusValid EntityValidationStatus = "valid"
1571+
EntityValidationStatusInvalid EntityValidationStatus = "invalid"
1572+
)
1573+
1574+
func (r EntityValidationStatus) IsKnown() bool {
1575+
switch r {
1576+
case EntityValidationStatusPending, EntityValidationStatusValid, EntityValidationStatusInvalid:
1577+
return true
1578+
}
1579+
return false
1580+
}
1581+
13571582
type EntityNewParams struct {
13581583
// The type of Entity to create.
13591584
Structure param.Field[EntityNewParamsStructure] `json:"structure" api:"required"`

0 commit comments

Comments
 (0)