-
Notifications
You must be signed in to change notification settings - Fork 1
/
enums.go
4900 lines (4423 loc) · 175 KB
/
enums.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
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
Package advancedbilling
This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
package models
import (
"encoding/json"
"errors"
"fmt"
)
// AllVaults is a string enum.
// The vault that stores the payment profile with the provided `vault_token`. Use `bogus` for testing.
type AllVaults string
// MarshalJSON implements the json.Marshaler interface for AllVaults.
// It customizes the JSON marshaling process for AllVaults objects.
func (e AllVaults) MarshalJSON() (
[]byte,
error) {
if e.isValid() {
return []byte(fmt.Sprintf("\"%v\"", e)), nil
}
return nil, errors.New("the provided enum value is not allowed for AllVaults")
}
// UnmarshalJSON implements the json.Unmarshaler interface for AllVaults.
// It customizes the JSON unmarshaling process for AllVaults objects.
func (e *AllVaults) UnmarshalJSON(input []byte) error {
var enumValue string
err := json.Unmarshal(input, &enumValue)
if err != nil {
return err
}
*e = AllVaults(enumValue)
if !e.isValid() {
return errors.New("the value " + string(input) + " cannot be unmarshalled to AllVaults")
}
return nil
}
// Checks whether the value is actually a member of AllVaults.
func (e AllVaults) isValid() bool {
switch e {
case AllVaults_ADYEN,
AllVaults_AUTHORIZENET,
AllVaults_BEANSTREAM,
AllVaults_BLUESNAP,
AllVaults_BOGUS,
AllVaults_BRAINTREE1,
AllVaults_BRAINTREEBLUE,
AllVaults_CHECKOUT,
AllVaults_CYBERSOURCE,
AllVaults_ELAVON,
AllVaults_EWAY,
AllVaults_EWAYRAPID,
AllVaults_EWAYRAPIDSTD,
AllVaults_FIRSTDATA,
AllVaults_FORTE,
AllVaults_GOCARDLESS,
AllVaults_LITLE,
AllVaults_MAXIOPAYMENTS,
AllVaults_MAXP,
AllVaults_MODUSLINK,
AllVaults_MONERIS,
AllVaults_NMI,
AllVaults_ORBITAL,
AllVaults_PAYMENTEXPRESS,
AllVaults_PAYMILL,
AllVaults_PAYPAL,
AllVaults_PAYPALCOMPLETE,
AllVaults_PIN,
AllVaults_SQUARE,
AllVaults_STRIPE,
AllVaults_STRIPECONNECT,
AllVaults_TRUSTCOMMERCE,
AllVaults_UNIPAAS,
AllVaults_WIRECARD:
return true
}
return false
}
const (
AllVaults_ADYEN AllVaults = "adyen"
AllVaults_AUTHORIZENET AllVaults = "authorizenet"
AllVaults_BEANSTREAM AllVaults = "beanstream"
AllVaults_BLUESNAP AllVaults = "blue_snap"
AllVaults_BOGUS AllVaults = "bogus"
AllVaults_BRAINTREE1 AllVaults = "braintree1"
AllVaults_BRAINTREEBLUE AllVaults = "braintree_blue"
AllVaults_CHECKOUT AllVaults = "checkout"
AllVaults_CYBERSOURCE AllVaults = "cybersource"
AllVaults_ELAVON AllVaults = "elavon"
AllVaults_EWAY AllVaults = "eway"
AllVaults_EWAYRAPID AllVaults = "eway_rapid"
AllVaults_EWAYRAPIDSTD AllVaults = "eway_rapid_std"
AllVaults_FIRSTDATA AllVaults = "firstdata"
AllVaults_FORTE AllVaults = "forte"
AllVaults_GOCARDLESS AllVaults = "gocardless"
AllVaults_LITLE AllVaults = "litle"
AllVaults_MAXIOPAYMENTS AllVaults = "maxio_payments"
AllVaults_MAXP AllVaults = "maxp"
AllVaults_MODUSLINK AllVaults = "moduslink"
AllVaults_MONERIS AllVaults = "moneris"
AllVaults_NMI AllVaults = "nmi"
AllVaults_ORBITAL AllVaults = "orbital"
AllVaults_PAYMENTEXPRESS AllVaults = "payment_express"
AllVaults_PAYMILL AllVaults = "paymill"
AllVaults_PAYPAL AllVaults = "paypal"
AllVaults_PAYPALCOMPLETE AllVaults = "paypal_complete"
AllVaults_PIN AllVaults = "pin"
AllVaults_SQUARE AllVaults = "square"
AllVaults_STRIPE AllVaults = "stripe"
AllVaults_STRIPECONNECT AllVaults = "stripe_connect"
AllVaults_TRUSTCOMMERCE AllVaults = "trust_commerce"
AllVaults_UNIPAAS AllVaults = "unipaas"
AllVaults_WIRECARD AllVaults = "wirecard"
)
// AllocationPreviewDirection is a string enum.
type AllocationPreviewDirection string
// MarshalJSON implements the json.Marshaler interface for AllocationPreviewDirection.
// It customizes the JSON marshaling process for AllocationPreviewDirection objects.
func (e AllocationPreviewDirection) MarshalJSON() (
[]byte,
error) {
if e.isValid() {
return []byte(fmt.Sprintf("\"%v\"", e)), nil
}
return nil, errors.New("the provided enum value is not allowed for AllocationPreviewDirection")
}
// UnmarshalJSON implements the json.Unmarshaler interface for AllocationPreviewDirection.
// It customizes the JSON unmarshaling process for AllocationPreviewDirection objects.
func (e *AllocationPreviewDirection) UnmarshalJSON(input []byte) error {
var enumValue string
err := json.Unmarshal(input, &enumValue)
if err != nil {
return err
}
*e = AllocationPreviewDirection(enumValue)
if !e.isValid() {
return errors.New("the value " + string(input) + " cannot be unmarshalled to AllocationPreviewDirection")
}
return nil
}
// Checks whether the value is actually a member of AllocationPreviewDirection.
func (e AllocationPreviewDirection) isValid() bool {
switch e {
case AllocationPreviewDirection_UPGRADE,
AllocationPreviewDirection_DOWNGRADE:
return true
}
return false
}
const (
AllocationPreviewDirection_UPGRADE AllocationPreviewDirection = "upgrade"
AllocationPreviewDirection_DOWNGRADE AllocationPreviewDirection = "downgrade"
)
// AllocationPreviewLineItemKind is a string enum.
// A handle for the line item kind for allocation preview
type AllocationPreviewLineItemKind string
// MarshalJSON implements the json.Marshaler interface for AllocationPreviewLineItemKind.
// It customizes the JSON marshaling process for AllocationPreviewLineItemKind objects.
func (e AllocationPreviewLineItemKind) MarshalJSON() (
[]byte,
error) {
if e.isValid() {
return []byte(fmt.Sprintf("\"%v\"", e)), nil
}
return nil, errors.New("the provided enum value is not allowed for AllocationPreviewLineItemKind")
}
// UnmarshalJSON implements the json.Unmarshaler interface for AllocationPreviewLineItemKind.
// It customizes the JSON unmarshaling process for AllocationPreviewLineItemKind objects.
func (e *AllocationPreviewLineItemKind) UnmarshalJSON(input []byte) error {
var enumValue string
err := json.Unmarshal(input, &enumValue)
if err != nil {
return err
}
*e = AllocationPreviewLineItemKind(enumValue)
if !e.isValid() {
return errors.New("the value " + string(input) + " cannot be unmarshalled to AllocationPreviewLineItemKind")
}
return nil
}
// Checks whether the value is actually a member of AllocationPreviewLineItemKind.
func (e AllocationPreviewLineItemKind) isValid() bool {
switch e {
case AllocationPreviewLineItemKind_QUANTITYBASEDCOMPONENT,
AllocationPreviewLineItemKind_ONOFFCOMPONENT,
AllocationPreviewLineItemKind_COUPON,
AllocationPreviewLineItemKind_TAX:
return true
}
return false
}
const (
AllocationPreviewLineItemKind_QUANTITYBASEDCOMPONENT AllocationPreviewLineItemKind = "quantity_based_component"
AllocationPreviewLineItemKind_ONOFFCOMPONENT AllocationPreviewLineItemKind = "on_off_component"
AllocationPreviewLineItemKind_COUPON AllocationPreviewLineItemKind = "coupon"
AllocationPreviewLineItemKind_TAX AllocationPreviewLineItemKind = "tax"
)
// ApplePayVault is a string enum.
// The vault that stores the payment profile with the provided vault_token.
type ApplePayVault string
// MarshalJSON implements the json.Marshaler interface for ApplePayVault.
// It customizes the JSON marshaling process for ApplePayVault objects.
func (e ApplePayVault) MarshalJSON() (
[]byte,
error) {
if e.isValid() {
return []byte(fmt.Sprintf("\"%v\"", e)), nil
}
return nil, errors.New("the provided enum value is not allowed for ApplePayVault")
}
// UnmarshalJSON implements the json.Unmarshaler interface for ApplePayVault.
// It customizes the JSON unmarshaling process for ApplePayVault objects.
func (e *ApplePayVault) UnmarshalJSON(input []byte) error {
var enumValue string
err := json.Unmarshal(input, &enumValue)
if err != nil {
return err
}
*e = ApplePayVault(enumValue)
if !e.isValid() {
return errors.New("the value " + string(input) + " cannot be unmarshalled to ApplePayVault")
}
return nil
}
// Checks whether the value is actually a member of ApplePayVault.
func (e ApplePayVault) isValid() bool {
switch e {
case ApplePayVault_BRAINTREEBLUE:
return true
}
return false
}
const (
ApplePayVault_BRAINTREEBLUE ApplePayVault = "braintree_blue"
)
// AutoInvite is a int enum.
type AutoInvite int
// MarshalJSON implements the json.Marshaler interface for AutoInvite.
// It customizes the JSON marshaling process for AutoInvite objects.
func (e AutoInvite) MarshalJSON() (
[]byte,
error) {
if e.isValid() {
return []byte(fmt.Sprintf("%v", e)), nil
}
return nil, errors.New("the provided enum value is not allowed for AutoInvite")
}
// UnmarshalJSON implements the json.Unmarshaler interface for AutoInvite.
// It customizes the JSON unmarshaling process for AutoInvite objects.
func (e *AutoInvite) UnmarshalJSON(input []byte) error {
var enumValue int
err := json.Unmarshal(input, &enumValue)
if err != nil {
return err
}
*e = AutoInvite(enumValue)
if !e.isValid() {
return errors.New("the value " + string(input) + " cannot be unmarshalled to AutoInvite")
}
return nil
}
// Checks whether the value is actually a member of AutoInvite.
func (e AutoInvite) isValid() bool {
switch e {
case AutoInvite_NO,
AutoInvite_YES:
return true
}
return false
}
const (
AutoInvite_NO AutoInvite = 0
AutoInvite_YES AutoInvite = 1
)
// BankAccountHolderType is a string enum.
// Defaults to personal
type BankAccountHolderType string
// MarshalJSON implements the json.Marshaler interface for BankAccountHolderType.
// It customizes the JSON marshaling process for BankAccountHolderType objects.
func (e BankAccountHolderType) MarshalJSON() (
[]byte,
error) {
if e.isValid() {
return []byte(fmt.Sprintf("\"%v\"", e)), nil
}
return nil, errors.New("the provided enum value is not allowed for BankAccountHolderType")
}
// UnmarshalJSON implements the json.Unmarshaler interface for BankAccountHolderType.
// It customizes the JSON unmarshaling process for BankAccountHolderType objects.
func (e *BankAccountHolderType) UnmarshalJSON(input []byte) error {
var enumValue string
err := json.Unmarshal(input, &enumValue)
if err != nil {
return err
}
*e = BankAccountHolderType(enumValue)
if !e.isValid() {
return errors.New("the value " + string(input) + " cannot be unmarshalled to BankAccountHolderType")
}
return nil
}
// Checks whether the value is actually a member of BankAccountHolderType.
func (e BankAccountHolderType) isValid() bool {
switch e {
case BankAccountHolderType_PERSONAL,
BankAccountHolderType_BUSINESS:
return true
}
return false
}
const (
BankAccountHolderType_PERSONAL BankAccountHolderType = "personal"
BankAccountHolderType_BUSINESS BankAccountHolderType = "business"
)
// BankAccountType is a string enum.
// Defaults to checking
type BankAccountType string
// MarshalJSON implements the json.Marshaler interface for BankAccountType.
// It customizes the JSON marshaling process for BankAccountType objects.
func (e BankAccountType) MarshalJSON() (
[]byte,
error) {
if e.isValid() {
return []byte(fmt.Sprintf("\"%v\"", e)), nil
}
return nil, errors.New("the provided enum value is not allowed for BankAccountType")
}
// UnmarshalJSON implements the json.Unmarshaler interface for BankAccountType.
// It customizes the JSON unmarshaling process for BankAccountType objects.
func (e *BankAccountType) UnmarshalJSON(input []byte) error {
var enumValue string
err := json.Unmarshal(input, &enumValue)
if err != nil {
return err
}
*e = BankAccountType(enumValue)
if !e.isValid() {
return errors.New("the value " + string(input) + " cannot be unmarshalled to BankAccountType")
}
return nil
}
// Checks whether the value is actually a member of BankAccountType.
func (e BankAccountType) isValid() bool {
switch e {
case BankAccountType_CHECKING,
BankAccountType_SAVINGS:
return true
}
return false
}
const (
BankAccountType_CHECKING BankAccountType = "checking"
BankAccountType_SAVINGS BankAccountType = "savings"
)
// BankAccountVault is a string enum.
// The vault that stores the payment profile with the provided vault_token. Use `bogus` for testing.
type BankAccountVault string
// MarshalJSON implements the json.Marshaler interface for BankAccountVault.
// It customizes the JSON marshaling process for BankAccountVault objects.
func (e BankAccountVault) MarshalJSON() (
[]byte,
error) {
if e.isValid() {
return []byte(fmt.Sprintf("\"%v\"", e)), nil
}
return nil, errors.New("the provided enum value is not allowed for BankAccountVault")
}
// UnmarshalJSON implements the json.Unmarshaler interface for BankAccountVault.
// It customizes the JSON unmarshaling process for BankAccountVault objects.
func (e *BankAccountVault) UnmarshalJSON(input []byte) error {
var enumValue string
err := json.Unmarshal(input, &enumValue)
if err != nil {
return err
}
*e = BankAccountVault(enumValue)
if !e.isValid() {
return errors.New("the value " + string(input) + " cannot be unmarshalled to BankAccountVault")
}
return nil
}
// Checks whether the value is actually a member of BankAccountVault.
func (e BankAccountVault) isValid() bool {
switch e {
case BankAccountVault_AUTHORIZENET,
BankAccountVault_BLUESNAP,
BankAccountVault_BOGUS,
BankAccountVault_FORTE,
BankAccountVault_GOCARDLESS,
BankAccountVault_MAXIOPAYMENTS,
BankAccountVault_MAXP,
BankAccountVault_STRIPECONNECT:
return true
}
return false
}
const (
BankAccountVault_AUTHORIZENET BankAccountVault = "authorizenet"
BankAccountVault_BLUESNAP BankAccountVault = "blue_snap"
BankAccountVault_BOGUS BankAccountVault = "bogus"
BankAccountVault_FORTE BankAccountVault = "forte"
BankAccountVault_GOCARDLESS BankAccountVault = "gocardless"
BankAccountVault_MAXIOPAYMENTS BankAccountVault = "maxio_payments"
BankAccountVault_MAXP BankAccountVault = "maxp"
BankAccountVault_STRIPECONNECT BankAccountVault = "stripe_connect"
)
// BasicDateField is a string enum.
// Allows to filter by `created_at` or `updated_at`.
type BasicDateField string
// MarshalJSON implements the json.Marshaler interface for BasicDateField.
// It customizes the JSON marshaling process for BasicDateField objects.
func (e BasicDateField) MarshalJSON() (
[]byte,
error) {
if e.isValid() {
return []byte(fmt.Sprintf("\"%v\"", e)), nil
}
return nil, errors.New("the provided enum value is not allowed for BasicDateField")
}
// UnmarshalJSON implements the json.Unmarshaler interface for BasicDateField.
// It customizes the JSON unmarshaling process for BasicDateField objects.
func (e *BasicDateField) UnmarshalJSON(input []byte) error {
var enumValue string
err := json.Unmarshal(input, &enumValue)
if err != nil {
return err
}
*e = BasicDateField(enumValue)
if !e.isValid() {
return errors.New("the value " + string(input) + " cannot be unmarshalled to BasicDateField")
}
return nil
}
// Checks whether the value is actually a member of BasicDateField.
func (e BasicDateField) isValid() bool {
switch e {
case BasicDateField_UPDATEDAT,
BasicDateField_CREATEDAT:
return true
}
return false
}
const (
BasicDateField_UPDATEDAT BasicDateField = "updated_at"
BasicDateField_CREATEDAT BasicDateField = "created_at"
)
// BillingManifestLineItemKind is a string enum.
// A handle for the billing manifest line item kind
type BillingManifestLineItemKind string
// MarshalJSON implements the json.Marshaler interface for BillingManifestLineItemKind.
// It customizes the JSON marshaling process for BillingManifestLineItemKind objects.
func (e BillingManifestLineItemKind) MarshalJSON() (
[]byte,
error) {
if e.isValid() {
return []byte(fmt.Sprintf("\"%v\"", e)), nil
}
return nil, errors.New("the provided enum value is not allowed for BillingManifestLineItemKind")
}
// UnmarshalJSON implements the json.Unmarshaler interface for BillingManifestLineItemKind.
// It customizes the JSON unmarshaling process for BillingManifestLineItemKind objects.
func (e *BillingManifestLineItemKind) UnmarshalJSON(input []byte) error {
var enumValue string
err := json.Unmarshal(input, &enumValue)
if err != nil {
return err
}
*e = BillingManifestLineItemKind(enumValue)
if !e.isValid() {
return errors.New("the value " + string(input) + " cannot be unmarshalled to BillingManifestLineItemKind")
}
return nil
}
// Checks whether the value is actually a member of BillingManifestLineItemKind.
func (e BillingManifestLineItemKind) isValid() bool {
switch e {
case BillingManifestLineItemKind_BASELINE,
BillingManifestLineItemKind_INITIAL,
BillingManifestLineItemKind_TRIAL,
BillingManifestLineItemKind_COUPON,
BillingManifestLineItemKind_COMPONENT,
BillingManifestLineItemKind_TAX:
return true
}
return false
}
const (
BillingManifestLineItemKind_BASELINE BillingManifestLineItemKind = "baseline"
BillingManifestLineItemKind_INITIAL BillingManifestLineItemKind = "initial"
BillingManifestLineItemKind_TRIAL BillingManifestLineItemKind = "trial"
BillingManifestLineItemKind_COUPON BillingManifestLineItemKind = "coupon"
BillingManifestLineItemKind_COMPONENT BillingManifestLineItemKind = "component"
BillingManifestLineItemKind_TAX BillingManifestLineItemKind = "tax"
)
// CancellationMethod is a string enum.
// The process used to cancel the subscription, if the subscription has been canceled. It is nil if the subscription's state is not canceled.
type CancellationMethod string
// MarshalJSON implements the json.Marshaler interface for CancellationMethod.
// It customizes the JSON marshaling process for CancellationMethod objects.
func (e CancellationMethod) MarshalJSON() (
[]byte,
error) {
if e.isValid() {
return []byte(fmt.Sprintf("\"%v\"", e)), nil
}
return nil, errors.New("the provided enum value is not allowed for CancellationMethod")
}
// UnmarshalJSON implements the json.Unmarshaler interface for CancellationMethod.
// It customizes the JSON unmarshaling process for CancellationMethod objects.
func (e *CancellationMethod) UnmarshalJSON(input []byte) error {
var enumValue string
err := json.Unmarshal(input, &enumValue)
if err != nil {
return err
}
*e = CancellationMethod(enumValue)
if !e.isValid() {
return errors.New("the value " + string(input) + " cannot be unmarshalled to CancellationMethod")
}
return nil
}
// Checks whether the value is actually a member of CancellationMethod.
func (e CancellationMethod) isValid() bool {
switch e {
case CancellationMethod_MERCHANTUI,
CancellationMethod_MERCHANTAPI,
CancellationMethod_DUNNING,
CancellationMethod_BILLINGPORTAL,
CancellationMethod_UNKNOWN,
CancellationMethod_IMPORTED:
return true
}
return false
}
const (
CancellationMethod_MERCHANTUI CancellationMethod = "merchant_ui"
CancellationMethod_MERCHANTAPI CancellationMethod = "merchant_api"
CancellationMethod_DUNNING CancellationMethod = "dunning"
CancellationMethod_BILLINGPORTAL CancellationMethod = "billing_portal"
CancellationMethod_UNKNOWN CancellationMethod = "unknown"
CancellationMethod_IMPORTED CancellationMethod = "imported"
)
// CardType is a string enum.
// The type of card used.
type CardType string
// MarshalJSON implements the json.Marshaler interface for CardType.
// It customizes the JSON marshaling process for CardType objects.
func (e CardType) MarshalJSON() (
[]byte,
error) {
if e.isValid() {
return []byte(fmt.Sprintf("\"%v\"", e)), nil
}
return nil, errors.New("the provided enum value is not allowed for CardType")
}
// UnmarshalJSON implements the json.Unmarshaler interface for CardType.
// It customizes the JSON unmarshaling process for CardType objects.
func (e *CardType) UnmarshalJSON(input []byte) error {
var enumValue string
err := json.Unmarshal(input, &enumValue)
if err != nil {
return err
}
*e = CardType(enumValue)
if !e.isValid() {
return errors.New("the value " + string(input) + " cannot be unmarshalled to CardType")
}
return nil
}
// Checks whether the value is actually a member of CardType.
func (e CardType) isValid() bool {
switch e {
case CardType_VISA,
CardType_MASTER,
CardType_ELO,
CardType_CABAL,
CardType_ALELO,
CardType_DISCOVER,
CardType_AMERICANEXPRESS,
CardType_NARANJA,
CardType_DINERSCLUB,
CardType_JCB,
CardType_DANKORT,
CardType_MAESTRO,
CardType_MAESTRONOLUHN,
CardType_FORBRUGSFORENINGEN,
CardType_SODEXO,
CardType_ALIA,
CardType_VR,
CardType_UNIONPAY,
CardType_CARNET,
CardType_CARTESBANCAIRES,
CardType_OLIMPICA,
CardType_CREDITEL,
CardType_CONFIABLE,
CardType_SYNCHRONY,
CardType_ROUTEX,
CardType_MADA,
CardType_BPPLUS,
CardType_PASSCARD,
CardType_EDENRED,
CardType_ANDA,
CardType_TARJETAD,
CardType_HIPERCARD,
CardType_BOGUS,
CardType_ENUMSWITCH,
CardType_SOLO,
CardType_LASER:
return true
}
return false
}
const (
CardType_VISA CardType = "visa"
CardType_MASTER CardType = "master"
CardType_ELO CardType = "elo"
CardType_CABAL CardType = "cabal"
CardType_ALELO CardType = "alelo"
CardType_DISCOVER CardType = "discover"
CardType_AMERICANEXPRESS CardType = "american_express"
CardType_NARANJA CardType = "naranja"
CardType_DINERSCLUB CardType = "diners_club"
CardType_JCB CardType = "jcb"
CardType_DANKORT CardType = "dankort"
CardType_MAESTRO CardType = "maestro"
CardType_MAESTRONOLUHN CardType = "maestro_no_luhn"
CardType_FORBRUGSFORENINGEN CardType = "forbrugsforeningen"
CardType_SODEXO CardType = "sodexo"
CardType_ALIA CardType = "alia"
CardType_VR CardType = "vr"
CardType_UNIONPAY CardType = "unionpay"
CardType_CARNET CardType = "carnet"
CardType_CARTESBANCAIRES CardType = "cartes_bancaires"
CardType_OLIMPICA CardType = "olimpica"
CardType_CREDITEL CardType = "creditel"
CardType_CONFIABLE CardType = "confiable"
CardType_SYNCHRONY CardType = "synchrony"
CardType_ROUTEX CardType = "routex"
CardType_MADA CardType = "mada"
CardType_BPPLUS CardType = "bp_plus"
CardType_PASSCARD CardType = "passcard"
CardType_EDENRED CardType = "edenred"
CardType_ANDA CardType = "anda"
CardType_TARJETAD CardType = "tarjeta-d"
CardType_HIPERCARD CardType = "hipercard"
CardType_BOGUS CardType = "bogus"
CardType_ENUMSWITCH CardType = "switch"
CardType_SOLO CardType = "solo"
CardType_LASER CardType = "laser"
)
// ChargebackStatus is a string enum.
// The current chargeback status.
type ChargebackStatus string
// MarshalJSON implements the json.Marshaler interface for ChargebackStatus.
// It customizes the JSON marshaling process for ChargebackStatus objects.
func (e ChargebackStatus) MarshalJSON() (
[]byte,
error) {
if e.isValid() {
return []byte(fmt.Sprintf("\"%v\"", e)), nil
}
return nil, errors.New("the provided enum value is not allowed for ChargebackStatus")
}
// UnmarshalJSON implements the json.Unmarshaler interface for ChargebackStatus.
// It customizes the JSON unmarshaling process for ChargebackStatus objects.
func (e *ChargebackStatus) UnmarshalJSON(input []byte) error {
var enumValue string
err := json.Unmarshal(input, &enumValue)
if err != nil {
return err
}
*e = ChargebackStatus(enumValue)
if !e.isValid() {
return errors.New("the value " + string(input) + " cannot be unmarshalled to ChargebackStatus")
}
return nil
}
// Checks whether the value is actually a member of ChargebackStatus.
func (e ChargebackStatus) isValid() bool {
switch e {
case ChargebackStatus_OPEN,
ChargebackStatus_LOST,
ChargebackStatus_WON,
ChargebackStatus_CLOSED:
return true
}
return false
}
const (
ChargebackStatus_OPEN ChargebackStatus = "open"
ChargebackStatus_LOST ChargebackStatus = "lost"
ChargebackStatus_WON ChargebackStatus = "won"
ChargebackStatus_CLOSED ChargebackStatus = "closed"
)
// CleanupScope is a string enum.
// all: Will clear all products, customers, and related subscriptions from the site. customers: Will clear only customers and related subscriptions (leaving the products untouched) for the site. Revenue will also be reset to 0.
type CleanupScope string
// MarshalJSON implements the json.Marshaler interface for CleanupScope.
// It customizes the JSON marshaling process for CleanupScope objects.
func (e CleanupScope) MarshalJSON() (
[]byte,
error) {
if e.isValid() {
return []byte(fmt.Sprintf("\"%v\"", e)), nil
}
return nil, errors.New("the provided enum value is not allowed for CleanupScope")
}
// UnmarshalJSON implements the json.Unmarshaler interface for CleanupScope.
// It customizes the JSON unmarshaling process for CleanupScope objects.
func (e *CleanupScope) UnmarshalJSON(input []byte) error {
var enumValue string
err := json.Unmarshal(input, &enumValue)
if err != nil {
return err
}
*e = CleanupScope(enumValue)
if !e.isValid() {
return errors.New("the value " + string(input) + " cannot be unmarshalled to CleanupScope")
}
return nil
}
// Checks whether the value is actually a member of CleanupScope.
func (e CleanupScope) isValid() bool {
switch e {
case CleanupScope_ALL,
CleanupScope_CUSTOMERS:
return true
}
return false
}
const (
CleanupScope_ALL CleanupScope = "all"
CleanupScope_CUSTOMERS CleanupScope = "customers"
)
// CollectionMethod is a string enum.
// The type of payment collection to be used in the subscription. For legacy Statements Architecture valid options are - `invoice`, `automatic`. For current Relationship Invoicing Architecture valid options are - `remittance`, `automatic`, `prepaid`.
type CollectionMethod string
// MarshalJSON implements the json.Marshaler interface for CollectionMethod.
// It customizes the JSON marshaling process for CollectionMethod objects.
func (e CollectionMethod) MarshalJSON() (
[]byte,
error) {
if e.isValid() {
return []byte(fmt.Sprintf("\"%v\"", e)), nil
}
return nil, errors.New("the provided enum value is not allowed for CollectionMethod")
}
// UnmarshalJSON implements the json.Unmarshaler interface for CollectionMethod.
// It customizes the JSON unmarshaling process for CollectionMethod objects.
func (e *CollectionMethod) UnmarshalJSON(input []byte) error {
var enumValue string
err := json.Unmarshal(input, &enumValue)
if err != nil {
return err
}
*e = CollectionMethod(enumValue)
if !e.isValid() {
return errors.New("the value " + string(input) + " cannot be unmarshalled to CollectionMethod")
}
return nil
}
// Checks whether the value is actually a member of CollectionMethod.
func (e CollectionMethod) isValid() bool {
switch e {
case CollectionMethod_AUTOMATIC,
CollectionMethod_REMITTANCE,
CollectionMethod_PREPAID,
CollectionMethod_INVOICE:
return true
}
return false
}
const (
CollectionMethod_AUTOMATIC CollectionMethod = "automatic"
CollectionMethod_REMITTANCE CollectionMethod = "remittance"
CollectionMethod_PREPAID CollectionMethod = "prepaid"
CollectionMethod_INVOICE CollectionMethod = "invoice"
)
// ComponentKind is a string enum.
// A handle for the component type
type ComponentKind string
// MarshalJSON implements the json.Marshaler interface for ComponentKind.
// It customizes the JSON marshaling process for ComponentKind objects.
func (e ComponentKind) MarshalJSON() (
[]byte,
error) {
if e.isValid() {
return []byte(fmt.Sprintf("\"%v\"", e)), nil
}
return nil, errors.New("the provided enum value is not allowed for ComponentKind")
}
// UnmarshalJSON implements the json.Unmarshaler interface for ComponentKind.
// It customizes the JSON unmarshaling process for ComponentKind objects.
func (e *ComponentKind) UnmarshalJSON(input []byte) error {
var enumValue string
err := json.Unmarshal(input, &enumValue)
if err != nil {
return err
}
*e = ComponentKind(enumValue)
if !e.isValid() {
return errors.New("the value " + string(input) + " cannot be unmarshalled to ComponentKind")
}
return nil
}
// Checks whether the value is actually a member of ComponentKind.
func (e ComponentKind) isValid() bool {
switch e {
case ComponentKind_METEREDCOMPONENT,
ComponentKind_QUANTITYBASEDCOMPONENT,
ComponentKind_ONOFFCOMPONENT,
ComponentKind_PREPAIDUSAGECOMPONENT,
ComponentKind_EVENTBASEDCOMPONENT:
return true
}
return false
}
const (
ComponentKind_METEREDCOMPONENT ComponentKind = "metered_component"
ComponentKind_QUANTITYBASEDCOMPONENT ComponentKind = "quantity_based_component"
ComponentKind_ONOFFCOMPONENT ComponentKind = "on_off_component"
ComponentKind_PREPAIDUSAGECOMPONENT ComponentKind = "prepaid_usage_component"
ComponentKind_EVENTBASEDCOMPONENT ComponentKind = "event_based_component"
)
// CompoundingStrategy is a string enum.
type CompoundingStrategy string
// MarshalJSON implements the json.Marshaler interface for CompoundingStrategy.
// It customizes the JSON marshaling process for CompoundingStrategy objects.
func (e CompoundingStrategy) MarshalJSON() (
[]byte,
error) {
if e.isValid() {
return []byte(fmt.Sprintf("\"%v\"", e)), nil
}
return nil, errors.New("the provided enum value is not allowed for CompoundingStrategy")
}
// UnmarshalJSON implements the json.Unmarshaler interface for CompoundingStrategy.
// It customizes the JSON unmarshaling process for CompoundingStrategy objects.
func (e *CompoundingStrategy) UnmarshalJSON(input []byte) error {
var enumValue string
err := json.Unmarshal(input, &enumValue)
if err != nil {
return err
}
*e = CompoundingStrategy(enumValue)
if !e.isValid() {
return errors.New("the value " + string(input) + " cannot be unmarshalled to CompoundingStrategy")
}
return nil
}
// Checks whether the value is actually a member of CompoundingStrategy.
func (e CompoundingStrategy) isValid() bool {
switch e {
case CompoundingStrategy_COMPOUND,
CompoundingStrategy_FULLPRICE:
return true
}
return false
}
const (
CompoundingStrategy_COMPOUND CompoundingStrategy = "compound"
CompoundingStrategy_FULLPRICE CompoundingStrategy = "full-price"
)
// CreateInvoiceStatus is a string enum.
type CreateInvoiceStatus string
// MarshalJSON implements the json.Marshaler interface for CreateInvoiceStatus.
// It customizes the JSON marshaling process for CreateInvoiceStatus objects.
func (e CreateInvoiceStatus) MarshalJSON() (
[]byte,
error) {
if e.isValid() {
return []byte(fmt.Sprintf("\"%v\"", e)), nil
}
return nil, errors.New("the provided enum value is not allowed for CreateInvoiceStatus")
}
// UnmarshalJSON implements the json.Unmarshaler interface for CreateInvoiceStatus.
// It customizes the JSON unmarshaling process for CreateInvoiceStatus objects.
func (e *CreateInvoiceStatus) UnmarshalJSON(input []byte) error {
var enumValue string
err := json.Unmarshal(input, &enumValue)
if err != nil {
return err
}
*e = CreateInvoiceStatus(enumValue)
if !e.isValid() {
return errors.New("the value " + string(input) + " cannot be unmarshalled to CreateInvoiceStatus")
}
return nil
}
// Checks whether the value is actually a member of CreateInvoiceStatus.
func (e CreateInvoiceStatus) isValid() bool {
switch e {
case CreateInvoiceStatus_DRAFT,
CreateInvoiceStatus_OPEN:
return true
}
return false
}
const (
CreateInvoiceStatus_DRAFT CreateInvoiceStatus = "draft"
CreateInvoiceStatus_OPEN CreateInvoiceStatus = "open"
)
// CreatePrepaymentMethod is a string enum.
// :- When the `method` specified is `"credit_card_on_file"`, the prepayment amount will be collected using the default credit card payment profile and applied to the prepayment account balance. This is especially useful for manual replenishment of prepaid subscriptions.
type CreatePrepaymentMethod string
// MarshalJSON implements the json.Marshaler interface for CreatePrepaymentMethod.