-
Notifications
You must be signed in to change notification settings - Fork 44
/
model_show_cluster_config_request.go
80 lines (64 loc) · 2.06 KB
/
model_show_cluster_config_request.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
package model
import (
"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
"errors"
"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/converter"
"strings"
)
// ShowClusterConfigRequest Request Object
type ShowClusterConfigRequest struct {
// 组件类型 , 合法取值为control,audit,system-addon。不填写则查询全部类型。 - control 控制面组件日志。 - audit 控制面审计日志。 - system-addon 系统插件日志。
Type *ShowClusterConfigRequestType `json:"type,omitempty"`
// 集群ID,获取方式请参见[如何获取接口URI中参数](cce_02_0271.xml)。
ClusterId string `json:"cluster_id"`
}
func (o ShowClusterConfigRequest) String() string {
data, err := utils.Marshal(o)
if err != nil {
return "ShowClusterConfigRequest struct{}"
}
return strings.Join([]string{"ShowClusterConfigRequest", string(data)}, " ")
}
type ShowClusterConfigRequestType struct {
value string
}
type ShowClusterConfigRequestTypeEnum struct {
CONTROL ShowClusterConfigRequestType
AUDIT ShowClusterConfigRequestType
SYSTEM_ADDON ShowClusterConfigRequestType
}
func GetShowClusterConfigRequestTypeEnum() ShowClusterConfigRequestTypeEnum {
return ShowClusterConfigRequestTypeEnum{
CONTROL: ShowClusterConfigRequestType{
value: "control",
},
AUDIT: ShowClusterConfigRequestType{
value: "audit",
},
SYSTEM_ADDON: ShowClusterConfigRequestType{
value: "system-addon",
},
}
}
func (c ShowClusterConfigRequestType) Value() string {
return c.value
}
func (c ShowClusterConfigRequestType) MarshalJSON() ([]byte, error) {
return utils.Marshal(c.value)
}
func (c *ShowClusterConfigRequestType) 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")
}
}