forked from huaweicloud/huaweicloud-sdk-go-v3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
model_component_snapshot_context.go
159 lines (123 loc) · 3.68 KB
/
model_component_snapshot_context.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
package model
import (
"github.com/dysodeng/huaweicloud-sdk-go-v3/core/utils"
"errors"
"github.com/dysodeng/huaweicloud-sdk-go-v3/core/converter"
"strings"
)
type ComponentSnapshotContext struct {
// 应用ID。
AppId *string `json:"app_id,omitempty"`
// 可用实例个数。
AvailableReplica *int32 `json:"available_replica,omitempty"`
// 组件构建信息。
Build *string `json:"build,omitempty"`
// 构建任务ID。
BuildId *string `json:"build_id,omitempty"`
// 构建日志ID。
BuildLogId *string `json:"build_log_id,omitempty"`
// 环境ID。
EnvId *string `json:"env_id,omitempty"`
// 组件ID。
Id *string `json:"id,omitempty"`
// 镜像地址。
ImageUrl *string `json:"image_url,omitempty"`
// 任务ID。
JobId *string `json:"job_id,omitempty"`
// LTS日志组的ID。
LogGroupId *string `json:"log_group_id,omitempty"`
// LTS日志流的ID
LogStreamId *string `json:"log_stream_id,omitempty"`
// 组件名称。
Name *string `json:"name,omitempty"`
// 组件操作。
Operation *string `json:"operation,omitempty"`
// 组件操作状态。
OperationStatus *string `json:"operation_status,omitempty"`
// 实例个数。
Replica *int32 `json:"replica,omitempty"`
// 组件规格。
ResourceLimit *string `json:"resource_limit,omitempty"`
// 语言/运行时。
Runtime *ComponentSnapshotContextRuntime `json:"runtime,omitempty"`
// 组件源信息。
Source *string `json:"source,omitempty"`
// 组件状态。
Status *string `json:"status,omitempty"`
// 组件版本。
Version *string `json:"version,omitempty"`
// 创建时间。
CreatedAt *string `json:"created_at,omitempty"`
// 更新时间。
UpdatedAt *string `json:"updated_at,omitempty"`
}
func (o ComponentSnapshotContext) String() string {
data, err := utils.Marshal(o)
if err != nil {
return "ComponentSnapshotContext struct{}"
}
return strings.Join([]string{"ComponentSnapshotContext", string(data)}, " ")
}
type ComponentSnapshotContextRuntime struct {
value string
}
type ComponentSnapshotContextRuntimeEnum struct {
DOCKER ComponentSnapshotContextRuntime
JAVA8 ComponentSnapshotContextRuntime
JAVA11 ComponentSnapshotContextRuntime
TOMCAT8 ComponentSnapshotContextRuntime
TOMCAT9 ComponentSnapshotContextRuntime
PYTHON3 ComponentSnapshotContextRuntime
NODEJS8 ComponentSnapshotContextRuntime
PHP7 ComponentSnapshotContextRuntime
}
func GetComponentSnapshotContextRuntimeEnum() ComponentSnapshotContextRuntimeEnum {
return ComponentSnapshotContextRuntimeEnum{
DOCKER: ComponentSnapshotContextRuntime{
value: "Docker",
},
JAVA8: ComponentSnapshotContextRuntime{
value: "Java8",
},
JAVA11: ComponentSnapshotContextRuntime{
value: "Java11",
},
TOMCAT8: ComponentSnapshotContextRuntime{
value: "Tomcat8",
},
TOMCAT9: ComponentSnapshotContextRuntime{
value: "Tomcat9",
},
PYTHON3: ComponentSnapshotContextRuntime{
value: "Python3",
},
NODEJS8: ComponentSnapshotContextRuntime{
value: "Nodejs8",
},
PHP7: ComponentSnapshotContextRuntime{
value: "Php7",
},
}
}
func (c ComponentSnapshotContextRuntime) Value() string {
return c.value
}
func (c ComponentSnapshotContextRuntime) MarshalJSON() ([]byte, error) {
return utils.Marshal(c.value)
}
func (c *ComponentSnapshotContextRuntime) 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")
}
}