forked from huaweicloud/huaweicloud-sdk-go-v3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
model_micro_service_info_cce_create.go
101 lines (78 loc) · 3.13 KB
/
model_micro_service_info_cce_create.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
package model
import (
"github.com/dysodeng/huaweicloud-sdk-go-v3/core/utils"
"errors"
"github.com/dysodeng/huaweicloud-sdk-go-v3/core/converter"
"strings"
)
// MicroServiceInfoCceCreate CCE云容器引擎工作负载信息,service_type为CCE时必填
type MicroServiceInfoCceCreate struct {
// 云容器引擎集群编号
ClusterId string `json:"cluster_id"`
// 命名空间
Namespace string `json:"namespace"`
// 工作负载类型 - deployment:无状态负载 - statefulset:有状态负载 - daemonset:守护进程集
WorkloadType MicroServiceInfoCceCreateWorkloadType `json:"workload_type"`
// APP名称。支持汉字,英文,数字,点,中划线,下划线,且只能以英文和汉字开头,1-64字符。 > 中文字符必须为UTF-8或者unicode编码。
AppName *string `json:"app_name,omitempty"`
// 服务标识名。支持汉字、英文、数字、中划线、下划线、点、斜杠、中英文格式下的小括号和冒号,且只能以英文、汉字和数字开头,1-64个字符。 > 中文字符必须为UTF-8或者unicode编码。
LabelKey *string `json:"label_key,omitempty"`
// 服务标识值。支持汉字,英文,数字,点,中划线,下划线,且只能以英文和汉字开头,1-64字符。 > 中文字符必须为UTF-8或者unicode编码。
LabelValue *string `json:"label_value,omitempty"`
// 工作负载的版本
Version *string `json:"version,omitempty"`
// 工作负载的监听端口号
Port int32 `json:"port"`
// 工作负载的标签列表。
Labels *[]MicroserviceLabel `json:"labels,omitempty"`
}
func (o MicroServiceInfoCceCreate) String() string {
data, err := utils.Marshal(o)
if err != nil {
return "MicroServiceInfoCceCreate struct{}"
}
return strings.Join([]string{"MicroServiceInfoCceCreate", string(data)}, " ")
}
type MicroServiceInfoCceCreateWorkloadType struct {
value string
}
type MicroServiceInfoCceCreateWorkloadTypeEnum struct {
DEPLOYMENT MicroServiceInfoCceCreateWorkloadType
STATEFULSET MicroServiceInfoCceCreateWorkloadType
DAEMONSET MicroServiceInfoCceCreateWorkloadType
}
func GetMicroServiceInfoCceCreateWorkloadTypeEnum() MicroServiceInfoCceCreateWorkloadTypeEnum {
return MicroServiceInfoCceCreateWorkloadTypeEnum{
DEPLOYMENT: MicroServiceInfoCceCreateWorkloadType{
value: "deployment",
},
STATEFULSET: MicroServiceInfoCceCreateWorkloadType{
value: "statefulset",
},
DAEMONSET: MicroServiceInfoCceCreateWorkloadType{
value: "daemonset",
},
}
}
func (c MicroServiceInfoCceCreateWorkloadType) Value() string {
return c.value
}
func (c MicroServiceInfoCceCreateWorkloadType) MarshalJSON() ([]byte, error) {
return utils.Marshal(c.value)
}
func (c *MicroServiceInfoCceCreateWorkloadType) UnmarshalJSON(b []byte) error {
myConverter := converter.StringConverterFactory("string")
if myConverter == nil {
return errors.New("unsupported StringConverter type: string")
}
interf, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\""))
if err != nil {
return err
}
if val, ok := interf.(string); ok {
c.value = val
return nil
} else {
return errors.New("convert enum data to string error")
}
}