-
Notifications
You must be signed in to change notification settings - Fork 0
/
update_enum.go
268 lines (224 loc) · 8.61 KB
/
update_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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
// Code generated by go-enum DO NOT EDIT.
// Version:
// Revision:
// Build Date:
// Built By:
package malak
import (
"errors"
"fmt"
)
const (
// ListUpdateFilterStatusDraft is a ListUpdateFilterStatus of type draft.
ListUpdateFilterStatusDraft ListUpdateFilterStatus = "draft"
// ListUpdateFilterStatusSent is a ListUpdateFilterStatus of type sent.
ListUpdateFilterStatusSent ListUpdateFilterStatus = "sent"
// ListUpdateFilterStatusAll is a ListUpdateFilterStatus of type all.
ListUpdateFilterStatusAll ListUpdateFilterStatus = "all"
)
var ErrInvalidListUpdateFilterStatus = errors.New("not a valid ListUpdateFilterStatus")
// String implements the Stringer interface.
func (x ListUpdateFilterStatus) 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 ListUpdateFilterStatus) IsValid() bool {
_, err := ParseListUpdateFilterStatus(string(x))
return err == nil
}
var _ListUpdateFilterStatusValue = map[string]ListUpdateFilterStatus{
"draft": ListUpdateFilterStatusDraft,
"sent": ListUpdateFilterStatusSent,
"all": ListUpdateFilterStatusAll,
}
// ParseListUpdateFilterStatus attempts to convert a string to a ListUpdateFilterStatus.
func ParseListUpdateFilterStatus(name string) (ListUpdateFilterStatus, error) {
if x, ok := _ListUpdateFilterStatusValue[name]; ok {
return x, nil
}
return ListUpdateFilterStatus(""), fmt.Errorf("%s is %w", name, ErrInvalidListUpdateFilterStatus)
}
const (
// RecipientStatusPending is a RecipientStatus of type pending.
RecipientStatusPending RecipientStatus = "pending"
// RecipientStatusSent is a RecipientStatus of type sent.
RecipientStatusSent RecipientStatus = "sent"
// RecipientStatusFailed is a RecipientStatus of type failed.
RecipientStatusFailed RecipientStatus = "failed"
)
var ErrInvalidRecipientStatus = errors.New("not a valid RecipientStatus")
// String implements the Stringer interface.
func (x RecipientStatus) 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 RecipientStatus) IsValid() bool {
_, err := ParseRecipientStatus(string(x))
return err == nil
}
var _RecipientStatusValue = map[string]RecipientStatus{
"pending": RecipientStatusPending,
"sent": RecipientStatusSent,
"failed": RecipientStatusFailed,
}
// ParseRecipientStatus attempts to convert a string to a RecipientStatus.
func ParseRecipientStatus(name string) (RecipientStatus, error) {
if x, ok := _RecipientStatusValue[name]; ok {
return x, nil
}
return RecipientStatus(""), fmt.Errorf("%s is %w", name, ErrInvalidRecipientStatus)
}
const (
// RecipientTypeList is a RecipientType of type list.
RecipientTypeList RecipientType = "list"
// RecipientTypeEmail is a RecipientType of type email.
RecipientTypeEmail RecipientType = "email"
)
var ErrInvalidRecipientType = errors.New("not a valid RecipientType")
// String implements the Stringer interface.
func (x RecipientType) 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 RecipientType) IsValid() bool {
_, err := ParseRecipientType(string(x))
return err == nil
}
var _RecipientTypeValue = map[string]RecipientType{
"list": RecipientTypeList,
"email": RecipientTypeEmail,
}
// ParseRecipientType attempts to convert a string to a RecipientType.
func ParseRecipientType(name string) (RecipientType, error) {
if x, ok := _RecipientTypeValue[name]; ok {
return x, nil
}
return RecipientType(""), fmt.Errorf("%s is %w", name, ErrInvalidRecipientType)
}
const (
// UpdateRecipientLogProviderResend is a UpdateRecipientLogProvider of type resend.
UpdateRecipientLogProviderResend UpdateRecipientLogProvider = "resend"
// UpdateRecipientLogProviderSendgrid is a UpdateRecipientLogProvider of type sendgrid.
UpdateRecipientLogProviderSendgrid UpdateRecipientLogProvider = "sendgrid"
// UpdateRecipientLogProviderSmtp is a UpdateRecipientLogProvider of type smtp.
UpdateRecipientLogProviderSmtp UpdateRecipientLogProvider = "smtp"
)
var ErrInvalidUpdateRecipientLogProvider = errors.New("not a valid UpdateRecipientLogProvider")
// String implements the Stringer interface.
func (x UpdateRecipientLogProvider) 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 UpdateRecipientLogProvider) IsValid() bool {
_, err := ParseUpdateRecipientLogProvider(string(x))
return err == nil
}
var _UpdateRecipientLogProviderValue = map[string]UpdateRecipientLogProvider{
"resend": UpdateRecipientLogProviderResend,
"sendgrid": UpdateRecipientLogProviderSendgrid,
"smtp": UpdateRecipientLogProviderSmtp,
}
// ParseUpdateRecipientLogProvider attempts to convert a string to a UpdateRecipientLogProvider.
func ParseUpdateRecipientLogProvider(name string) (UpdateRecipientLogProvider, error) {
if x, ok := _UpdateRecipientLogProviderValue[name]; ok {
return x, nil
}
return UpdateRecipientLogProvider(""), fmt.Errorf("%s is %w", name, ErrInvalidUpdateRecipientLogProvider)
}
const (
// UpdateSendScheduleScheduled is a UpdateSendSchedule of type scheduled.
UpdateSendScheduleScheduled UpdateSendSchedule = "scheduled"
// UpdateSendScheduleCancelled is a UpdateSendSchedule of type cancelled.
UpdateSendScheduleCancelled UpdateSendSchedule = "cancelled"
// UpdateSendScheduleSent is a UpdateSendSchedule of type sent.
UpdateSendScheduleSent UpdateSendSchedule = "sent"
// UpdateSendScheduleFailed is a UpdateSendSchedule of type failed.
UpdateSendScheduleFailed UpdateSendSchedule = "failed"
// UpdateSendScheduleProcessing is a UpdateSendSchedule of type processing.
UpdateSendScheduleProcessing UpdateSendSchedule = "processing"
)
var ErrInvalidUpdateSendSchedule = errors.New("not a valid UpdateSendSchedule")
// String implements the Stringer interface.
func (x UpdateSendSchedule) 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 UpdateSendSchedule) IsValid() bool {
_, err := ParseUpdateSendSchedule(string(x))
return err == nil
}
var _UpdateSendScheduleValue = map[string]UpdateSendSchedule{
"scheduled": UpdateSendScheduleScheduled,
"cancelled": UpdateSendScheduleCancelled,
"sent": UpdateSendScheduleSent,
"failed": UpdateSendScheduleFailed,
"processing": UpdateSendScheduleProcessing,
}
// ParseUpdateSendSchedule attempts to convert a string to a UpdateSendSchedule.
func ParseUpdateSendSchedule(name string) (UpdateSendSchedule, error) {
if x, ok := _UpdateSendScheduleValue[name]; ok {
return x, nil
}
return UpdateSendSchedule(""), fmt.Errorf("%s is %w", name, ErrInvalidUpdateSendSchedule)
}
const (
// UpdateStatusDraft is a UpdateStatus of type draft.
UpdateStatusDraft UpdateStatus = "draft"
// UpdateStatusSent is a UpdateStatus of type sent.
UpdateStatusSent UpdateStatus = "sent"
)
var ErrInvalidUpdateStatus = errors.New("not a valid UpdateStatus")
// String implements the Stringer interface.
func (x UpdateStatus) 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 UpdateStatus) IsValid() bool {
_, err := ParseUpdateStatus(string(x))
return err == nil
}
var _UpdateStatusValue = map[string]UpdateStatus{
"draft": UpdateStatusDraft,
"sent": UpdateStatusSent,
}
// ParseUpdateStatus attempts to convert a string to a UpdateStatus.
func ParseUpdateStatus(name string) (UpdateStatus, error) {
if x, ok := _UpdateStatusValue[name]; ok {
return x, nil
}
return UpdateStatus(""), fmt.Errorf("%s is %w", name, ErrInvalidUpdateStatus)
}
const (
// UpdateTypePreview is a UpdateType of type preview.
UpdateTypePreview UpdateType = "preview"
// UpdateTypeLive is a UpdateType of type live.
UpdateTypeLive UpdateType = "live"
)
var ErrInvalidUpdateType = errors.New("not a valid UpdateType")
// String implements the Stringer interface.
func (x UpdateType) 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 UpdateType) IsValid() bool {
_, err := ParseUpdateType(string(x))
return err == nil
}
var _UpdateTypeValue = map[string]UpdateType{
"preview": UpdateTypePreview,
"live": UpdateTypeLive,
}
// ParseUpdateType attempts to convert a string to a UpdateType.
func ParseUpdateType(name string) (UpdateType, error) {
if x, ok := _UpdateTypeValue[name]; ok {
return x, nil
}
return UpdateType(""), fmt.Errorf("%s is %w", name, ErrInvalidUpdateType)
}