-
Notifications
You must be signed in to change notification settings - Fork 2
/
enum_feetype.go
96 lines (80 loc) · 2 KB
/
enum_feetype.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
// Code generated by "enumerator -type FeeType"; DO NOT EDIT.
package pay
import (
"fmt"
"strconv"
)
func _() {
// An "invalid array index" compiler error signifies that the constant values have changed.
// Re-run the stringer command to generate them again.
var x [1]struct{}
_ = x[FullFee-0]
_ = x[HalfFee-1]
_ = x[NoFee-2]
_ = x[HardshipFee-3]
_ = x[RepeatApplicationFee-4]
}
const _FeeType_name = "FullFeeHalfFeeNoFeeHardshipFeeRepeatApplicationFee"
var _FeeType_index = [...]uint8{0, 7, 14, 19, 30, 50}
func (i FeeType) String() string {
if i >= FeeType(len(_FeeType_index)-1) {
return "FeeType(" + strconv.FormatInt(int64(i), 10) + ")"
}
return _FeeType_name[_FeeType_index[i]:_FeeType_index[i+1]]
}
func (i FeeType) MarshalText() ([]byte, error) {
return []byte(i.String()), nil
}
func (i *FeeType) UnmarshalText(text []byte) error {
val, err := ParseFeeType(string(text))
if err != nil {
return err
}
*i = val
return nil
}
func (i FeeType) IsFullFee() bool {
return i == FullFee
}
func (i FeeType) IsHalfFee() bool {
return i == HalfFee
}
func (i FeeType) IsNoFee() bool {
return i == NoFee
}
func (i FeeType) IsHardshipFee() bool {
return i == HardshipFee
}
func (i FeeType) IsRepeatApplicationFee() bool {
return i == RepeatApplicationFee
}
func ParseFeeType(s string) (FeeType, error) {
switch s {
case "FullFee":
return FullFee, nil
case "HalfFee":
return HalfFee, nil
case "NoFee":
return NoFee, nil
case "HardshipFee":
return HardshipFee, nil
case "RepeatApplicationFee":
return RepeatApplicationFee, nil
default:
return FeeType(0), fmt.Errorf("invalid FeeType '%s'", s)
}
}
type FeeTypeOptions struct {
FullFee FeeType
HalfFee FeeType
NoFee FeeType
HardshipFee FeeType
RepeatApplicationFee FeeType
}
var FeeTypeValues = FeeTypeOptions{
FullFee: FullFee,
HalfFee: HalfFee,
NoFee: NoFee,
HardshipFee: HardshipFee,
RepeatApplicationFee: RepeatApplicationFee,
}