-
Notifications
You must be signed in to change notification settings - Fork 0
/
teamwork_conversation_identity_type.go
43 lines (41 loc) · 1.36 KB
/
teamwork_conversation_identity_type.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
package models
import (
"errors"
)
//
type TeamworkConversationIdentityType int
const (
TEAM_TEAMWORKCONVERSATIONIDENTITYTYPE TeamworkConversationIdentityType = iota
CHANNEL_TEAMWORKCONVERSATIONIDENTITYTYPE
CHAT_TEAMWORKCONVERSATIONIDENTITYTYPE
UNKNOWNFUTUREVALUE_TEAMWORKCONVERSATIONIDENTITYTYPE
)
func (i TeamworkConversationIdentityType) String() string {
return []string{"team", "channel", "chat", "unknownFutureValue"}[i]
}
func ParseTeamworkConversationIdentityType(v string) (any, error) {
result := TEAM_TEAMWORKCONVERSATIONIDENTITYTYPE
switch v {
case "team":
result = TEAM_TEAMWORKCONVERSATIONIDENTITYTYPE
case "channel":
result = CHANNEL_TEAMWORKCONVERSATIONIDENTITYTYPE
case "chat":
result = CHAT_TEAMWORKCONVERSATIONIDENTITYTYPE
case "unknownFutureValue":
result = UNKNOWNFUTUREVALUE_TEAMWORKCONVERSATIONIDENTITYTYPE
default:
return 0, errors.New("Unknown TeamworkConversationIdentityType value: " + v)
}
return &result, nil
}
func SerializeTeamworkConversationIdentityType(values []TeamworkConversationIdentityType) []string {
result := make([]string, len(values))
for i, v := range values {
result[i] = v.String()
}
return result
}
func (i TeamworkConversationIdentityType) isMultiValue() bool {
return false
}