-
Notifications
You must be signed in to change notification settings - Fork 52
/
model_create_agency_option.go
88 lines (68 loc) · 2.35 KB
/
model_create_agency_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
80
81
82
83
84
85
86
87
88
package model
import (
"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
"errors"
"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/converter"
"strings"
)
// CreateAgencyOption
type CreateAgencyOption struct {
// 委托名,长度不大于64位。
Name string `json:"name"`
// 委托方账号ID。
DomainId string `json:"domain_id"`
// 被委托方账号ID。trust_domain_id和trust_domain_name至少填写一个,若都填写优先校验trust_domain_name。
TrustDomainId *string `json:"trust_domain_id,omitempty"`
// 被委托方账号名。trust_domain_id和trust_domain_name至少填写一个,若都填写优先校验trust_domain_name。
TrustDomainName *string `json:"trust_domain_name,omitempty"`
// 委托描述信息,长度不大于255位。
Description *string `json:"description,omitempty"`
// 委托的期限。取值为“FOREVER\"表示委托的期限为永久,取值为\"ONEDAY\"表示委托的期限为一天。不填写该参数则默认为\"null\"也表示委托的期限为永久。
Duration *CreateAgencyOptionDuration `json:"duration,omitempty"`
}
func (o CreateAgencyOption) String() string {
data, err := utils.Marshal(o)
if err != nil {
return "CreateAgencyOption struct{}"
}
return strings.Join([]string{"CreateAgencyOption", string(data)}, " ")
}
type CreateAgencyOptionDuration struct {
value string
}
type CreateAgencyOptionDurationEnum struct {
FOREVER CreateAgencyOptionDuration
ONEDAY CreateAgencyOptionDuration
}
func GetCreateAgencyOptionDurationEnum() CreateAgencyOptionDurationEnum {
return CreateAgencyOptionDurationEnum{
FOREVER: CreateAgencyOptionDuration{
value: "FOREVER",
},
ONEDAY: CreateAgencyOptionDuration{
value: "ONEDAY",
},
}
}
func (c CreateAgencyOptionDuration) Value() string {
return c.value
}
func (c CreateAgencyOptionDuration) MarshalJSON() ([]byte, error) {
return utils.Marshal(c.value)
}
func (c *CreateAgencyOptionDuration) 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")
}
}