-
Notifications
You must be signed in to change notification settings - Fork 0
/
reference_enum.go
91 lines (83 loc) · 3.13 KB
/
reference_enum.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
// Code generated by go-enum DO NOT EDIT.
// Version:
// Revision:
// Build Date:
// Built By:
package malak
import (
"errors"
"fmt"
)
const (
// EntityTypeWorkspace is a EntityType of type workspace.
EntityTypeWorkspace EntityType = "workspace"
// EntityTypeInvoice is a EntityType of type invoice.
EntityTypeInvoice EntityType = "invoice"
// EntityTypeTeam is a EntityType of type team.
EntityTypeTeam EntityType = "team"
// EntityTypeInvite is a EntityType of type invite.
EntityTypeInvite EntityType = "invite"
// EntityTypeContact is a EntityType of type contact.
EntityTypeContact EntityType = "contact"
// EntityTypeUpdate is a EntityType of type update.
EntityTypeUpdate EntityType = "update"
// EntityTypeLink is a EntityType of type link.
EntityTypeLink EntityType = "link"
// EntityTypeRoom is a EntityType of type room.
EntityTypeRoom EntityType = "room"
// EntityTypeRecipient is a EntityType of type recipient.
EntityTypeRecipient EntityType = "recipient"
// EntityTypeSchedule is a EntityType of type schedule.
EntityTypeSchedule EntityType = "schedule"
// EntityTypeList is a EntityType of type list.
EntityTypeList EntityType = "list"
// EntityTypeListEmail is a EntityType of type list_email.
EntityTypeListEmail EntityType = "list_email"
// EntityTypeUpdateStat is a EntityType of type update_stat.
EntityTypeUpdateStat EntityType = "update_stat"
// EntityTypeRecipientStat is a EntityType of type recipient_stat.
EntityTypeRecipientStat EntityType = "recipient_stat"
// EntityTypeRecipientLog is a EntityType of type recipient_log.
EntityTypeRecipientLog EntityType = "recipient_log"
// EntityTypeDeck is a EntityType of type deck.
EntityTypeDeck EntityType = "deck"
// EntityTypeDeckPreference is a EntityType of type deck_preference.
EntityTypeDeckPreference EntityType = "deck_preference"
)
var ErrInvalidEntityType = errors.New("not a valid EntityType")
// String implements the Stringer interface.
func (x EntityType) String() string {
return string(x)
}
// IsValid provides a quick way to determine if the typed value is
// part of the allowed enumerated values
func (x EntityType) IsValid() bool {
_, err := ParseEntityType(string(x))
return err == nil
}
var _EntityTypeValue = map[string]EntityType{
"workspace": EntityTypeWorkspace,
"invoice": EntityTypeInvoice,
"team": EntityTypeTeam,
"invite": EntityTypeInvite,
"contact": EntityTypeContact,
"update": EntityTypeUpdate,
"link": EntityTypeLink,
"room": EntityTypeRoom,
"recipient": EntityTypeRecipient,
"schedule": EntityTypeSchedule,
"list": EntityTypeList,
"list_email": EntityTypeListEmail,
"update_stat": EntityTypeUpdateStat,
"recipient_stat": EntityTypeRecipientStat,
"recipient_log": EntityTypeRecipientLog,
"deck": EntityTypeDeck,
"deck_preference": EntityTypeDeckPreference,
}
// ParseEntityType attempts to convert a string to a EntityType.
func ParseEntityType(name string) (EntityType, error) {
if x, ok := _EntityTypeValue[name]; ok {
return x, nil
}
return EntityType(""), fmt.Errorf("%s is %w", name, ErrInvalidEntityType)
}