-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathlegalentityassociation.go
660 lines (588 loc) · 38.7 KB
/
legalentityassociation.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
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
package moderntreasury
import (
"context"
"net/http"
"time"
"github.com/Modern-Treasury/modern-treasury-go/v2/internal/apijson"
"github.com/Modern-Treasury/modern-treasury-go/v2/internal/param"
"github.com/Modern-Treasury/modern-treasury-go/v2/internal/requestconfig"
"github.com/Modern-Treasury/modern-treasury-go/v2/option"
)
// LegalEntityAssociationService contains methods and other services that help with
// interacting with the Modern Treasury 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 [NewLegalEntityAssociationService] method instead.
type LegalEntityAssociationService struct {
Options []option.RequestOption
}
// NewLegalEntityAssociationService 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 NewLegalEntityAssociationService(opts ...option.RequestOption) (r *LegalEntityAssociationService) {
r = &LegalEntityAssociationService{}
r.Options = opts
return
}
// create legal_entity_association
func (r *LegalEntityAssociationService) New(ctx context.Context, body LegalEntityAssociationNewParams, opts ...option.RequestOption) (res *LegalEntityAssociation, err error) {
opts = append(r.Options[:], opts...)
path := "api/legal_entity_associations"
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &res, opts...)
return
}
type LegalEntityAssociation struct {
ID string `json:"id,required" format:"uuid"`
// The child legal entity.
ChildLegalEntity LegalEntityAssociationChildLegalEntity `json:"child_legal_entity,required"`
CreatedAt time.Time `json:"created_at,required" format:"date-time"`
DiscardedAt time.Time `json:"discarded_at,required,nullable" format:"date-time"`
// This field will be true if this object exists in the live environment or false
// if it exists in the test environment.
LiveMode bool `json:"live_mode,required"`
Object string `json:"object,required"`
// The child entity's ownership percentage iff they are a beneficial owner.
OwnershipPercentage int64 `json:"ownership_percentage,required,nullable"`
// The ID of the parent legal entity. This must be a business or joint legal
// entity.
ParentLegalEntityID string `json:"parent_legal_entity_id,required"`
RelationshipTypes []LegalEntityAssociationRelationshipType `json:"relationship_types,required"`
// The job title of the child entity at the parent entity.
Title string `json:"title,required,nullable"`
UpdatedAt time.Time `json:"updated_at,required" format:"date-time"`
JSON legalEntityAssociationJSON `json:"-"`
}
// legalEntityAssociationJSON contains the JSON metadata for the struct
// [LegalEntityAssociation]
type legalEntityAssociationJSON struct {
ID apijson.Field
ChildLegalEntity apijson.Field
CreatedAt apijson.Field
DiscardedAt apijson.Field
LiveMode apijson.Field
Object apijson.Field
OwnershipPercentage apijson.Field
ParentLegalEntityID apijson.Field
RelationshipTypes apijson.Field
Title apijson.Field
UpdatedAt apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *LegalEntityAssociation) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r legalEntityAssociationJSON) RawJSON() string {
return r.raw
}
// The child legal entity.
type LegalEntityAssociationChildLegalEntity struct {
ID string `json:"id,required" format:"uuid"`
// A list of addresses for the entity.
Addresses []LegalEntityAssociationChildLegalEntityAddress `json:"addresses,required"`
BankSettings BankSettings `json:"bank_settings,required,nullable"`
// The business's legal business name.
BusinessName string `json:"business_name,required,nullable"`
// The country of citizenship for an individual.
CitizenshipCountry string `json:"citizenship_country,required,nullable"`
CreatedAt time.Time `json:"created_at,required" format:"date-time"`
// A business's formation date (YYYY-MM-DD).
DateFormed time.Time `json:"date_formed,required,nullable" format:"date"`
// An individual's date of birth (YYYY-MM-DD).
DateOfBirth time.Time `json:"date_of_birth,required,nullable" format:"date"`
DiscardedAt time.Time `json:"discarded_at,required,nullable" format:"date-time"`
DoingBusinessAsNames []string `json:"doing_business_as_names,required"`
// The entity's primary email.
Email string `json:"email,required,nullable"`
// An individual's first name.
FirstName string `json:"first_name,required,nullable"`
// A list of identifications for the legal entity.
Identifications []LegalEntityAssociationChildLegalEntityIdentification `json:"identifications,required"`
// An individual's last name.
LastName string `json:"last_name,required,nullable"`
// The type of legal entity.
LegalEntityType LegalEntityAssociationChildLegalEntityLegalEntityType `json:"legal_entity_type,required"`
// The business's legal structure.
LegalStructure LegalEntityAssociationChildLegalEntityLegalStructure `json:"legal_structure,required,nullable"`
// This field will be true if this object exists in the live environment or false
// if it exists in the test environment.
LiveMode bool `json:"live_mode,required"`
// Additional data represented as key-value pairs. Both the key and value must be
// strings.
Metadata map[string]string `json:"metadata,required"`
// An individual's middle name.
MiddleName string `json:"middle_name,required,nullable"`
Object string `json:"object,required"`
PhoneNumbers []LegalEntityAssociationChildLegalEntityPhoneNumber `json:"phone_numbers,required"`
// Whether the individual is a politically exposed person.
PoliticallyExposedPerson bool `json:"politically_exposed_person,required,nullable"`
// An individual's preferred name.
PreferredName string `json:"preferred_name,required,nullable"`
// An individual's prefix.
Prefix string `json:"prefix,required,nullable"`
// The risk rating of the legal entity. One of low, medium, high.
RiskRating LegalEntityAssociationChildLegalEntityRiskRating `json:"risk_rating,required,nullable"`
// An individual's suffix.
Suffix string `json:"suffix,required,nullable"`
UpdatedAt time.Time `json:"updated_at,required" format:"date-time"`
WealthAndEmploymentDetails WealthAndEmploymentDetails `json:"wealth_and_employment_details,required,nullable"`
// The entity's primary website URL.
Website string `json:"website,required,nullable"`
JSON legalEntityAssociationChildLegalEntityJSON `json:"-"`
}
// legalEntityAssociationChildLegalEntityJSON contains the JSON metadata for the
// struct [LegalEntityAssociationChildLegalEntity]
type legalEntityAssociationChildLegalEntityJSON struct {
ID apijson.Field
Addresses apijson.Field
BankSettings apijson.Field
BusinessName apijson.Field
CitizenshipCountry apijson.Field
CreatedAt apijson.Field
DateFormed apijson.Field
DateOfBirth apijson.Field
DiscardedAt apijson.Field
DoingBusinessAsNames apijson.Field
Email apijson.Field
FirstName apijson.Field
Identifications apijson.Field
LastName apijson.Field
LegalEntityType apijson.Field
LegalStructure apijson.Field
LiveMode apijson.Field
Metadata apijson.Field
MiddleName apijson.Field
Object apijson.Field
PhoneNumbers apijson.Field
PoliticallyExposedPerson apijson.Field
PreferredName apijson.Field
Prefix apijson.Field
RiskRating apijson.Field
Suffix apijson.Field
UpdatedAt apijson.Field
WealthAndEmploymentDetails apijson.Field
Website apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *LegalEntityAssociationChildLegalEntity) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r legalEntityAssociationChildLegalEntityJSON) RawJSON() string {
return r.raw
}
type LegalEntityAssociationChildLegalEntityAddress struct {
ID string `json:"id,required" format:"uuid"`
// The types of this address.
AddressTypes []LegalEntityAssociationChildLegalEntityAddressesAddressType `json:"address_types,required"`
// Country code conforms to [ISO 3166-1 alpha-2]
Country string `json:"country,required,nullable"`
CreatedAt time.Time `json:"created_at,required" format:"date-time"`
DiscardedAt time.Time `json:"discarded_at,required,nullable" format:"date-time"`
Line1 string `json:"line1,required,nullable"`
Line2 string `json:"line2,required,nullable"`
// This field will be true if this object exists in the live environment or false
// if it exists in the test environment.
LiveMode bool `json:"live_mode,required"`
// Locality or City.
Locality string `json:"locality,required,nullable"`
Object string `json:"object,required"`
// The postal code of the address.
PostalCode string `json:"postal_code,required,nullable"`
// Region or State.
Region string `json:"region,required,nullable"`
UpdatedAt time.Time `json:"updated_at,required" format:"date-time"`
JSON legalEntityAssociationChildLegalEntityAddressJSON `json:"-"`
}
// legalEntityAssociationChildLegalEntityAddressJSON contains the JSON metadata for
// the struct [LegalEntityAssociationChildLegalEntityAddress]
type legalEntityAssociationChildLegalEntityAddressJSON struct {
ID apijson.Field
AddressTypes apijson.Field
Country apijson.Field
CreatedAt apijson.Field
DiscardedAt apijson.Field
Line1 apijson.Field
Line2 apijson.Field
LiveMode apijson.Field
Locality apijson.Field
Object apijson.Field
PostalCode apijson.Field
Region apijson.Field
UpdatedAt apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *LegalEntityAssociationChildLegalEntityAddress) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r legalEntityAssociationChildLegalEntityAddressJSON) RawJSON() string {
return r.raw
}
type LegalEntityAssociationChildLegalEntityAddressesAddressType string
const (
LegalEntityAssociationChildLegalEntityAddressesAddressTypeBusiness LegalEntityAssociationChildLegalEntityAddressesAddressType = "business"
LegalEntityAssociationChildLegalEntityAddressesAddressTypeMailing LegalEntityAssociationChildLegalEntityAddressesAddressType = "mailing"
LegalEntityAssociationChildLegalEntityAddressesAddressTypeOther LegalEntityAssociationChildLegalEntityAddressesAddressType = "other"
LegalEntityAssociationChildLegalEntityAddressesAddressTypePoBox LegalEntityAssociationChildLegalEntityAddressesAddressType = "po_box"
LegalEntityAssociationChildLegalEntityAddressesAddressTypeResidential LegalEntityAssociationChildLegalEntityAddressesAddressType = "residential"
)
func (r LegalEntityAssociationChildLegalEntityAddressesAddressType) IsKnown() bool {
switch r {
case LegalEntityAssociationChildLegalEntityAddressesAddressTypeBusiness, LegalEntityAssociationChildLegalEntityAddressesAddressTypeMailing, LegalEntityAssociationChildLegalEntityAddressesAddressTypeOther, LegalEntityAssociationChildLegalEntityAddressesAddressTypePoBox, LegalEntityAssociationChildLegalEntityAddressesAddressTypeResidential:
return true
}
return false
}
type LegalEntityAssociationChildLegalEntityIdentification struct {
ID string `json:"id,required" format:"uuid"`
CreatedAt time.Time `json:"created_at,required" format:"date-time"`
DiscardedAt time.Time `json:"discarded_at,required,nullable" format:"date-time"`
// The type of ID number.
IDType LegalEntityAssociationChildLegalEntityIdentificationsIDType `json:"id_type,required"`
// The ISO 3166-1 alpha-2 country code of the country that issued the
// identification
IssuingCountry string `json:"issuing_country,required,nullable"`
// This field will be true if this object exists in the live environment or false
// if it exists in the test environment.
LiveMode bool `json:"live_mode,required"`
Object string `json:"object,required"`
UpdatedAt time.Time `json:"updated_at,required" format:"date-time"`
JSON legalEntityAssociationChildLegalEntityIdentificationJSON `json:"-"`
}
// legalEntityAssociationChildLegalEntityIdentificationJSON contains the JSON
// metadata for the struct [LegalEntityAssociationChildLegalEntityIdentification]
type legalEntityAssociationChildLegalEntityIdentificationJSON struct {
ID apijson.Field
CreatedAt apijson.Field
DiscardedAt apijson.Field
IDType apijson.Field
IssuingCountry apijson.Field
LiveMode apijson.Field
Object apijson.Field
UpdatedAt apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *LegalEntityAssociationChildLegalEntityIdentification) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r legalEntityAssociationChildLegalEntityIdentificationJSON) RawJSON() string {
return r.raw
}
// The type of ID number.
type LegalEntityAssociationChildLegalEntityIdentificationsIDType string
const (
LegalEntityAssociationChildLegalEntityIdentificationsIDTypeArCuil LegalEntityAssociationChildLegalEntityIdentificationsIDType = "ar_cuil"
LegalEntityAssociationChildLegalEntityIdentificationsIDTypeArCuit LegalEntityAssociationChildLegalEntityIdentificationsIDType = "ar_cuit"
LegalEntityAssociationChildLegalEntityIdentificationsIDTypeBrCnpj LegalEntityAssociationChildLegalEntityIdentificationsIDType = "br_cnpj"
LegalEntityAssociationChildLegalEntityIdentificationsIDTypeBrCpf LegalEntityAssociationChildLegalEntityIdentificationsIDType = "br_cpf"
LegalEntityAssociationChildLegalEntityIdentificationsIDTypeClRun LegalEntityAssociationChildLegalEntityIdentificationsIDType = "cl_run"
LegalEntityAssociationChildLegalEntityIdentificationsIDTypeClRut LegalEntityAssociationChildLegalEntityIdentificationsIDType = "cl_rut"
LegalEntityAssociationChildLegalEntityIdentificationsIDTypeCoCedulas LegalEntityAssociationChildLegalEntityIdentificationsIDType = "co_cedulas"
LegalEntityAssociationChildLegalEntityIdentificationsIDTypeCoNit LegalEntityAssociationChildLegalEntityIdentificationsIDType = "co_nit"
LegalEntityAssociationChildLegalEntityIdentificationsIDTypeHnID LegalEntityAssociationChildLegalEntityIdentificationsIDType = "hn_id"
LegalEntityAssociationChildLegalEntityIdentificationsIDTypeHnRtn LegalEntityAssociationChildLegalEntityIdentificationsIDType = "hn_rtn"
LegalEntityAssociationChildLegalEntityIdentificationsIDTypeInLei LegalEntityAssociationChildLegalEntityIdentificationsIDType = "in_lei"
LegalEntityAssociationChildLegalEntityIdentificationsIDTypeKrBrn LegalEntityAssociationChildLegalEntityIdentificationsIDType = "kr_brn"
LegalEntityAssociationChildLegalEntityIdentificationsIDTypeKrCrn LegalEntityAssociationChildLegalEntityIdentificationsIDType = "kr_crn"
LegalEntityAssociationChildLegalEntityIdentificationsIDTypeKrRrn LegalEntityAssociationChildLegalEntityIdentificationsIDType = "kr_rrn"
LegalEntityAssociationChildLegalEntityIdentificationsIDTypePassport LegalEntityAssociationChildLegalEntityIdentificationsIDType = "passport"
LegalEntityAssociationChildLegalEntityIdentificationsIDTypeSaTin LegalEntityAssociationChildLegalEntityIdentificationsIDType = "sa_tin"
LegalEntityAssociationChildLegalEntityIdentificationsIDTypeSaVat LegalEntityAssociationChildLegalEntityIdentificationsIDType = "sa_vat"
LegalEntityAssociationChildLegalEntityIdentificationsIDTypeUsEin LegalEntityAssociationChildLegalEntityIdentificationsIDType = "us_ein"
LegalEntityAssociationChildLegalEntityIdentificationsIDTypeUsItin LegalEntityAssociationChildLegalEntityIdentificationsIDType = "us_itin"
LegalEntityAssociationChildLegalEntityIdentificationsIDTypeUsSsn LegalEntityAssociationChildLegalEntityIdentificationsIDType = "us_ssn"
LegalEntityAssociationChildLegalEntityIdentificationsIDTypeVnTin LegalEntityAssociationChildLegalEntityIdentificationsIDType = "vn_tin"
)
func (r LegalEntityAssociationChildLegalEntityIdentificationsIDType) IsKnown() bool {
switch r {
case LegalEntityAssociationChildLegalEntityIdentificationsIDTypeArCuil, LegalEntityAssociationChildLegalEntityIdentificationsIDTypeArCuit, LegalEntityAssociationChildLegalEntityIdentificationsIDTypeBrCnpj, LegalEntityAssociationChildLegalEntityIdentificationsIDTypeBrCpf, LegalEntityAssociationChildLegalEntityIdentificationsIDTypeClRun, LegalEntityAssociationChildLegalEntityIdentificationsIDTypeClRut, LegalEntityAssociationChildLegalEntityIdentificationsIDTypeCoCedulas, LegalEntityAssociationChildLegalEntityIdentificationsIDTypeCoNit, LegalEntityAssociationChildLegalEntityIdentificationsIDTypeHnID, LegalEntityAssociationChildLegalEntityIdentificationsIDTypeHnRtn, LegalEntityAssociationChildLegalEntityIdentificationsIDTypeInLei, LegalEntityAssociationChildLegalEntityIdentificationsIDTypeKrBrn, LegalEntityAssociationChildLegalEntityIdentificationsIDTypeKrCrn, LegalEntityAssociationChildLegalEntityIdentificationsIDTypeKrRrn, LegalEntityAssociationChildLegalEntityIdentificationsIDTypePassport, LegalEntityAssociationChildLegalEntityIdentificationsIDTypeSaTin, LegalEntityAssociationChildLegalEntityIdentificationsIDTypeSaVat, LegalEntityAssociationChildLegalEntityIdentificationsIDTypeUsEin, LegalEntityAssociationChildLegalEntityIdentificationsIDTypeUsItin, LegalEntityAssociationChildLegalEntityIdentificationsIDTypeUsSsn, LegalEntityAssociationChildLegalEntityIdentificationsIDTypeVnTin:
return true
}
return false
}
// The type of legal entity.
type LegalEntityAssociationChildLegalEntityLegalEntityType string
const (
LegalEntityAssociationChildLegalEntityLegalEntityTypeBusiness LegalEntityAssociationChildLegalEntityLegalEntityType = "business"
LegalEntityAssociationChildLegalEntityLegalEntityTypeIndividual LegalEntityAssociationChildLegalEntityLegalEntityType = "individual"
LegalEntityAssociationChildLegalEntityLegalEntityTypeJoint LegalEntityAssociationChildLegalEntityLegalEntityType = "joint"
)
func (r LegalEntityAssociationChildLegalEntityLegalEntityType) IsKnown() bool {
switch r {
case LegalEntityAssociationChildLegalEntityLegalEntityTypeBusiness, LegalEntityAssociationChildLegalEntityLegalEntityTypeIndividual, LegalEntityAssociationChildLegalEntityLegalEntityTypeJoint:
return true
}
return false
}
// The business's legal structure.
type LegalEntityAssociationChildLegalEntityLegalStructure string
const (
LegalEntityAssociationChildLegalEntityLegalStructureCorporation LegalEntityAssociationChildLegalEntityLegalStructure = "corporation"
LegalEntityAssociationChildLegalEntityLegalStructureLlc LegalEntityAssociationChildLegalEntityLegalStructure = "llc"
LegalEntityAssociationChildLegalEntityLegalStructureNonProfit LegalEntityAssociationChildLegalEntityLegalStructure = "non_profit"
LegalEntityAssociationChildLegalEntityLegalStructurePartnership LegalEntityAssociationChildLegalEntityLegalStructure = "partnership"
LegalEntityAssociationChildLegalEntityLegalStructureSoleProprietorship LegalEntityAssociationChildLegalEntityLegalStructure = "sole_proprietorship"
LegalEntityAssociationChildLegalEntityLegalStructureTrust LegalEntityAssociationChildLegalEntityLegalStructure = "trust"
)
func (r LegalEntityAssociationChildLegalEntityLegalStructure) IsKnown() bool {
switch r {
case LegalEntityAssociationChildLegalEntityLegalStructureCorporation, LegalEntityAssociationChildLegalEntityLegalStructureLlc, LegalEntityAssociationChildLegalEntityLegalStructureNonProfit, LegalEntityAssociationChildLegalEntityLegalStructurePartnership, LegalEntityAssociationChildLegalEntityLegalStructureSoleProprietorship, LegalEntityAssociationChildLegalEntityLegalStructureTrust:
return true
}
return false
}
// A list of phone numbers in E.164 format.
type LegalEntityAssociationChildLegalEntityPhoneNumber struct {
PhoneNumber string `json:"phone_number"`
JSON legalEntityAssociationChildLegalEntityPhoneNumberJSON `json:"-"`
}
// legalEntityAssociationChildLegalEntityPhoneNumberJSON contains the JSON metadata
// for the struct [LegalEntityAssociationChildLegalEntityPhoneNumber]
type legalEntityAssociationChildLegalEntityPhoneNumberJSON struct {
PhoneNumber apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *LegalEntityAssociationChildLegalEntityPhoneNumber) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r legalEntityAssociationChildLegalEntityPhoneNumberJSON) RawJSON() string {
return r.raw
}
// The risk rating of the legal entity. One of low, medium, high.
type LegalEntityAssociationChildLegalEntityRiskRating string
const (
LegalEntityAssociationChildLegalEntityRiskRatingLow LegalEntityAssociationChildLegalEntityRiskRating = "low"
LegalEntityAssociationChildLegalEntityRiskRatingMedium LegalEntityAssociationChildLegalEntityRiskRating = "medium"
LegalEntityAssociationChildLegalEntityRiskRatingHigh LegalEntityAssociationChildLegalEntityRiskRating = "high"
)
func (r LegalEntityAssociationChildLegalEntityRiskRating) IsKnown() bool {
switch r {
case LegalEntityAssociationChildLegalEntityRiskRatingLow, LegalEntityAssociationChildLegalEntityRiskRatingMedium, LegalEntityAssociationChildLegalEntityRiskRatingHigh:
return true
}
return false
}
// A list of relationship types for how the child entity relates to parent entity.
type LegalEntityAssociationRelationshipType string
const (
LegalEntityAssociationRelationshipTypeBeneficialOwner LegalEntityAssociationRelationshipType = "beneficial_owner"
LegalEntityAssociationRelationshipTypeControlPerson LegalEntityAssociationRelationshipType = "control_person"
)
func (r LegalEntityAssociationRelationshipType) IsKnown() bool {
switch r {
case LegalEntityAssociationRelationshipTypeBeneficialOwner, LegalEntityAssociationRelationshipTypeControlPerson:
return true
}
return false
}
type LegalEntityAssociationNewParams struct {
// The ID of the parent legal entity. This must be a business or joint legal
// entity.
ParentLegalEntityID param.Field[string] `json:"parent_legal_entity_id,required"`
RelationshipTypes param.Field[[]LegalEntityAssociationNewParamsRelationshipType] `json:"relationship_types,required"`
// The child legal entity.
ChildLegalEntity param.Field[LegalEntityAssociationNewParamsChildLegalEntity] `json:"child_legal_entity"`
// The ID of the child legal entity.
ChildLegalEntityID param.Field[string] `json:"child_legal_entity_id"`
// The child entity's ownership percentage iff they are a beneficial owner.
OwnershipPercentage param.Field[int64] `json:"ownership_percentage"`
// The job title of the child entity at the parent entity.
Title param.Field[string] `json:"title"`
}
func (r LegalEntityAssociationNewParams) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// A list of relationship types for how the child entity relates to parent entity.
type LegalEntityAssociationNewParamsRelationshipType string
const (
LegalEntityAssociationNewParamsRelationshipTypeBeneficialOwner LegalEntityAssociationNewParamsRelationshipType = "beneficial_owner"
LegalEntityAssociationNewParamsRelationshipTypeControlPerson LegalEntityAssociationNewParamsRelationshipType = "control_person"
)
func (r LegalEntityAssociationNewParamsRelationshipType) IsKnown() bool {
switch r {
case LegalEntityAssociationNewParamsRelationshipTypeBeneficialOwner, LegalEntityAssociationNewParamsRelationshipTypeControlPerson:
return true
}
return false
}
// The child legal entity.
type LegalEntityAssociationNewParamsChildLegalEntity struct {
// A list of addresses for the entity.
Addresses param.Field[[]LegalEntityAssociationNewParamsChildLegalEntityAddress] `json:"addresses"`
BankSettings param.Field[BankSettingsParam] `json:"bank_settings"`
// The business's legal business name.
BusinessName param.Field[string] `json:"business_name"`
// The country of citizenship for an individual.
CitizenshipCountry param.Field[string] `json:"citizenship_country"`
// A business's formation date (YYYY-MM-DD).
DateFormed param.Field[time.Time] `json:"date_formed" format:"date"`
// An individual's date of birth (YYYY-MM-DD).
DateOfBirth param.Field[time.Time] `json:"date_of_birth" format:"date"`
DoingBusinessAsNames param.Field[[]string] `json:"doing_business_as_names"`
// The entity's primary email.
Email param.Field[string] `json:"email"`
// An individual's first name.
FirstName param.Field[string] `json:"first_name"`
// A list of identifications for the legal entity.
Identifications param.Field[[]LegalEntityAssociationNewParamsChildLegalEntityIdentification] `json:"identifications"`
// An individual's last name.
LastName param.Field[string] `json:"last_name"`
// The type of legal entity.
LegalEntityType param.Field[LegalEntityAssociationNewParamsChildLegalEntityLegalEntityType] `json:"legal_entity_type"`
// The business's legal structure.
LegalStructure param.Field[LegalEntityAssociationNewParamsChildLegalEntityLegalStructure] `json:"legal_structure"`
// Additional data represented as key-value pairs. Both the key and value must be
// strings.
Metadata param.Field[map[string]string] `json:"metadata"`
// An individual's middle name.
MiddleName param.Field[string] `json:"middle_name"`
PhoneNumbers param.Field[[]LegalEntityAssociationNewParamsChildLegalEntityPhoneNumber] `json:"phone_numbers"`
// Whether the individual is a politically exposed person.
PoliticallyExposedPerson param.Field[bool] `json:"politically_exposed_person"`
// An individual's preferred name.
PreferredName param.Field[string] `json:"preferred_name"`
// An individual's prefix.
Prefix param.Field[string] `json:"prefix"`
// The risk rating of the legal entity. One of low, medium, high.
RiskRating param.Field[LegalEntityAssociationNewParamsChildLegalEntityRiskRating] `json:"risk_rating"`
// An individual's suffix.
Suffix param.Field[string] `json:"suffix"`
WealthAndEmploymentDetails param.Field[WealthAndEmploymentDetailsParam] `json:"wealth_and_employment_details"`
// The entity's primary website URL.
Website param.Field[string] `json:"website"`
}
func (r LegalEntityAssociationNewParamsChildLegalEntity) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
type LegalEntityAssociationNewParamsChildLegalEntityAddress struct {
// Country code conforms to [ISO 3166-1 alpha-2]
Country param.Field[string] `json:"country,required"`
Line1 param.Field[string] `json:"line1,required"`
// Locality or City.
Locality param.Field[string] `json:"locality,required"`
// The postal code of the address.
PostalCode param.Field[string] `json:"postal_code,required"`
// Region or State.
Region param.Field[string] `json:"region,required"`
// The types of this address.
AddressTypes param.Field[[]LegalEntityAssociationNewParamsChildLegalEntityAddressesAddressType] `json:"address_types"`
Line2 param.Field[string] `json:"line2"`
}
func (r LegalEntityAssociationNewParamsChildLegalEntityAddress) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
type LegalEntityAssociationNewParamsChildLegalEntityAddressesAddressType string
const (
LegalEntityAssociationNewParamsChildLegalEntityAddressesAddressTypeBusiness LegalEntityAssociationNewParamsChildLegalEntityAddressesAddressType = "business"
LegalEntityAssociationNewParamsChildLegalEntityAddressesAddressTypeMailing LegalEntityAssociationNewParamsChildLegalEntityAddressesAddressType = "mailing"
LegalEntityAssociationNewParamsChildLegalEntityAddressesAddressTypeOther LegalEntityAssociationNewParamsChildLegalEntityAddressesAddressType = "other"
LegalEntityAssociationNewParamsChildLegalEntityAddressesAddressTypePoBox LegalEntityAssociationNewParamsChildLegalEntityAddressesAddressType = "po_box"
LegalEntityAssociationNewParamsChildLegalEntityAddressesAddressTypeResidential LegalEntityAssociationNewParamsChildLegalEntityAddressesAddressType = "residential"
)
func (r LegalEntityAssociationNewParamsChildLegalEntityAddressesAddressType) IsKnown() bool {
switch r {
case LegalEntityAssociationNewParamsChildLegalEntityAddressesAddressTypeBusiness, LegalEntityAssociationNewParamsChildLegalEntityAddressesAddressTypeMailing, LegalEntityAssociationNewParamsChildLegalEntityAddressesAddressTypeOther, LegalEntityAssociationNewParamsChildLegalEntityAddressesAddressTypePoBox, LegalEntityAssociationNewParamsChildLegalEntityAddressesAddressTypeResidential:
return true
}
return false
}
type LegalEntityAssociationNewParamsChildLegalEntityIdentification struct {
// The ID number of identification document.
IDNumber param.Field[string] `json:"id_number,required"`
// The type of ID number.
IDType param.Field[LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDType] `json:"id_type,required"`
// The ISO 3166-1 alpha-2 country code of the country that issued the
// identification
IssuingCountry param.Field[string] `json:"issuing_country"`
}
func (r LegalEntityAssociationNewParamsChildLegalEntityIdentification) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// The type of ID number.
type LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDType string
const (
LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeArCuil LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDType = "ar_cuil"
LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeArCuit LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDType = "ar_cuit"
LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeBrCnpj LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDType = "br_cnpj"
LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeBrCpf LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDType = "br_cpf"
LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeClRun LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDType = "cl_run"
LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeClRut LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDType = "cl_rut"
LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeCoCedulas LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDType = "co_cedulas"
LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeCoNit LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDType = "co_nit"
LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeHnID LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDType = "hn_id"
LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeHnRtn LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDType = "hn_rtn"
LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeInLei LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDType = "in_lei"
LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeKrBrn LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDType = "kr_brn"
LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeKrCrn LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDType = "kr_crn"
LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeKrRrn LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDType = "kr_rrn"
LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypePassport LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDType = "passport"
LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeSaTin LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDType = "sa_tin"
LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeSaVat LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDType = "sa_vat"
LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeUsEin LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDType = "us_ein"
LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeUsItin LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDType = "us_itin"
LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeUsSsn LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDType = "us_ssn"
LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeVnTin LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDType = "vn_tin"
)
func (r LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDType) IsKnown() bool {
switch r {
case LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeArCuil, LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeArCuit, LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeBrCnpj, LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeBrCpf, LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeClRun, LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeClRut, LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeCoCedulas, LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeCoNit, LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeHnID, LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeHnRtn, LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeInLei, LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeKrBrn, LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeKrCrn, LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeKrRrn, LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypePassport, LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeSaTin, LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeSaVat, LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeUsEin, LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeUsItin, LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeUsSsn, LegalEntityAssociationNewParamsChildLegalEntityIdentificationsIDTypeVnTin:
return true
}
return false
}
// The type of legal entity.
type LegalEntityAssociationNewParamsChildLegalEntityLegalEntityType string
const (
LegalEntityAssociationNewParamsChildLegalEntityLegalEntityTypeBusiness LegalEntityAssociationNewParamsChildLegalEntityLegalEntityType = "business"
LegalEntityAssociationNewParamsChildLegalEntityLegalEntityTypeIndividual LegalEntityAssociationNewParamsChildLegalEntityLegalEntityType = "individual"
)
func (r LegalEntityAssociationNewParamsChildLegalEntityLegalEntityType) IsKnown() bool {
switch r {
case LegalEntityAssociationNewParamsChildLegalEntityLegalEntityTypeBusiness, LegalEntityAssociationNewParamsChildLegalEntityLegalEntityTypeIndividual:
return true
}
return false
}
// The business's legal structure.
type LegalEntityAssociationNewParamsChildLegalEntityLegalStructure string
const (
LegalEntityAssociationNewParamsChildLegalEntityLegalStructureCorporation LegalEntityAssociationNewParamsChildLegalEntityLegalStructure = "corporation"
LegalEntityAssociationNewParamsChildLegalEntityLegalStructureLlc LegalEntityAssociationNewParamsChildLegalEntityLegalStructure = "llc"
LegalEntityAssociationNewParamsChildLegalEntityLegalStructureNonProfit LegalEntityAssociationNewParamsChildLegalEntityLegalStructure = "non_profit"
LegalEntityAssociationNewParamsChildLegalEntityLegalStructurePartnership LegalEntityAssociationNewParamsChildLegalEntityLegalStructure = "partnership"
LegalEntityAssociationNewParamsChildLegalEntityLegalStructureSoleProprietorship LegalEntityAssociationNewParamsChildLegalEntityLegalStructure = "sole_proprietorship"
LegalEntityAssociationNewParamsChildLegalEntityLegalStructureTrust LegalEntityAssociationNewParamsChildLegalEntityLegalStructure = "trust"
)
func (r LegalEntityAssociationNewParamsChildLegalEntityLegalStructure) IsKnown() bool {
switch r {
case LegalEntityAssociationNewParamsChildLegalEntityLegalStructureCorporation, LegalEntityAssociationNewParamsChildLegalEntityLegalStructureLlc, LegalEntityAssociationNewParamsChildLegalEntityLegalStructureNonProfit, LegalEntityAssociationNewParamsChildLegalEntityLegalStructurePartnership, LegalEntityAssociationNewParamsChildLegalEntityLegalStructureSoleProprietorship, LegalEntityAssociationNewParamsChildLegalEntityLegalStructureTrust:
return true
}
return false
}
// A list of phone numbers in E.164 format.
type LegalEntityAssociationNewParamsChildLegalEntityPhoneNumber struct {
PhoneNumber param.Field[string] `json:"phone_number"`
}
func (r LegalEntityAssociationNewParamsChildLegalEntityPhoneNumber) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// The risk rating of the legal entity. One of low, medium, high.
type LegalEntityAssociationNewParamsChildLegalEntityRiskRating string
const (
LegalEntityAssociationNewParamsChildLegalEntityRiskRatingLow LegalEntityAssociationNewParamsChildLegalEntityRiskRating = "low"
LegalEntityAssociationNewParamsChildLegalEntityRiskRatingMedium LegalEntityAssociationNewParamsChildLegalEntityRiskRating = "medium"
LegalEntityAssociationNewParamsChildLegalEntityRiskRatingHigh LegalEntityAssociationNewParamsChildLegalEntityRiskRating = "high"
)
func (r LegalEntityAssociationNewParamsChildLegalEntityRiskRating) IsKnown() bool {
switch r {
case LegalEntityAssociationNewParamsChildLegalEntityRiskRatingLow, LegalEntityAssociationNewParamsChildLegalEntityRiskRatingMedium, LegalEntityAssociationNewParamsChildLegalEntityRiskRatingHigh:
return true
}
return false
}