-
Notifications
You must be signed in to change notification settings - Fork 36
/
sharing_domain_restriction_mode.go
39 lines (37 loc) · 1.24 KB
/
sharing_domain_restriction_mode.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
package models
type SharingDomainRestrictionMode int
const (
NONE_SHARINGDOMAINRESTRICTIONMODE SharingDomainRestrictionMode = iota
ALLOWLIST_SHARINGDOMAINRESTRICTIONMODE
BLOCKLIST_SHARINGDOMAINRESTRICTIONMODE
UNKNOWNFUTUREVALUE_SHARINGDOMAINRESTRICTIONMODE
)
func (i SharingDomainRestrictionMode) String() string {
return []string{"none", "allowList", "blockList", "unknownFutureValue"}[i]
}
func ParseSharingDomainRestrictionMode(v string) (any, error) {
result := NONE_SHARINGDOMAINRESTRICTIONMODE
switch v {
case "none":
result = NONE_SHARINGDOMAINRESTRICTIONMODE
case "allowList":
result = ALLOWLIST_SHARINGDOMAINRESTRICTIONMODE
case "blockList":
result = BLOCKLIST_SHARINGDOMAINRESTRICTIONMODE
case "unknownFutureValue":
result = UNKNOWNFUTUREVALUE_SHARINGDOMAINRESTRICTIONMODE
default:
return nil, nil
}
return &result, nil
}
func SerializeSharingDomainRestrictionMode(values []SharingDomainRestrictionMode) []string {
result := make([]string, len(values))
for i, v := range values {
result[i] = v.String()
}
return result
}
func (i SharingDomainRestrictionMode) isMultiValue() bool {
return false
}