-
Notifications
You must be signed in to change notification settings - Fork 44
/
model_create_certificate_response.go
107 lines (81 loc) · 2.98 KB
/
model_create_certificate_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
package model
import (
"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
"errors"
"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/converter"
"strings"
)
// CreateCertificateResponse Response Object
type CreateCertificateResponse struct {
// SSL证书id
Id *string `json:"id,omitempty"`
// SSL证书所在的项目ID
TenantId *string `json:"tenant_id,omitempty"`
// SSL证书的管理状态;暂不支持
AdminStateUp *bool `json:"admin_state_up,omitempty"`
// SSL证书的名称。
Name *string `json:"name,omitempty"`
// SSL证书的描述。
Description *string `json:"description,omitempty"`
// SSL证书的类型。分为服务器证书(server)和CA证书(client)。
Type *CreateCertificateResponseType `json:"type,omitempty"`
// 服务器证书所签域名。该字段仅type为server时有效。
Domain *string `json:"domain,omitempty"`
// 服务器证书的私钥。仅type为server时有效。type为server时必选。
PrivateKey *string `json:"private_key,omitempty"`
// 当type为server时,表示服务器证书的公钥;当type为client时,表示用于认证客户端证书的CA证书。
Certificate *string `json:"certificate,omitempty"`
// SSL证书的过期时间。 UTC时间,格式为:yyyy-MM-dd HH:mm:ss ,如2020-05-28 08:30:09
ExpireTime *string `json:"expire_time,omitempty"`
// SSL证书的创建时间。 UTC时间,格式为:yyyy-MM-dd HH:mm:ss ,如2020-05-28 08:30:09
CreateTime *string `json:"create_time,omitempty"`
// SSL证书的更新时间。 UTC时间,格式为:yyyy-MM-dd HH:mm:ss ,如2020-05-28 08:30:09
UpdateTime *string `json:"update_time,omitempty"`
HttpStatusCode int `json:"-"`
}
func (o CreateCertificateResponse) String() string {
data, err := utils.Marshal(o)
if err != nil {
return "CreateCertificateResponse struct{}"
}
return strings.Join([]string{"CreateCertificateResponse", string(data)}, " ")
}
type CreateCertificateResponseType struct {
value string
}
type CreateCertificateResponseTypeEnum struct {
SERVER CreateCertificateResponseType
CLIENT CreateCertificateResponseType
}
func GetCreateCertificateResponseTypeEnum() CreateCertificateResponseTypeEnum {
return CreateCertificateResponseTypeEnum{
SERVER: CreateCertificateResponseType{
value: "server",
},
CLIENT: CreateCertificateResponseType{
value: "client",
},
}
}
func (c CreateCertificateResponseType) Value() string {
return c.value
}
func (c CreateCertificateResponseType) MarshalJSON() ([]byte, error) {
return utils.Marshal(c.value)
}
func (c *CreateCertificateResponseType) 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")
}
}