forked from huaweicloud/huaweicloud-sdk-go
/
results.go
362 lines (252 loc) · 9.12 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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
package bill
import "github.com/gophercloud/gophercloud"
type QueryPartnerMonthlyBillsResp struct {
//Error code.
ErrorCode string `json:"error_code"`
//Error description
ErrorMsg string `json:"error_msg"`
//Billing cycle
BillCycle string `json:"billCycle"`
//Bill amount, which is calculated based on the special commercial discount of the partner.
CreditDebtAmount *float64 `json:"creditDebtAmount,omitempty"`
//Consumption amount, which is calculated based on the special commercial discount of the partner.
ConsumeAmount *float64 `json:"consumeAmount,omitempty"`
//Write-off amount (negative value), which is calculated based on the special commercial discount of the partner.
Writeoffdebt *float64 `json:"writeoffdebt,omitempty"`
//Unsubscription amount (negative value), which is calculated based on the special commercial discount of the partner.
unsubscribeAmount *float64 `json:"unsubscribeAmount,omitempty"`
//Unit
measureId *int `json:"measureId,omitempty"`
//This parameter is returned only when the query is successful.
Currency string `json:"currency"`
//Tax amount, which is the tax amount in the creditDebtAmount field.
TaxAmount *float64 `json:"taxAmount,omitempty"`
//Bill amount that is not settled, which is calculated based on the special commercial discount of the partner.
UnclearedAmount *float64 `json:"unclearedAmount,omitempty"`
//Due date for bills.
DueDate string `json:"dueDate"`
//Bill list.
BillList []PostpaidBillInfo `json:"billList"`
}
type PostpaidBillInfo struct {
//Bill type
BillType string `json:"billType"`
//Cloud service type code.
CloudServiceTypeCode string `json:"cloudServiceTypeCode"`
//Resource type code.
ResourceTypeCode string `json:"resourceTypeCode"`
//Billing mode.
PayMethod string `json:"payMethod"`
//Transaction amount/unsubscription amount/refund amount of the customer, including the vouchers, flexi-purchase coupons, reserved flexi-purchase coupons, and stored-value cards.
CreditDebtAmount *float64 `json:"creditDebtAmount"`
//Transaction amount/unsubscription amount/refund amount of the customer,not including the vouchers, flexi-purchase coupons, reserved flexi-purchase coupons, or stored-value cards.
CustomerAmountDue *float64 `json:"customerAmountDue"`
//Settlement product type.
SettlementType *int `json:"settlementType,omitempty"`
//Partner discount percentage
PartnerRatio *float64 `json:"partnerRatio,omitempty"`
//Amount that the partner needs to refund/Amount that the partner has refund
PartnerAmount *float64 `json:"partnerAmount,omitempty"`
//Yearly/monthly unit.
PeriodType *int `json:"periodType,omitempty"`
//Number of yearly/month periods.
PeriodNum *int `json:"periodNum,omitempty"`
//Product category code.
CategoryCode string `json:"categoryCode"`
}
type QueryMonthlyExpenditureSummaryResp struct {
//Error code
ErrorCode string `json:"error_code"`
//Error description.
ErrorMsg string `json:"error_msg"`
//Currency.
Currency string `json:"currency"`
//Number of the total records
TotalCount *int `json:"total_count,omitempty"`
//Record information
BillSums []BillSumRecordInfo `json:"bill_sums"`
}
type BillSumRecordInfo struct {
//Customer ID.
CustomerId string `json:"customer_id"`
//Resource type code
ResourceTypeCode string `json:"resource_type_code"`
//Cloud service region
RegionCode string `json:"region_code"`
//Cloud service type code
CloudServiceTypeCode string `json:"cloud_service_type_code"`
//Expenditure data collection period
ConsumeTime string `json:"consume_time"`
//Expenditure type
PayMethod string `json:"pay_method"`
//Consumption amount
ConsumeAmount *float64 `json:"consume_amount,omitempty"`
//Outstanding amount
Debt *float64 `json:"debt,omitempty"`
//Discounted amount
Discount *float64 `json:"discount,omitempty"`
//Unit
MeasureId *int `json:"measure_id,omitempty"`
//Expenditure type
BillType *int `json:"bill_type,omitempty"`
//Total payment amount distinguished by expenditure type and payment method of an account.
AccountDetails []BalanceTypePay `json:"account_details"`
//Discounted amount details
DiscountDetailInfos []DiscountDetailInfo `json:"discount_detail_infos"`
//Enterprise project ID
EnterpriseProjectId string `json:"enterpriseProjectId"`
}
type BalanceTypePay struct {
//Account type
BalanceTypeId string `json:"balance_type_id,omitempty"`
//Deducted amount
DeductAmount float64 `json:"deduct_amount,omitempty"`
}
type DiscountDetailInfo struct {
//Discount type
PromotionType string `json:"promotion_type"`
//Discounted amount
DiscountAmount *float64 `json:"discount_amount,omitempty"`
//Discount type ID
PromotionId string `json:"promotion_id"`
//Unit
MeasureId *int `json:"measure_id,omitempty"`
}
type QueryResourceUsageDetailsResp struct {
//Error code
ErrorCode string `json:"error_code"`
//Error description
ErrorMsg string `json:"error_msg"`
//Currency unit
Currency string `json:"currency"`
//Number of result sets
TotalCount *int `json:"total_count,omitempty"`
//Resource usage record
MonthlyRecords []MonthlyRecord `json:"monthlyRecords"`
}
type MonthlyRecord struct {
//Cloud service type code
CloudServiceTypeCode string `json:"cloudServiceTypeCode"`
//Cloud service region code
ResourceTypeCode string `json:"resourceTypeCode"`
//Resource type code
RegionCode string `json:"regionCode"`
//Resource instance ID
ResInstanceId string `json:"resInstanceId"`
//Resource name
ResourceName string `json:"resourceName"`
//Resource tag
ResourceTag string `json:"resourceTag"`
//Consumption amount of a cloud service, including the amount of cash coupons.
ConsumeAmount *float64 `json:"consumeAmount,omitempty"`
//Expenditure month
Cycle string `json:"cycle"`
//Unit
MeasureId *int `json:"measureId,omitempty"`
//Enterprise project ID
EnterpriseProjectId string `json:"enterpriseProjectId"`
//Billing mode
PayMethod string `json:"payMethod"`
}
type QueryResourceUsageRecordResp struct {
//Error code
ErrorCode string `json:"error_code"`
//Error description
ErrorMsg string `json:"error_msg"`
//Currency unit.
Currency string `json:"currency"`
//Number of result sets
TotalCount *int `json:"totalCount,omitempty"`
//Resource usage record
FeeRecords []ResFeeRecord `json:"feeRecords"`
}
type ResFeeRecord struct {
//Fee generation time
CreateTime string `json:"createTime"`
//Start time of using the resource corresponding to the fee.
EffectiveTime string `json:"effectiveTime"`
//End time of using the resource corresponding to the fee
ExpireTime string `json:"expireTime"`
//Fee record serial number
FeeId string `json:"feeId"`
//Product ID
ProductId string `json:"productId"`
//Product name
ProductName string `json:"productName"`
//Order ID
OrderId string `json:"orderId"`
//Consumption amount, including the amount of cash coupons.
Amount *float64 `json:"amount,omitempty"`
//Unit
MeasureId *int `json:"measureId,omitempty"`
//Usage
UsageAmount *float64 `json:"usageAmount,omitempty"`
//Usage unit
UsageMeasureId *int `json:"usageMeasureId,omitempty"`
//Package usage.
FreeResourceAmount *float64 `json:"freeResourceAmount,omitempty"`
//Unit (package usage)
FreeResourceMeasureId *int `json:"freeResourceMeasureId,omitempty"`
//Cloud service type code
CloudServiceTypeCode string `json:"cloudServiceTypeCode"`
//Resource type code
ResourceTypeCode string `json:"resourceTypeCode"`
//Cloud service region code
RegionCode string `json:"regionCode"`
//Payment method
PayMethod string `json:"payMethod"`
//Project ID.
ProjectID string `json:"projectID"`
//Project name.
ProjectName string `json:"projectName"`
//Resource tag
ResourceTag string `json:"resourceTag"`
//Resource name
ResourceName string `json:"resourceName"`
//Resource ID.
ResourceId string `json:"resourceId"`
//Expenditure type
FeeSourceOperation *int `json:"feeSourceOperation,omitempty"`
//Enterprise project ID.
EnterpriseProjectId string `json:"enterpriseProjectId"`
//Period type
PeriodType string `json:"periodType"`
//Spot instance ID
Spot string `json:"spot"`
//Reserved instance usage
RIAmount *float64 `json:"rIAmount,omitempty"`
//Unit (reserved instance usage)
RIMeasureId *int `json:"rIMeasureId,omitempty"`
}
type QueryPartnerMonthlyBillsResult struct {
gophercloud.Result
}
func (r QueryPartnerMonthlyBillsResult) Extract() (*QueryPartnerMonthlyBillsResp, error) {
var res *QueryPartnerMonthlyBillsResp
err := r.ExtractInto(&res)
return res, err
}
type QueryMonthlyExpenditureSummaryResult struct {
gophercloud.Result
}
func (r QueryMonthlyExpenditureSummaryResult) Extract() (*QueryMonthlyExpenditureSummaryResp, error) {
var res *QueryMonthlyExpenditureSummaryResp
err := r.ExtractInto(&res)
return res, err
}
type QueryResourceUsageDetailsResult struct {
gophercloud.Result
}
func (r QueryResourceUsageDetailsResult) Extract() (*QueryResourceUsageDetailsResp, error) {
var res *QueryResourceUsageDetailsResp
err := r.ExtractInto(&res)
return res, err
}
type QueryResourceUsageRecordResult struct {
gophercloud.Result
}
func (r QueryResourceUsageRecordResult) Extract() (*QueryResourceUsageRecordResp, error) {
var res *QueryResourceUsageRecordResp
err := r.ExtractInto(&res)
return res, err
}