-
Notifications
You must be signed in to change notification settings - Fork 2
/
enum_certificateproviderrelationshiplength.go
78 lines (64 loc) · 2.58 KB
/
enum_certificateproviderrelationshiplength.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
// Code generated by "enumerator -type CertificateProviderRelationshipLength -linecomment"; 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[RelationshipLengthUnknown-0]
_ = x[LessThanTwoYears-1]
_ = x[GreaterThanEqualToTwoYears-2]
}
const _CertificateProviderRelationshipLength_name = "unknownlt-2-yearsgte-2-years"
var _CertificateProviderRelationshipLength_index = [...]uint8{0, 7, 17, 28}
func (i CertificateProviderRelationshipLength) String() string {
if i >= CertificateProviderRelationshipLength(len(_CertificateProviderRelationshipLength_index)-1) {
return "CertificateProviderRelationshipLength(" + strconv.FormatInt(int64(i), 10) + ")"
}
return _CertificateProviderRelationshipLength_name[_CertificateProviderRelationshipLength_index[i]:_CertificateProviderRelationshipLength_index[i+1]]
}
func (i CertificateProviderRelationshipLength) MarshalText() ([]byte, error) {
return []byte(i.String()), nil
}
func (i *CertificateProviderRelationshipLength) UnmarshalText(text []byte) error {
val, err := ParseCertificateProviderRelationshipLength(string(text))
if err != nil {
return err
}
*i = val
return nil
}
func (i CertificateProviderRelationshipLength) IsRelationshipLengthUnknown() bool {
return i == RelationshipLengthUnknown
}
func (i CertificateProviderRelationshipLength) IsLessThanTwoYears() bool {
return i == LessThanTwoYears
}
func (i CertificateProviderRelationshipLength) IsGreaterThanEqualToTwoYears() bool {
return i == GreaterThanEqualToTwoYears
}
func ParseCertificateProviderRelationshipLength(s string) (CertificateProviderRelationshipLength, error) {
switch s {
case "unknown":
return RelationshipLengthUnknown, nil
case "lt-2-years":
return LessThanTwoYears, nil
case "gte-2-years":
return GreaterThanEqualToTwoYears, nil
default:
return CertificateProviderRelationshipLength(0), fmt.Errorf("invalid CertificateProviderRelationshipLength '%s'", s)
}
}
type CertificateProviderRelationshipLengthOptions struct {
RelationshipLengthUnknown CertificateProviderRelationshipLength
LessThanTwoYears CertificateProviderRelationshipLength
GreaterThanEqualToTwoYears CertificateProviderRelationshipLength
}
var CertificateProviderRelationshipLengthValues = CertificateProviderRelationshipLengthOptions{
RelationshipLengthUnknown: RelationshipLengthUnknown,
LessThanTwoYears: LessThanTwoYears,
GreaterThanEqualToTwoYears: GreaterThanEqualToTwoYears,
}