-
Notifications
You must be signed in to change notification settings - Fork 2
/
enum_novoucherdecision.go
95 lines (79 loc) · 2.23 KB
/
enum_novoucherdecision.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
// Code generated by "enumerator -type NoVoucherDecision -linecomment -empty"; DO NOT EDIT.
package actor
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[ProveOwnID-1]
_ = x[SelectNewVoucher-2]
_ = x[WithdrawLPA-3]
_ = x[ApplyToCOP-4]
}
const _NoVoucherDecision_name = "prove-own-idselect-new-voucherwithdraw-lpaapply-to-cop"
var _NoVoucherDecision_index = [...]uint8{0, 12, 30, 42, 54}
func (i NoVoucherDecision) String() string {
if i == 0 {
return ""
}
i -= 1
if i >= NoVoucherDecision(len(_NoVoucherDecision_index)-1) {
return "NoVoucherDecision(" + strconv.FormatInt(int64(i+1), 10) + ")"
}
return _NoVoucherDecision_name[_NoVoucherDecision_index[i]:_NoVoucherDecision_index[i+1]]
}
func (i NoVoucherDecision) MarshalText() ([]byte, error) {
return []byte(i.String()), nil
}
func (i *NoVoucherDecision) UnmarshalText(text []byte) error {
val, err := ParseNoVoucherDecision(string(text))
if err != nil {
return err
}
*i = val
return nil
}
func (i NoVoucherDecision) IsProveOwnID() bool {
return i == ProveOwnID
}
func (i NoVoucherDecision) IsSelectNewVoucher() bool {
return i == SelectNewVoucher
}
func (i NoVoucherDecision) IsWithdrawLPA() bool {
return i == WithdrawLPA
}
func (i NoVoucherDecision) IsApplyToCOP() bool {
return i == ApplyToCOP
}
func ParseNoVoucherDecision(s string) (NoVoucherDecision, error) {
switch s {
case "prove-own-id":
return ProveOwnID, nil
case "select-new-voucher":
return SelectNewVoucher, nil
case "withdraw-lpa":
return WithdrawLPA, nil
case "apply-to-cop":
return ApplyToCOP, nil
default:
return NoVoucherDecision(0), fmt.Errorf("invalid NoVoucherDecision '%s'", s)
}
}
type NoVoucherDecisionOptions struct {
ProveOwnID NoVoucherDecision
SelectNewVoucher NoVoucherDecision
WithdrawLPA NoVoucherDecision
ApplyToCOP NoVoucherDecision
}
var NoVoucherDecisionValues = NoVoucherDecisionOptions{
ProveOwnID: ProveOwnID,
SelectNewVoucher: SelectNewVoucher,
WithdrawLPA: WithdrawLPA,
ApplyToCOP: ApplyToCOP,
}
func (i NoVoucherDecision) Empty() bool {
return i == NoVoucherDecision(0)
}