-
Notifications
You must be signed in to change notification settings - Fork 0
/
shipping_processor_type__generated.go
85 lines (72 loc) · 2.08 KB
/
shipping_processor_type__generated.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
package project
import (
"bytes"
"encoding"
"errors"
github_com_eden_framework_enumeration "github.com/eden-framework/enumeration"
)
var InvalidShippingProcessorType = errors.New("invalid ShippingProcessorType")
func init() {
github_com_eden_framework_enumeration.RegisterEnums("ShippingProcessorType", map[string]string{
"ALIYUN_REGISTRY": "aliyun registry",
})
}
func ParseShippingProcessorTypeFromString(s string) (ShippingProcessorType, error) {
switch s {
case "":
return SHIPPING_PROCESSOR_TYPE_UNKNOWN, nil
case "ALIYUN_REGISTRY":
return SHIPPING_PROCESSOR_TYPE__ALIYUN_REGISTRY, nil
}
return SHIPPING_PROCESSOR_TYPE_UNKNOWN, InvalidShippingProcessorType
}
func ParseShippingProcessorTypeFromLabelString(s string) (ShippingProcessorType, error) {
switch s {
case "":
return SHIPPING_PROCESSOR_TYPE_UNKNOWN, nil
case "aliyun registry":
return SHIPPING_PROCESSOR_TYPE__ALIYUN_REGISTRY, nil
}
return SHIPPING_PROCESSOR_TYPE_UNKNOWN, InvalidShippingProcessorType
}
func (ShippingProcessorType) EnumType() string {
return "ShippingProcessorType"
}
func (ShippingProcessorType) Enums() map[int][]string {
return map[int][]string{
int(SHIPPING_PROCESSOR_TYPE__ALIYUN_REGISTRY): {"ALIYUN_REGISTRY", "aliyun registry"},
}
}
func (v ShippingProcessorType) String() string {
switch v {
case SHIPPING_PROCESSOR_TYPE_UNKNOWN:
return ""
case SHIPPING_PROCESSOR_TYPE__ALIYUN_REGISTRY:
return "ALIYUN_REGISTRY"
}
return "UNKNOWN"
}
func (v ShippingProcessorType) Label() string {
switch v {
case SHIPPING_PROCESSOR_TYPE_UNKNOWN:
return ""
case SHIPPING_PROCESSOR_TYPE__ALIYUN_REGISTRY:
return "aliyun registry"
}
return "UNKNOWN"
}
var _ interface {
encoding.TextMarshaler
encoding.TextUnmarshaler
} = (*ShippingProcessorType)(nil)
func (v ShippingProcessorType) MarshalText() ([]byte, error) {
str := v.String()
if str == "UNKNOWN" {
return nil, InvalidShippingProcessorType
}
return []byte(str), nil
}
func (v *ShippingProcessorType) UnmarshalText(data []byte) (err error) {
*v, err = ParseShippingProcessorTypeFromString(string(bytes.ToUpper(data)))
return
}