-
Notifications
You must be signed in to change notification settings - Fork 0
/
entitybeneficialowner.go
291 lines (255 loc) · 14.2 KB
/
entitybeneficialowner.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
package increase
import (
"context"
"net/http"
"time"
"github.com/increase/increase-go/internal/apijson"
"github.com/increase/increase-go/internal/param"
"github.com/increase/increase-go/internal/requestconfig"
"github.com/increase/increase-go/option"
)
// EntityBeneficialOwnerService contains methods and other services that help with
// interacting with the increase API.
//
// Note, unlike clients, this service does not read variables from the environment
// automatically. You should not instantiate this service directly, and instead use
// the [NewEntityBeneficialOwnerService] method instead.
type EntityBeneficialOwnerService struct {
Options []option.RequestOption
}
// NewEntityBeneficialOwnerService generates a new service that applies the given
// options to each request. These options are applied after the parent client's
// options (if there is one), and before any request-specific options.
func NewEntityBeneficialOwnerService(opts ...option.RequestOption) (r *EntityBeneficialOwnerService) {
r = &EntityBeneficialOwnerService{}
r.Options = opts
return
}
// Create a beneficial owner for a corporate Entity
func (r *EntityBeneficialOwnerService) New(ctx context.Context, body EntityBeneficialOwnerNewParams, opts ...option.RequestOption) (res *Entity, err error) {
opts = append(r.Options[:], opts...)
path := "entity_beneficial_owners"
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &res, opts...)
return
}
// Archive a beneficial owner for a corporate Entity
func (r *EntityBeneficialOwnerService) Archive(ctx context.Context, body EntityBeneficialOwnerArchiveParams, opts ...option.RequestOption) (res *Entity, err error) {
opts = append(r.Options[:], opts...)
path := "entity_beneficial_owners/archive"
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &res, opts...)
return
}
// Update the address for a beneficial owner belonging to a corporate Entity
func (r *EntityBeneficialOwnerService) UpdateAddress(ctx context.Context, body EntityBeneficialOwnerUpdateAddressParams, opts ...option.RequestOption) (res *Entity, err error) {
opts = append(r.Options[:], opts...)
path := "entity_beneficial_owners/address"
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &res, opts...)
return
}
type EntityBeneficialOwnerNewParams struct {
// The identifying details of anyone controlling or owning 25% or more of the
// corporation.
BeneficialOwner param.Field[EntityBeneficialOwnerNewParamsBeneficialOwner] `json:"beneficial_owner,required"`
// The identifier of the Entity to associate with the new Beneficial Owner.
EntityID param.Field[string] `json:"entity_id,required"`
}
func (r EntityBeneficialOwnerNewParams) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// The identifying details of anyone controlling or owning 25% or more of the
// corporation.
type EntityBeneficialOwnerNewParamsBeneficialOwner struct {
// Personal details for the beneficial owner.
Individual param.Field[EntityBeneficialOwnerNewParamsBeneficialOwnerIndividual] `json:"individual,required"`
// Why this person is considered a beneficial owner of the entity. At least one
// option is required, if a person is both a control person and owner, submit an
// array containing both.
Prongs param.Field[[]EntityBeneficialOwnerNewParamsBeneficialOwnerProng] `json:"prongs,required"`
// This person's role or title within the entity.
CompanyTitle param.Field[string] `json:"company_title"`
}
func (r EntityBeneficialOwnerNewParamsBeneficialOwner) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// Personal details for the beneficial owner.
type EntityBeneficialOwnerNewParamsBeneficialOwnerIndividual struct {
// The individual's physical address. Mail receiving locations like PO Boxes and
// PMB's are disallowed.
Address param.Field[EntityBeneficialOwnerNewParamsBeneficialOwnerIndividualAddress] `json:"address,required"`
// The person's date of birth in YYYY-MM-DD format.
DateOfBirth param.Field[time.Time] `json:"date_of_birth,required" format:"date"`
// A means of verifying the person's identity.
Identification param.Field[EntityBeneficialOwnerNewParamsBeneficialOwnerIndividualIdentification] `json:"identification,required"`
// The person's legal name.
Name param.Field[string] `json:"name,required"`
// The identification method for an individual can only be a passport, driver's
// license, or other document if you've confirmed the individual does not have a US
// tax id (either a Social Security Number or Individual Taxpayer Identification
// Number).
ConfirmedNoUsTaxID param.Field[bool] `json:"confirmed_no_us_tax_id"`
}
func (r EntityBeneficialOwnerNewParamsBeneficialOwnerIndividual) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// The individual's physical address. Mail receiving locations like PO Boxes and
// PMB's are disallowed.
type EntityBeneficialOwnerNewParamsBeneficialOwnerIndividualAddress struct {
// The city of the address.
City param.Field[string] `json:"city,required"`
// The first line of the address. This is usually the street number and street.
Line1 param.Field[string] `json:"line1,required"`
// The two-letter United States Postal Service (USPS) abbreviation for the state of
// the address.
State param.Field[string] `json:"state,required"`
// The ZIP code of the address.
Zip param.Field[string] `json:"zip,required"`
// The second line of the address. This might be the floor or room number.
Line2 param.Field[string] `json:"line2"`
}
func (r EntityBeneficialOwnerNewParamsBeneficialOwnerIndividualAddress) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// A means of verifying the person's identity.
type EntityBeneficialOwnerNewParamsBeneficialOwnerIndividualIdentification struct {
// A method that can be used to verify the individual's identity.
Method param.Field[EntityBeneficialOwnerNewParamsBeneficialOwnerIndividualIdentificationMethod] `json:"method,required"`
// An identification number that can be used to verify the individual's identity,
// such as a social security number.
Number param.Field[string] `json:"number,required"`
// Information about the United States driver's license used for identification.
// Required if `method` is equal to `drivers_license`.
DriversLicense param.Field[EntityBeneficialOwnerNewParamsBeneficialOwnerIndividualIdentificationDriversLicense] `json:"drivers_license"`
// Information about the identification document provided. Required if `method` is
// equal to `other`.
Other param.Field[EntityBeneficialOwnerNewParamsBeneficialOwnerIndividualIdentificationOther] `json:"other"`
// Information about the passport used for identification. Required if `method` is
// equal to `passport`.
Passport param.Field[EntityBeneficialOwnerNewParamsBeneficialOwnerIndividualIdentificationPassport] `json:"passport"`
}
func (r EntityBeneficialOwnerNewParamsBeneficialOwnerIndividualIdentification) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// A method that can be used to verify the individual's identity.
type EntityBeneficialOwnerNewParamsBeneficialOwnerIndividualIdentificationMethod string
const (
// A social security number.
EntityBeneficialOwnerNewParamsBeneficialOwnerIndividualIdentificationMethodSocialSecurityNumber EntityBeneficialOwnerNewParamsBeneficialOwnerIndividualIdentificationMethod = "social_security_number"
// An individual taxpayer identification number (ITIN).
EntityBeneficialOwnerNewParamsBeneficialOwnerIndividualIdentificationMethodIndividualTaxpayerIdentificationNumber EntityBeneficialOwnerNewParamsBeneficialOwnerIndividualIdentificationMethod = "individual_taxpayer_identification_number"
// A passport number.
EntityBeneficialOwnerNewParamsBeneficialOwnerIndividualIdentificationMethodPassport EntityBeneficialOwnerNewParamsBeneficialOwnerIndividualIdentificationMethod = "passport"
// A driver's license number.
EntityBeneficialOwnerNewParamsBeneficialOwnerIndividualIdentificationMethodDriversLicense EntityBeneficialOwnerNewParamsBeneficialOwnerIndividualIdentificationMethod = "drivers_license"
// Another identifying document.
EntityBeneficialOwnerNewParamsBeneficialOwnerIndividualIdentificationMethodOther EntityBeneficialOwnerNewParamsBeneficialOwnerIndividualIdentificationMethod = "other"
)
func (r EntityBeneficialOwnerNewParamsBeneficialOwnerIndividualIdentificationMethod) IsKnown() bool {
switch r {
case EntityBeneficialOwnerNewParamsBeneficialOwnerIndividualIdentificationMethodSocialSecurityNumber, EntityBeneficialOwnerNewParamsBeneficialOwnerIndividualIdentificationMethodIndividualTaxpayerIdentificationNumber, EntityBeneficialOwnerNewParamsBeneficialOwnerIndividualIdentificationMethodPassport, EntityBeneficialOwnerNewParamsBeneficialOwnerIndividualIdentificationMethodDriversLicense, EntityBeneficialOwnerNewParamsBeneficialOwnerIndividualIdentificationMethodOther:
return true
}
return false
}
// Information about the United States driver's license used for identification.
// Required if `method` is equal to `drivers_license`.
type EntityBeneficialOwnerNewParamsBeneficialOwnerIndividualIdentificationDriversLicense struct {
// The driver's license's expiration date in YYYY-MM-DD format.
ExpirationDate param.Field[time.Time] `json:"expiration_date,required" format:"date"`
// The identifier of the File containing the front of the driver's license.
FileID param.Field[string] `json:"file_id,required"`
// The state that issued the provided driver's license.
State param.Field[string] `json:"state,required"`
// The identifier of the File containing the back of the driver's license.
BackFileID param.Field[string] `json:"back_file_id"`
}
func (r EntityBeneficialOwnerNewParamsBeneficialOwnerIndividualIdentificationDriversLicense) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// Information about the identification document provided. Required if `method` is
// equal to `other`.
type EntityBeneficialOwnerNewParamsBeneficialOwnerIndividualIdentificationOther struct {
// The two-character ISO 3166-1 code representing the country that issued the
// document.
Country param.Field[string] `json:"country,required"`
// A description of the document submitted.
Description param.Field[string] `json:"description,required"`
// The identifier of the File containing the front of the document.
FileID param.Field[string] `json:"file_id,required"`
// The identifier of the File containing the back of the document. Not every
// document has a reverse side.
BackFileID param.Field[string] `json:"back_file_id"`
// The document's expiration date in YYYY-MM-DD format.
ExpirationDate param.Field[time.Time] `json:"expiration_date" format:"date"`
}
func (r EntityBeneficialOwnerNewParamsBeneficialOwnerIndividualIdentificationOther) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// Information about the passport used for identification. Required if `method` is
// equal to `passport`.
type EntityBeneficialOwnerNewParamsBeneficialOwnerIndividualIdentificationPassport struct {
// The country that issued the passport.
Country param.Field[string] `json:"country,required"`
// The passport's expiration date in YYYY-MM-DD format.
ExpirationDate param.Field[time.Time] `json:"expiration_date,required" format:"date"`
// The identifier of the File containing the passport.
FileID param.Field[string] `json:"file_id,required"`
}
func (r EntityBeneficialOwnerNewParamsBeneficialOwnerIndividualIdentificationPassport) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
type EntityBeneficialOwnerNewParamsBeneficialOwnerProng string
const (
// A person with 25% or greater direct or indirect ownership of the entity.
EntityBeneficialOwnerNewParamsBeneficialOwnerProngOwnership EntityBeneficialOwnerNewParamsBeneficialOwnerProng = "ownership"
// A person who manages, directs, or has significant control of the entity.
EntityBeneficialOwnerNewParamsBeneficialOwnerProngControl EntityBeneficialOwnerNewParamsBeneficialOwnerProng = "control"
)
func (r EntityBeneficialOwnerNewParamsBeneficialOwnerProng) IsKnown() bool {
switch r {
case EntityBeneficialOwnerNewParamsBeneficialOwnerProngOwnership, EntityBeneficialOwnerNewParamsBeneficialOwnerProngControl:
return true
}
return false
}
type EntityBeneficialOwnerArchiveParams struct {
// The identifying details of anyone controlling or owning 25% or more of the
// corporation.
BeneficialOwnerID param.Field[string] `json:"beneficial_owner_id,required"`
// The identifier of the Entity to retrieve.
EntityID param.Field[string] `json:"entity_id,required"`
}
func (r EntityBeneficialOwnerArchiveParams) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
type EntityBeneficialOwnerUpdateAddressParams struct {
// The individual's physical address. Mail receiving locations like PO Boxes and
// PMB's are disallowed.
Address param.Field[EntityBeneficialOwnerUpdateAddressParamsAddress] `json:"address,required"`
// The identifying details of anyone controlling or owning 25% or more of the
// corporation.
BeneficialOwnerID param.Field[string] `json:"beneficial_owner_id,required"`
// The identifier of the Entity to retrieve.
EntityID param.Field[string] `json:"entity_id,required"`
}
func (r EntityBeneficialOwnerUpdateAddressParams) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// The individual's physical address. Mail receiving locations like PO Boxes and
// PMB's are disallowed.
type EntityBeneficialOwnerUpdateAddressParamsAddress struct {
// The city of the address.
City param.Field[string] `json:"city,required"`
// The first line of the address. This is usually the street number and street.
Line1 param.Field[string] `json:"line1,required"`
// The two-letter United States Postal Service (USPS) abbreviation for the state of
// the address.
State param.Field[string] `json:"state,required"`
// The ZIP code of the address.
Zip param.Field[string] `json:"zip,required"`
// The second line of the address. This might be the floor or room number.
Line2 param.Field[string] `json:"line2"`
}
func (r EntityBeneficialOwnerUpdateAddressParamsAddress) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}