forked from huaweicloud/huaweicloud-sdk-go-v3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
model_show_plugin_response.go
153 lines (125 loc) · 4.47 KB
/
model_show_plugin_response.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
package model
import (
"errors"
"github.com/dysodeng/huaweicloud-sdk-go-v3/core/converter"
"github.com/dysodeng/huaweicloud-sdk-go-v3/core/sdktime"
"github.com/dysodeng/huaweicloud-sdk-go-v3/core/utils"
"strings"
)
// ShowPluginResponse Response Object
type ShowPluginResponse struct {
// 插件编码。
PluginId *string `json:"plugin_id,omitempty"`
// 插件名称。支持汉字,英文,数字,中划线,下划线,且只能以英文和汉字开头,3-255字符。 > 中文字符必须为UTF-8或者unicode编码。
PluginName *string `json:"plugin_name,omitempty"`
// 插件类型 - cors:跨域资源共享 - set_resp_headers:HTTP响应头管理 - kafka_log:Kafka日志推送 - breaker:断路器 - rate_limit: 流量控制 - third_auth: 第三方认证
PluginType *ShowPluginResponsePluginType `json:"plugin_type,omitempty"`
// 插件可见范围。global:全局可见;
PluginScope *ShowPluginResponsePluginScope `json:"plugin_scope,omitempty"`
// 插件定义内容,支持json。参考提供的具体模型定义 CorsPluginContent:跨域资源共享 定义内容 SetRespHeadersContent:HTTP响应头管理 定义内容 KafkaLogContent:Kafka日志推送 定义内容 BreakerContent:断路器 定义内容 RateLimitContent 流量控制 定义内容 ThirdAuthContent: 第三方认证 定义内容
PluginContent *string `json:"plugin_content,omitempty"`
// 插件描述,255字符。 > 中文字符必须为UTF-8或者unicode编码。
Remark *string `json:"remark,omitempty"`
// 创建时间。
CreateTime *sdktime.SdkTime `json:"create_time,omitempty"`
// 更新时间。
UpdateTime *sdktime.SdkTime `json:"update_time,omitempty"`
HttpStatusCode int `json:"-"`
}
func (o ShowPluginResponse) String() string {
data, err := utils.Marshal(o)
if err != nil {
return "ShowPluginResponse struct{}"
}
return strings.Join([]string{"ShowPluginResponse", string(data)}, " ")
}
type ShowPluginResponsePluginType struct {
value string
}
type ShowPluginResponsePluginTypeEnum struct {
CORS ShowPluginResponsePluginType
SET_RESP_HEADERS ShowPluginResponsePluginType
KAFKA_LOG ShowPluginResponsePluginType
BREAKER ShowPluginResponsePluginType
RATE_LIMIT ShowPluginResponsePluginType
THIRD_AUTH ShowPluginResponsePluginType
}
func GetShowPluginResponsePluginTypeEnum() ShowPluginResponsePluginTypeEnum {
return ShowPluginResponsePluginTypeEnum{
CORS: ShowPluginResponsePluginType{
value: "cors",
},
SET_RESP_HEADERS: ShowPluginResponsePluginType{
value: "set_resp_headers",
},
KAFKA_LOG: ShowPluginResponsePluginType{
value: "kafka_log",
},
BREAKER: ShowPluginResponsePluginType{
value: "breaker",
},
RATE_LIMIT: ShowPluginResponsePluginType{
value: "rate_limit",
},
THIRD_AUTH: ShowPluginResponsePluginType{
value: "third_auth",
},
}
}
func (c ShowPluginResponsePluginType) Value() string {
return c.value
}
func (c ShowPluginResponsePluginType) MarshalJSON() ([]byte, error) {
return utils.Marshal(c.value)
}
func (c *ShowPluginResponsePluginType) 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")
}
}
type ShowPluginResponsePluginScope struct {
value string
}
type ShowPluginResponsePluginScopeEnum struct {
GLOBAL ShowPluginResponsePluginScope
}
func GetShowPluginResponsePluginScopeEnum() ShowPluginResponsePluginScopeEnum {
return ShowPluginResponsePluginScopeEnum{
GLOBAL: ShowPluginResponsePluginScope{
value: "global",
},
}
}
func (c ShowPluginResponsePluginScope) Value() string {
return c.value
}
func (c ShowPluginResponsePluginScope) MarshalJSON() ([]byte, error) {
return utils.Marshal(c.value)
}
func (c *ShowPluginResponsePluginScope) 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")
}
}