-
Notifications
You must be signed in to change notification settings - Fork 2
/
enum_certificateproviderrelationship.go
77 lines (63 loc) · 2.11 KB
/
enum_certificateproviderrelationship.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
// Code generated by "enumerator -type CertificateProviderRelationship -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[Personally-1]
_ = x[Professionally-2]
}
const _CertificateProviderRelationship_name = "personallyprofessionally"
var _CertificateProviderRelationship_index = [...]uint8{0, 10, 24}
func (i CertificateProviderRelationship) String() string {
if i == 0 {
return ""
}
i -= 1
if i >= CertificateProviderRelationship(len(_CertificateProviderRelationship_index)-1) {
return "CertificateProviderRelationship(" + strconv.FormatInt(int64(i+1), 10) + ")"
}
return _CertificateProviderRelationship_name[_CertificateProviderRelationship_index[i]:_CertificateProviderRelationship_index[i+1]]
}
func (i CertificateProviderRelationship) MarshalText() ([]byte, error) {
return []byte(i.String()), nil
}
func (i *CertificateProviderRelationship) UnmarshalText(text []byte) error {
val, err := ParseCertificateProviderRelationship(string(text))
if err != nil {
return err
}
*i = val
return nil
}
func (i CertificateProviderRelationship) IsPersonally() bool {
return i == Personally
}
func (i CertificateProviderRelationship) IsProfessionally() bool {
return i == Professionally
}
func ParseCertificateProviderRelationship(s string) (CertificateProviderRelationship, error) {
switch s {
case "personally":
return Personally, nil
case "professionally":
return Professionally, nil
default:
return CertificateProviderRelationship(0), fmt.Errorf("invalid CertificateProviderRelationship '%s'", s)
}
}
type CertificateProviderRelationshipOptions struct {
Personally CertificateProviderRelationship
Professionally CertificateProviderRelationship
}
var CertificateProviderRelationshipValues = CertificateProviderRelationshipOptions{
Personally: Personally,
Professionally: Professionally,
}
func (i CertificateProviderRelationship) Empty() bool {
return i == CertificateProviderRelationship(0)
}