-
Notifications
You must be signed in to change notification settings - Fork 2
/
legalentity.go
906 lines (799 loc) · 47.5 KB
/
legalentity.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
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
package moderntreasury
import (
"context"
"errors"
"fmt"
"net/http"
"net/url"
"time"
"github.com/Modern-Treasury/modern-treasury-go/v2/internal/apijson"
"github.com/Modern-Treasury/modern-treasury-go/v2/internal/apiquery"
"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"
"github.com/Modern-Treasury/modern-treasury-go/v2/packages/pagination"
)
// LegalEntityService 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 [NewLegalEntityService] method instead.
type LegalEntityService struct {
Options []option.RequestOption
}
// NewLegalEntityService 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 NewLegalEntityService(opts ...option.RequestOption) (r *LegalEntityService) {
r = &LegalEntityService{}
r.Options = opts
return
}
// create legal_entity
func (r *LegalEntityService) New(ctx context.Context, body LegalEntityNewParams, opts ...option.RequestOption) (res *LegalEntity, err error) {
opts = append(r.Options[:], opts...)
path := "api/legal_entities"
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &res, opts...)
return
}
// Get details on a single legal entity.
func (r *LegalEntityService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *LegalEntity, err error) {
opts = append(r.Options[:], opts...)
if id == "" {
err = errors.New("missing required id parameter")
return
}
path := fmt.Sprintf("api/legal_entities/%s", id)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &res, opts...)
return
}
// Update a legal entity.
func (r *LegalEntityService) Update(ctx context.Context, id string, body LegalEntityUpdateParams, opts ...option.RequestOption) (res *LegalEntity, err error) {
opts = append(r.Options[:], opts...)
if id == "" {
err = errors.New("missing required id parameter")
return
}
path := fmt.Sprintf("api/legal_entities/%s", id)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &res, opts...)
return
}
// Get a list of all legal entities.
func (r *LegalEntityService) List(ctx context.Context, query LegalEntityListParams, opts ...option.RequestOption) (res *pagination.Page[LegalEntity], err error) {
var raw *http.Response
opts = append(r.Options[:], opts...)
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
path := "api/legal_entities"
cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...)
if err != nil {
return nil, err
}
err = cfg.Execute()
if err != nil {
return nil, err
}
res.SetPageConfig(cfg, raw)
return res, nil
}
// Get a list of all legal entities.
func (r *LegalEntityService) ListAutoPaging(ctx context.Context, query LegalEntityListParams, opts ...option.RequestOption) *pagination.PageAutoPager[LegalEntity] {
return pagination.NewPageAutoPager(r.List(ctx, query, opts...))
}
type LegalEntity struct {
ID string `json:"id,required" format:"uuid"`
// A list of addresses for the entity.
Addresses []LegalEntityAddress `json:"addresses,required"`
// The business's legal business name.
BusinessName string `json:"business_name,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 []LegalEntityIdentification `json:"identifications,required"`
// An individual's last name.
LastName string `json:"last_name,required,nullable"`
// The legal entity associations and its child legal entities.
LegalEntityAssociations []LegalEntityAssociation `json:"legal_entity_associations,required,nullable"`
// The type of legal entity.
LegalEntityType LegalEntityLegalEntityType `json:"legal_entity_type,required"`
// The business's legal structure.
LegalStructure LegalEntityLegalStructure `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"`
Object string `json:"object,required"`
PhoneNumbers []LegalEntityPhoneNumber `json:"phone_numbers,required"`
// The risk rating of the legal entity. One of low, medium, high.
RiskRating LegalEntityRiskRating `json:"risk_rating,required,nullable"`
UpdatedAt time.Time `json:"updated_at,required" format:"date-time"`
// The entity's primary website URL.
Website string `json:"website,required,nullable"`
JSON legalEntityJSON `json:"-"`
}
// legalEntityJSON contains the JSON metadata for the struct [LegalEntity]
type legalEntityJSON struct {
ID apijson.Field
Addresses apijson.Field
BusinessName 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
LegalEntityAssociations apijson.Field
LegalEntityType apijson.Field
LegalStructure apijson.Field
LiveMode apijson.Field
Metadata apijson.Field
Object apijson.Field
PhoneNumbers apijson.Field
RiskRating apijson.Field
UpdatedAt apijson.Field
Website apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *LegalEntity) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r legalEntityJSON) RawJSON() string {
return r.raw
}
type LegalEntityAddress struct {
ID string `json:"id,required" format:"uuid"`
// The types of this address.
AddressTypes []LegalEntityAddressesAddressType `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 legalEntityAddressJSON `json:"-"`
}
// legalEntityAddressJSON contains the JSON metadata for the struct
// [LegalEntityAddress]
type legalEntityAddressJSON 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 *LegalEntityAddress) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r legalEntityAddressJSON) RawJSON() string {
return r.raw
}
type LegalEntityAddressesAddressType string
const (
LegalEntityAddressesAddressTypeBusiness LegalEntityAddressesAddressType = "business"
LegalEntityAddressesAddressTypeMailing LegalEntityAddressesAddressType = "mailing"
LegalEntityAddressesAddressTypeOther LegalEntityAddressesAddressType = "other"
LegalEntityAddressesAddressTypePoBox LegalEntityAddressesAddressType = "po_box"
LegalEntityAddressesAddressTypeResidential LegalEntityAddressesAddressType = "residential"
)
func (r LegalEntityAddressesAddressType) IsKnown() bool {
switch r {
case LegalEntityAddressesAddressTypeBusiness, LegalEntityAddressesAddressTypeMailing, LegalEntityAddressesAddressTypeOther, LegalEntityAddressesAddressTypePoBox, LegalEntityAddressesAddressTypeResidential:
return true
}
return false
}
type LegalEntityIdentification 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 LegalEntityIdentificationsIDType `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 legalEntityIdentificationJSON `json:"-"`
}
// legalEntityIdentificationJSON contains the JSON metadata for the struct
// [LegalEntityIdentification]
type legalEntityIdentificationJSON 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 *LegalEntityIdentification) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r legalEntityIdentificationJSON) RawJSON() string {
return r.raw
}
// The type of ID number.
type LegalEntityIdentificationsIDType string
const (
LegalEntityIdentificationsIDTypeArCuil LegalEntityIdentificationsIDType = "ar_cuil"
LegalEntityIdentificationsIDTypeArCuit LegalEntityIdentificationsIDType = "ar_cuit"
LegalEntityIdentificationsIDTypeBrCnpj LegalEntityIdentificationsIDType = "br_cnpj"
LegalEntityIdentificationsIDTypeBrCpf LegalEntityIdentificationsIDType = "br_cpf"
LegalEntityIdentificationsIDTypeClRun LegalEntityIdentificationsIDType = "cl_run"
LegalEntityIdentificationsIDTypeClRut LegalEntityIdentificationsIDType = "cl_rut"
LegalEntityIdentificationsIDTypeCoCedulas LegalEntityIdentificationsIDType = "co_cedulas"
LegalEntityIdentificationsIDTypeCoNit LegalEntityIdentificationsIDType = "co_nit"
LegalEntityIdentificationsIDTypeHnID LegalEntityIdentificationsIDType = "hn_id"
LegalEntityIdentificationsIDTypeHnRtn LegalEntityIdentificationsIDType = "hn_rtn"
LegalEntityIdentificationsIDTypeInLei LegalEntityIdentificationsIDType = "in_lei"
LegalEntityIdentificationsIDTypeKrBrn LegalEntityIdentificationsIDType = "kr_brn"
LegalEntityIdentificationsIDTypeKrCrn LegalEntityIdentificationsIDType = "kr_crn"
LegalEntityIdentificationsIDTypeKrRrn LegalEntityIdentificationsIDType = "kr_rrn"
LegalEntityIdentificationsIDTypePassport LegalEntityIdentificationsIDType = "passport"
LegalEntityIdentificationsIDTypeSaTin LegalEntityIdentificationsIDType = "sa_tin"
LegalEntityIdentificationsIDTypeSaVat LegalEntityIdentificationsIDType = "sa_vat"
LegalEntityIdentificationsIDTypeUsEin LegalEntityIdentificationsIDType = "us_ein"
LegalEntityIdentificationsIDTypeUsItin LegalEntityIdentificationsIDType = "us_itin"
LegalEntityIdentificationsIDTypeUsSsn LegalEntityIdentificationsIDType = "us_ssn"
LegalEntityIdentificationsIDTypeVnTin LegalEntityIdentificationsIDType = "vn_tin"
)
func (r LegalEntityIdentificationsIDType) IsKnown() bool {
switch r {
case LegalEntityIdentificationsIDTypeArCuil, LegalEntityIdentificationsIDTypeArCuit, LegalEntityIdentificationsIDTypeBrCnpj, LegalEntityIdentificationsIDTypeBrCpf, LegalEntityIdentificationsIDTypeClRun, LegalEntityIdentificationsIDTypeClRut, LegalEntityIdentificationsIDTypeCoCedulas, LegalEntityIdentificationsIDTypeCoNit, LegalEntityIdentificationsIDTypeHnID, LegalEntityIdentificationsIDTypeHnRtn, LegalEntityIdentificationsIDTypeInLei, LegalEntityIdentificationsIDTypeKrBrn, LegalEntityIdentificationsIDTypeKrCrn, LegalEntityIdentificationsIDTypeKrRrn, LegalEntityIdentificationsIDTypePassport, LegalEntityIdentificationsIDTypeSaTin, LegalEntityIdentificationsIDTypeSaVat, LegalEntityIdentificationsIDTypeUsEin, LegalEntityIdentificationsIDTypeUsItin, LegalEntityIdentificationsIDTypeUsSsn, LegalEntityIdentificationsIDTypeVnTin:
return true
}
return false
}
// The type of legal entity.
type LegalEntityLegalEntityType string
const (
LegalEntityLegalEntityTypeBusiness LegalEntityLegalEntityType = "business"
LegalEntityLegalEntityTypeIndividual LegalEntityLegalEntityType = "individual"
LegalEntityLegalEntityTypeJoint LegalEntityLegalEntityType = "joint"
)
func (r LegalEntityLegalEntityType) IsKnown() bool {
switch r {
case LegalEntityLegalEntityTypeBusiness, LegalEntityLegalEntityTypeIndividual, LegalEntityLegalEntityTypeJoint:
return true
}
return false
}
// The business's legal structure.
type LegalEntityLegalStructure string
const (
LegalEntityLegalStructureCorporation LegalEntityLegalStructure = "corporation"
LegalEntityLegalStructureLlc LegalEntityLegalStructure = "llc"
LegalEntityLegalStructureNonProfit LegalEntityLegalStructure = "non_profit"
LegalEntityLegalStructurePartnership LegalEntityLegalStructure = "partnership"
LegalEntityLegalStructureSoleProprietorship LegalEntityLegalStructure = "sole_proprietorship"
LegalEntityLegalStructureTrust LegalEntityLegalStructure = "trust"
)
func (r LegalEntityLegalStructure) IsKnown() bool {
switch r {
case LegalEntityLegalStructureCorporation, LegalEntityLegalStructureLlc, LegalEntityLegalStructureNonProfit, LegalEntityLegalStructurePartnership, LegalEntityLegalStructureSoleProprietorship, LegalEntityLegalStructureTrust:
return true
}
return false
}
// A list of phone numbers in E.164 format.
type LegalEntityPhoneNumber struct {
PhoneNumber string `json:"phone_number"`
JSON legalEntityPhoneNumberJSON `json:"-"`
}
// legalEntityPhoneNumberJSON contains the JSON metadata for the struct
// [LegalEntityPhoneNumber]
type legalEntityPhoneNumberJSON struct {
PhoneNumber apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *LegalEntityPhoneNumber) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r legalEntityPhoneNumberJSON) RawJSON() string {
return r.raw
}
// The risk rating of the legal entity. One of low, medium, high.
type LegalEntityRiskRating string
const (
LegalEntityRiskRatingLow LegalEntityRiskRating = "low"
LegalEntityRiskRatingMedium LegalEntityRiskRating = "medium"
LegalEntityRiskRatingHigh LegalEntityRiskRating = "high"
)
func (r LegalEntityRiskRating) IsKnown() bool {
switch r {
case LegalEntityRiskRatingLow, LegalEntityRiskRatingMedium, LegalEntityRiskRatingHigh:
return true
}
return false
}
type LegalEntityNewParams struct {
// The type of legal entity.
LegalEntityType param.Field[LegalEntityNewParamsLegalEntityType] `json:"legal_entity_type,required"`
// A list of addresses for the entity.
Addresses param.Field[[]LegalEntityNewParamsAddress] `json:"addresses"`
// The business's legal business name.
BusinessName param.Field[string] `json:"business_name"`
// 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[[]LegalEntityNewParamsIdentification] `json:"identifications"`
// An individual's last name.
LastName param.Field[string] `json:"last_name"`
// The legal entity associations and its child legal entities.
LegalEntityAssociations param.Field[[]LegalEntityNewParamsLegalEntityAssociation] `json:"legal_entity_associations"`
// The business's legal structure.
LegalStructure param.Field[LegalEntityNewParamsLegalStructure] `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"`
PhoneNumbers param.Field[[]LegalEntityNewParamsPhoneNumber] `json:"phone_numbers"`
// The risk rating of the legal entity. One of low, medium, high.
RiskRating param.Field[LegalEntityNewParamsRiskRating] `json:"risk_rating"`
// The entity's primary website URL.
Website param.Field[string] `json:"website"`
}
func (r LegalEntityNewParams) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// The type of legal entity.
type LegalEntityNewParamsLegalEntityType string
const (
LegalEntityNewParamsLegalEntityTypeBusiness LegalEntityNewParamsLegalEntityType = "business"
LegalEntityNewParamsLegalEntityTypeIndividual LegalEntityNewParamsLegalEntityType = "individual"
)
func (r LegalEntityNewParamsLegalEntityType) IsKnown() bool {
switch r {
case LegalEntityNewParamsLegalEntityTypeBusiness, LegalEntityNewParamsLegalEntityTypeIndividual:
return true
}
return false
}
type LegalEntityNewParamsAddress 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[[]LegalEntityNewParamsAddressesAddressType] `json:"address_types"`
Line2 param.Field[string] `json:"line2"`
}
func (r LegalEntityNewParamsAddress) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
type LegalEntityNewParamsAddressesAddressType string
const (
LegalEntityNewParamsAddressesAddressTypeBusiness LegalEntityNewParamsAddressesAddressType = "business"
LegalEntityNewParamsAddressesAddressTypeMailing LegalEntityNewParamsAddressesAddressType = "mailing"
LegalEntityNewParamsAddressesAddressTypeOther LegalEntityNewParamsAddressesAddressType = "other"
LegalEntityNewParamsAddressesAddressTypePoBox LegalEntityNewParamsAddressesAddressType = "po_box"
LegalEntityNewParamsAddressesAddressTypeResidential LegalEntityNewParamsAddressesAddressType = "residential"
)
func (r LegalEntityNewParamsAddressesAddressType) IsKnown() bool {
switch r {
case LegalEntityNewParamsAddressesAddressTypeBusiness, LegalEntityNewParamsAddressesAddressTypeMailing, LegalEntityNewParamsAddressesAddressTypeOther, LegalEntityNewParamsAddressesAddressTypePoBox, LegalEntityNewParamsAddressesAddressTypeResidential:
return true
}
return false
}
type LegalEntityNewParamsIdentification struct {
// The ID number of identification document.
IDNumber param.Field[string] `json:"id_number,required"`
// The type of ID number.
IDType param.Field[LegalEntityNewParamsIdentificationsIDType] `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 LegalEntityNewParamsIdentification) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// The type of ID number.
type LegalEntityNewParamsIdentificationsIDType string
const (
LegalEntityNewParamsIdentificationsIDTypeArCuil LegalEntityNewParamsIdentificationsIDType = "ar_cuil"
LegalEntityNewParamsIdentificationsIDTypeArCuit LegalEntityNewParamsIdentificationsIDType = "ar_cuit"
LegalEntityNewParamsIdentificationsIDTypeBrCnpj LegalEntityNewParamsIdentificationsIDType = "br_cnpj"
LegalEntityNewParamsIdentificationsIDTypeBrCpf LegalEntityNewParamsIdentificationsIDType = "br_cpf"
LegalEntityNewParamsIdentificationsIDTypeClRun LegalEntityNewParamsIdentificationsIDType = "cl_run"
LegalEntityNewParamsIdentificationsIDTypeClRut LegalEntityNewParamsIdentificationsIDType = "cl_rut"
LegalEntityNewParamsIdentificationsIDTypeCoCedulas LegalEntityNewParamsIdentificationsIDType = "co_cedulas"
LegalEntityNewParamsIdentificationsIDTypeCoNit LegalEntityNewParamsIdentificationsIDType = "co_nit"
LegalEntityNewParamsIdentificationsIDTypeHnID LegalEntityNewParamsIdentificationsIDType = "hn_id"
LegalEntityNewParamsIdentificationsIDTypeHnRtn LegalEntityNewParamsIdentificationsIDType = "hn_rtn"
LegalEntityNewParamsIdentificationsIDTypeInLei LegalEntityNewParamsIdentificationsIDType = "in_lei"
LegalEntityNewParamsIdentificationsIDTypeKrBrn LegalEntityNewParamsIdentificationsIDType = "kr_brn"
LegalEntityNewParamsIdentificationsIDTypeKrCrn LegalEntityNewParamsIdentificationsIDType = "kr_crn"
LegalEntityNewParamsIdentificationsIDTypeKrRrn LegalEntityNewParamsIdentificationsIDType = "kr_rrn"
LegalEntityNewParamsIdentificationsIDTypePassport LegalEntityNewParamsIdentificationsIDType = "passport"
LegalEntityNewParamsIdentificationsIDTypeSaTin LegalEntityNewParamsIdentificationsIDType = "sa_tin"
LegalEntityNewParamsIdentificationsIDTypeSaVat LegalEntityNewParamsIdentificationsIDType = "sa_vat"
LegalEntityNewParamsIdentificationsIDTypeUsEin LegalEntityNewParamsIdentificationsIDType = "us_ein"
LegalEntityNewParamsIdentificationsIDTypeUsItin LegalEntityNewParamsIdentificationsIDType = "us_itin"
LegalEntityNewParamsIdentificationsIDTypeUsSsn LegalEntityNewParamsIdentificationsIDType = "us_ssn"
LegalEntityNewParamsIdentificationsIDTypeVnTin LegalEntityNewParamsIdentificationsIDType = "vn_tin"
)
func (r LegalEntityNewParamsIdentificationsIDType) IsKnown() bool {
switch r {
case LegalEntityNewParamsIdentificationsIDTypeArCuil, LegalEntityNewParamsIdentificationsIDTypeArCuit, LegalEntityNewParamsIdentificationsIDTypeBrCnpj, LegalEntityNewParamsIdentificationsIDTypeBrCpf, LegalEntityNewParamsIdentificationsIDTypeClRun, LegalEntityNewParamsIdentificationsIDTypeClRut, LegalEntityNewParamsIdentificationsIDTypeCoCedulas, LegalEntityNewParamsIdentificationsIDTypeCoNit, LegalEntityNewParamsIdentificationsIDTypeHnID, LegalEntityNewParamsIdentificationsIDTypeHnRtn, LegalEntityNewParamsIdentificationsIDTypeInLei, LegalEntityNewParamsIdentificationsIDTypeKrBrn, LegalEntityNewParamsIdentificationsIDTypeKrCrn, LegalEntityNewParamsIdentificationsIDTypeKrRrn, LegalEntityNewParamsIdentificationsIDTypePassport, LegalEntityNewParamsIdentificationsIDTypeSaTin, LegalEntityNewParamsIdentificationsIDTypeSaVat, LegalEntityNewParamsIdentificationsIDTypeUsEin, LegalEntityNewParamsIdentificationsIDTypeUsItin, LegalEntityNewParamsIdentificationsIDTypeUsSsn, LegalEntityNewParamsIdentificationsIDTypeVnTin:
return true
}
return false
}
type LegalEntityNewParamsLegalEntityAssociation struct {
RelationshipTypes param.Field[[]LegalEntityNewParamsLegalEntityAssociationsRelationshipType] `json:"relationship_types,required"`
// The child legal entity.
ChildLegalEntity param.Field[LegalEntityNewParamsLegalEntityAssociationsChildLegalEntity] `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 LegalEntityNewParamsLegalEntityAssociation) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// A list of relationship types for how the child entity relates to parent entity.
type LegalEntityNewParamsLegalEntityAssociationsRelationshipType string
const (
LegalEntityNewParamsLegalEntityAssociationsRelationshipTypeBeneficialOwner LegalEntityNewParamsLegalEntityAssociationsRelationshipType = "beneficial_owner"
LegalEntityNewParamsLegalEntityAssociationsRelationshipTypeControlPerson LegalEntityNewParamsLegalEntityAssociationsRelationshipType = "control_person"
)
func (r LegalEntityNewParamsLegalEntityAssociationsRelationshipType) IsKnown() bool {
switch r {
case LegalEntityNewParamsLegalEntityAssociationsRelationshipTypeBeneficialOwner, LegalEntityNewParamsLegalEntityAssociationsRelationshipTypeControlPerson:
return true
}
return false
}
// The child legal entity.
type LegalEntityNewParamsLegalEntityAssociationsChildLegalEntity struct {
// A list of addresses for the entity.
Addresses param.Field[[]LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityAddress] `json:"addresses"`
// The business's legal business name.
BusinessName param.Field[string] `json:"business_name"`
// 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[[]LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentification] `json:"identifications"`
// An individual's last name.
LastName param.Field[string] `json:"last_name"`
// The type of legal entity.
LegalEntityType param.Field[LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalEntityType] `json:"legal_entity_type"`
// The business's legal structure.
LegalStructure param.Field[LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalStructure] `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"`
PhoneNumbers param.Field[[]LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityPhoneNumber] `json:"phone_numbers"`
// The risk rating of the legal entity. One of low, medium, high.
RiskRating param.Field[LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityRiskRating] `json:"risk_rating"`
// The entity's primary website URL.
Website param.Field[string] `json:"website"`
}
func (r LegalEntityNewParamsLegalEntityAssociationsChildLegalEntity) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
type LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityAddress 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[[]LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityAddressesAddressType] `json:"address_types"`
Line2 param.Field[string] `json:"line2"`
}
func (r LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityAddress) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
type LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityAddressesAddressType string
const (
LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityAddressesAddressTypeBusiness LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityAddressesAddressType = "business"
LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityAddressesAddressTypeMailing LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityAddressesAddressType = "mailing"
LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityAddressesAddressTypeOther LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityAddressesAddressType = "other"
LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityAddressesAddressTypePoBox LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityAddressesAddressType = "po_box"
LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityAddressesAddressTypeResidential LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityAddressesAddressType = "residential"
)
func (r LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityAddressesAddressType) IsKnown() bool {
switch r {
case LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityAddressesAddressTypeBusiness, LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityAddressesAddressTypeMailing, LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityAddressesAddressTypeOther, LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityAddressesAddressTypePoBox, LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityAddressesAddressTypeResidential:
return true
}
return false
}
type LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentification struct {
// The ID number of identification document.
IDNumber param.Field[string] `json:"id_number,required"`
// The type of ID number.
IDType param.Field[LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDType] `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 LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentification) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// The type of ID number.
type LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDType string
const (
LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeArCuil LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "ar_cuil"
LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeArCuit LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "ar_cuit"
LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeBrCnpj LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "br_cnpj"
LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeBrCpf LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "br_cpf"
LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeClRun LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "cl_run"
LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeClRut LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "cl_rut"
LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeCoCedulas LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "co_cedulas"
LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeCoNit LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "co_nit"
LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeHnID LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "hn_id"
LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeHnRtn LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "hn_rtn"
LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeInLei LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "in_lei"
LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeKrBrn LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "kr_brn"
LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeKrCrn LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "kr_crn"
LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeKrRrn LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "kr_rrn"
LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypePassport LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "passport"
LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeSaTin LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "sa_tin"
LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeSaVat LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "sa_vat"
LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeUsEin LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "us_ein"
LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeUsItin LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "us_itin"
LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeUsSsn LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "us_ssn"
LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeVnTin LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDType = "vn_tin"
)
func (r LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDType) IsKnown() bool {
switch r {
case LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeArCuil, LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeArCuit, LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeBrCnpj, LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeBrCpf, LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeClRun, LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeClRut, LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeCoCedulas, LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeCoNit, LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeHnID, LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeHnRtn, LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeInLei, LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeKrBrn, LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeKrCrn, LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeKrRrn, LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypePassport, LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeSaTin, LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeSaVat, LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeUsEin, LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeUsItin, LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeUsSsn, LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentificationsIDTypeVnTin:
return true
}
return false
}
// The type of legal entity.
type LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalEntityType string
const (
LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalEntityTypeBusiness LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalEntityType = "business"
LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalEntityTypeIndividual LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalEntityType = "individual"
)
func (r LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalEntityType) IsKnown() bool {
switch r {
case LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalEntityTypeBusiness, LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalEntityTypeIndividual:
return true
}
return false
}
// The business's legal structure.
type LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalStructure string
const (
LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalStructureCorporation LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalStructure = "corporation"
LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalStructureLlc LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalStructure = "llc"
LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalStructureNonProfit LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalStructure = "non_profit"
LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalStructurePartnership LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalStructure = "partnership"
LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalStructureSoleProprietorship LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalStructure = "sole_proprietorship"
LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalStructureTrust LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalStructure = "trust"
)
func (r LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalStructure) IsKnown() bool {
switch r {
case LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalStructureCorporation, LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalStructureLlc, LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalStructureNonProfit, LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalStructurePartnership, LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalStructureSoleProprietorship, LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalStructureTrust:
return true
}
return false
}
// A list of phone numbers in E.164 format.
type LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityPhoneNumber struct {
PhoneNumber param.Field[string] `json:"phone_number"`
}
func (r LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityPhoneNumber) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// The risk rating of the legal entity. One of low, medium, high.
type LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityRiskRating string
const (
LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityRiskRatingLow LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityRiskRating = "low"
LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityRiskRatingMedium LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityRiskRating = "medium"
LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityRiskRatingHigh LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityRiskRating = "high"
)
func (r LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityRiskRating) IsKnown() bool {
switch r {
case LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityRiskRatingLow, LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityRiskRatingMedium, LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityRiskRatingHigh:
return true
}
return false
}
// The business's legal structure.
type LegalEntityNewParamsLegalStructure string
const (
LegalEntityNewParamsLegalStructureCorporation LegalEntityNewParamsLegalStructure = "corporation"
LegalEntityNewParamsLegalStructureLlc LegalEntityNewParamsLegalStructure = "llc"
LegalEntityNewParamsLegalStructureNonProfit LegalEntityNewParamsLegalStructure = "non_profit"
LegalEntityNewParamsLegalStructurePartnership LegalEntityNewParamsLegalStructure = "partnership"
LegalEntityNewParamsLegalStructureSoleProprietorship LegalEntityNewParamsLegalStructure = "sole_proprietorship"
LegalEntityNewParamsLegalStructureTrust LegalEntityNewParamsLegalStructure = "trust"
)
func (r LegalEntityNewParamsLegalStructure) IsKnown() bool {
switch r {
case LegalEntityNewParamsLegalStructureCorporation, LegalEntityNewParamsLegalStructureLlc, LegalEntityNewParamsLegalStructureNonProfit, LegalEntityNewParamsLegalStructurePartnership, LegalEntityNewParamsLegalStructureSoleProprietorship, LegalEntityNewParamsLegalStructureTrust:
return true
}
return false
}
// A list of phone numbers in E.164 format.
type LegalEntityNewParamsPhoneNumber struct {
PhoneNumber param.Field[string] `json:"phone_number"`
}
func (r LegalEntityNewParamsPhoneNumber) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// The risk rating of the legal entity. One of low, medium, high.
type LegalEntityNewParamsRiskRating string
const (
LegalEntityNewParamsRiskRatingLow LegalEntityNewParamsRiskRating = "low"
LegalEntityNewParamsRiskRatingMedium LegalEntityNewParamsRiskRating = "medium"
LegalEntityNewParamsRiskRatingHigh LegalEntityNewParamsRiskRating = "high"
)
func (r LegalEntityNewParamsRiskRating) IsKnown() bool {
switch r {
case LegalEntityNewParamsRiskRatingLow, LegalEntityNewParamsRiskRatingMedium, LegalEntityNewParamsRiskRatingHigh:
return true
}
return false
}
type LegalEntityUpdateParams struct {
// The business's legal business name.
BusinessName param.Field[string] `json:"business_name"`
// 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"`
// An individual's last name.
LastName param.Field[string] `json:"last_name"`
// The business's legal structure.
LegalStructure param.Field[LegalEntityUpdateParamsLegalStructure] `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"`
PhoneNumbers param.Field[[]LegalEntityUpdateParamsPhoneNumber] `json:"phone_numbers"`
// The risk rating of the legal entity. One of low, medium, high.
RiskRating param.Field[LegalEntityUpdateParamsRiskRating] `json:"risk_rating"`
// The entity's primary website URL.
Website param.Field[string] `json:"website"`
}
func (r LegalEntityUpdateParams) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// The business's legal structure.
type LegalEntityUpdateParamsLegalStructure string
const (
LegalEntityUpdateParamsLegalStructureCorporation LegalEntityUpdateParamsLegalStructure = "corporation"
LegalEntityUpdateParamsLegalStructureLlc LegalEntityUpdateParamsLegalStructure = "llc"
LegalEntityUpdateParamsLegalStructureNonProfit LegalEntityUpdateParamsLegalStructure = "non_profit"
LegalEntityUpdateParamsLegalStructurePartnership LegalEntityUpdateParamsLegalStructure = "partnership"
LegalEntityUpdateParamsLegalStructureSoleProprietorship LegalEntityUpdateParamsLegalStructure = "sole_proprietorship"
LegalEntityUpdateParamsLegalStructureTrust LegalEntityUpdateParamsLegalStructure = "trust"
)
func (r LegalEntityUpdateParamsLegalStructure) IsKnown() bool {
switch r {
case LegalEntityUpdateParamsLegalStructureCorporation, LegalEntityUpdateParamsLegalStructureLlc, LegalEntityUpdateParamsLegalStructureNonProfit, LegalEntityUpdateParamsLegalStructurePartnership, LegalEntityUpdateParamsLegalStructureSoleProprietorship, LegalEntityUpdateParamsLegalStructureTrust:
return true
}
return false
}
// A list of phone numbers in E.164 format.
type LegalEntityUpdateParamsPhoneNumber struct {
PhoneNumber param.Field[string] `json:"phone_number"`
}
func (r LegalEntityUpdateParamsPhoneNumber) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// The risk rating of the legal entity. One of low, medium, high.
type LegalEntityUpdateParamsRiskRating string
const (
LegalEntityUpdateParamsRiskRatingLow LegalEntityUpdateParamsRiskRating = "low"
LegalEntityUpdateParamsRiskRatingMedium LegalEntityUpdateParamsRiskRating = "medium"
LegalEntityUpdateParamsRiskRatingHigh LegalEntityUpdateParamsRiskRating = "high"
)
func (r LegalEntityUpdateParamsRiskRating) IsKnown() bool {
switch r {
case LegalEntityUpdateParamsRiskRatingLow, LegalEntityUpdateParamsRiskRatingMedium, LegalEntityUpdateParamsRiskRatingHigh:
return true
}
return false
}
type LegalEntityListParams struct {
AfterCursor param.Field[string] `query:"after_cursor"`
LegalEntityType param.Field[LegalEntityListParamsLegalEntityType] `query:"legal_entity_type"`
// For example, if you want to query for records with metadata key `Type` and value
// `Loan`, the query would be `metadata%5BType%5D=Loan`. This encodes the query
// parameters.
Metadata param.Field[map[string]string] `query:"metadata"`
PerPage param.Field[int64] `query:"per_page"`
ShowDeleted param.Field[string] `query:"show_deleted"`
}
// URLQuery serializes [LegalEntityListParams]'s query parameters as `url.Values`.
func (r LegalEntityListParams) URLQuery() (v url.Values) {
return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
ArrayFormat: apiquery.ArrayQueryFormatBrackets,
NestedFormat: apiquery.NestedQueryFormatBrackets,
})
}
type LegalEntityListParamsLegalEntityType string
const (
LegalEntityListParamsLegalEntityTypeBusiness LegalEntityListParamsLegalEntityType = "business"
LegalEntityListParamsLegalEntityTypeIndividual LegalEntityListParamsLegalEntityType = "individual"
)
func (r LegalEntityListParamsLegalEntityType) IsKnown() bool {
switch r {
case LegalEntityListParamsLegalEntityTypeBusiness, LegalEntityListParamsLegalEntityTypeIndividual:
return true
}
return false
}