This repository has been archived by the owner on Nov 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
/
results.go
110 lines (71 loc) · 2.09 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
package account
import (
"github.com/gophercloud/gophercloud"
)
type ResourceDaily struct {
ErrorCode string `json:"error_code"`
ErrorMsg string `json:"error_msg"`
TotalRecord int `json:"totalRecord"`
Currency string `json:"currency"`
TotalAmount int `json:"totalAmount"`
MeasureId int `json:"measureId"`
DailyRecords []DailyRecord `json:"dailyRecords"`
}
type DailyRecord struct {
//Account type 1: cloud account 2: partner funding account
Type string `json:"type"`
//BpID
BpId string `json:"bpId"`
//Name of partner company
BpName string `json:"bpName"`
//Cloud Service Type。
CloudServiceType string `json:"cloudServiceType"`
//Region Code
RegionCode string `json:"regionCode"`
//Resource Type
ResourceType string `json:"resourceType"`
//Resource Id
ResourceId string `json:"resourceId"`
//Resource Name。
ResourceName string `json:"resourceName"`
//Resource tag
Resourcetag string `json:"resourcetag"`
//Price Factor Name。
PriceFactorName string `json:"priceFactorName"`
//Consume Time
ConsumeTime string `json:"consumeTime"`
//Consume Amount
ConsumeAmount int `json:"consumeAmount"`
//Offical Amount
OfficalAmount int `json:"officalAmount"`
//Debt Amount
DebtAmount int `json:"debtAmount"`
//Discount amount
DisCountAmount int `json:"disCountAmount"`
//Total consumption of old coupons。
OldCouponTotalAmount int `json:"oldCouponTotalAmount"`
//The amount of the unit is 1: yuan 2: angle 3: points.
MeasureId int `json:"measureId"`
//EnterpriseProjectId
EnterpriseProjectId string `json:"enterpriseProjectId"`
//DeductDetailInfos。
DeductDetailInfos []DeductDetailInfo `json:"DeductDetailInfos"`
//Example of bidding
Spot string `json:"spot"`
}
type DeductDetailInfo struct {
//Account type。
BalanceTypeId string `json:"balanceTypeId"`
//Amount
Amount int `json:"amount"`
//The amount of the unit is 1: yuan 2: angle 3: points.
MeasureId int `json:"measureId"`
}
type commonResult struct {
gophercloud.Result
}
func (r commonResult) Extract() (ResourceDaily, error) {
var res ResourceDaily
err := r.ExtractInto(&res)
return res, err
}