/
results.go
155 lines (112 loc) · 3.46 KB
/
results.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
154
155
package periodresource
import "github.com/gophercloud/gophercloud"
type QueryCustomerPeriodResourcesListResp struct {
//Status code.
ErrorCode string `json:"error_code"`
//Error description.
ErrorMsg string `json:"error_msg"`
//Resource list.
Data []ResourceInstance `json:"data"`
//Total number of records
TotalCount *int `json:"total_count,omitempty"`
}
type ResourceInstance struct {
//Internal ID of the resource to be provisioned
Id string `json:"id"`
//Resource instance ID.
ResourceId string `json:"resource_id"`
//Resource instance name.
ResourceName string `json:"resource_name"`
//Resource pool region ID of cloud services.
RegionCode string `json:"region_code"`
//Cloud service type code.
cloudServiceTypeCode string `json:"cloud_service_type_code"`
//Resource type code
ResourceTypeCode string `json:"resource_type_code"`
//resource_spec_code
ResourceSpecCode string `json:"resource_spec_code"`
//Resource project ID.
ProjectCode string `json:"project_code"`
//Product ID.
ProductId string `json:"product_id"`
//Primary resource ID.
MainResourceId string `json:"main_resource_id"`
//Whether a primary resource.
IsMainResource *int `json:"is_main_resource,omitempty"`
//Resource status.
Status *int `json:"status,omitempty"`
//Effective time of a resource.
ValidTime string `json:"valid_time"`
//Expiration time of a resource.
ExpireTime string `json:"expire_time"`
//Next billing policy.
NextOperationPolicy *int `json:"next_operation_policy,omitempty"`
}
type RenewSubscriptionByResourceIdResp struct {
//Status code。
ErrorCode string `json:"error_code"`
//Error description.
ErrorMsg string `json:"error_msg"`
//List of order IDs generated when resource subscription is renewed.
OrderIds []string `json:"order_ids"`
}
type UnsubscribeByResourceIdResp struct {
//Status code.
ErrorCode string `json:"error_code"`
//Error description.
ErrorMsg string `json:"error_msg"`
//Unsubscription order IDs.
OrderIds []string `json:"order_ids"`
}
type EnableAutoRenewResp struct {
//Status code.
ErrorCode string `json:"error_code"`
//Error description.
ErrorMsg string `json:"error_msg"`
}
type DisableAutoRenewResp struct {
//Status code.
ErrorCode string `json:"error_code"`
//Error description.
ErrorMsg string `json:"error_msg"`
}
type QueryCustomerPeriodResourcesListResult struct {
gophercloud.Result
}
func (r QueryCustomerPeriodResourcesListResult) Extract() (*QueryCustomerPeriodResourcesListResp, error) {
var res *QueryCustomerPeriodResourcesListResp
err := r.ExtractInto(&res)
return res, err
}
type RenewSubscriptionByResourceIdResult struct {
gophercloud.Result
}
func (r RenewSubscriptionByResourceIdResult) Extract() (*RenewSubscriptionByResourceIdResp, error) {
var res *RenewSubscriptionByResourceIdResp
err := r.ExtractInto(&res)
return res, err
}
type UnsubscribeByResourceIdResult struct {
gophercloud.Result
}
func (r UnsubscribeByResourceIdResult) Extract() (*UnsubscribeByResourceIdResp, error) {
var res *UnsubscribeByResourceIdResp
err := r.ExtractInto(&res)
return res, err
}
type EnableAutoRenewResult struct {
gophercloud.Result
}
func (r EnableAutoRenewResult) Extract() (*EnableAutoRenewResp, error) {
var res *EnableAutoRenewResp
err := r.ExtractInto(&res)
return res, err
}
type DisableAutoRenewResult struct {
gophercloud.Result
}
func (r DisableAutoRenewResult) Extract() (*DisableAutoRenewResp, error) {
var res *DisableAutoRenewResp
err := r.ExtractInto(&res)
return res, err
}