forked from huaweicloud/huaweicloud-sdk-go-v3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
model_remove_from_shared_bandwidth_option.go
79 lines (62 loc) · 2.67 KB
/
model_remove_from_shared_bandwidth_option.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
package model
import (
"github.com/dysodeng/huaweicloud-sdk-go-v3/core/utils"
"errors"
"github.com/dysodeng/huaweicloud-sdk-go-v3/core/converter"
"strings"
)
// RemoveFromSharedBandwidthOption 带宽对象
type RemoveFromSharedBandwidthOption struct {
// 弹性公网IP从共享带宽移除后,会为此弹性公网IP创建独占带宽进行计费。 此参数表示弹性公网IP从共享带宽移除后,使用的独占带宽的计费类型。(bandwidth/traffic)
ChargeMode RemoveFromSharedBandwidthOptionChargeMode `json:"charge_mode"`
// 功能说明:要从共享带宽中移除的弹性公网IP或者IPv6端口信息 约束:WHOLE类型的带宽支持多个弹性公网IP或者IPv6端口,跟租户的配额相关,默认一个共享带宽的配额为20
PublicipInfo []RemovePublicipInfo `json:"publicip_info"`
// 弹性公网IP从共享带宽移除后,会为此弹性公网IP创建独占带宽进行计费。 此参数表示弹性公网IP从共享带宽移除后,使用的独占带宽的带宽大小。(M)取值范围:默认为1~2000Mbit/s. 可能因为局点配置不同而不同。也跟带宽的计费模式(bandwidth/traffic)相关。
Size int32 `json:"size"`
}
func (o RemoveFromSharedBandwidthOption) String() string {
data, err := utils.Marshal(o)
if err != nil {
return "RemoveFromSharedBandwidthOption struct{}"
}
return strings.Join([]string{"RemoveFromSharedBandwidthOption", string(data)}, " ")
}
type RemoveFromSharedBandwidthOptionChargeMode struct {
value string
}
type RemoveFromSharedBandwidthOptionChargeModeEnum struct {
BANDWIDTH RemoveFromSharedBandwidthOptionChargeMode
TRAFFIC RemoveFromSharedBandwidthOptionChargeMode
}
func GetRemoveFromSharedBandwidthOptionChargeModeEnum() RemoveFromSharedBandwidthOptionChargeModeEnum {
return RemoveFromSharedBandwidthOptionChargeModeEnum{
BANDWIDTH: RemoveFromSharedBandwidthOptionChargeMode{
value: "bandwidth",
},
TRAFFIC: RemoveFromSharedBandwidthOptionChargeMode{
value: "traffic",
},
}
}
func (c RemoveFromSharedBandwidthOptionChargeMode) Value() string {
return c.value
}
func (c RemoveFromSharedBandwidthOptionChargeMode) MarshalJSON() ([]byte, error) {
return utils.Marshal(c.value)
}
func (c *RemoveFromSharedBandwidthOptionChargeMode) 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")
}
}