Skip to content

Commit c0105f7

Browse files
Merge pull request #199 from jdcloud-apigateway/master
publish jdcloud-sdk-go version 1.1.4
2 parents c28db6b + ec84e76 commit c0105f7

32 files changed

Lines changed: 1836 additions & 39 deletions

services/billing/ChangeLog.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
2022-11-21 version 1.1.4
2+
1.对外接口返回增加可用区字段
3+
4+
2022-08-18 version 1.1.3
5+
1.增加计费项月汇总账单对外接口
6+
7+
2022-04-26 version: 1.1.1
8+
1.增加资源加入/移出回收站接口
9+
10+
2021-11-08 version: 1.0.34
11+
1.解决go SDK返回值类型转换问题
12+
113
2021-07-12 version: 1.0.33
214
1.更新官网计费文档,涉及查询账单资源汇总、明细接口
315

services/billing/apis/CalculateTotalPrice.go

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ type CalculateTotalPriceRequest struct {
2828
/* */
2929
RegionId string `json:"regionId"`
3030

31-
/* 操作类型 1:创建 2:续费 3:升配 4:删除 */
31+
/* 操作类型 1:新购 2:续费 3:变配 */
3232
Cmd int `json:"cmd"`
3333

3434
/* 计算价格的订单 (Optional) */
@@ -61,7 +61,7 @@ type CalculateTotalPriceRequest struct {
6161

6262
/*
6363
* param regionId: (Required)
64-
* param cmd: 操作类型 1:创建 2:续费 3:升配 4:删除 (Required)
64+
* param cmd: 操作类型 1:新购 2:续费 3:变配 (Required)
6565
* param packageCount: 批量购买时数量 (Required)
6666
*
6767
* @Deprecated, not compatible when mandatory parameters changed
@@ -87,7 +87,7 @@ func NewCalculateTotalPriceRequest(
8787

8888
/*
8989
* param regionId: (Required)
90-
* param cmd: 操作类型 1:创建 2:续费 3:升配 4:删除 (Required)
90+
* param cmd: 操作类型 1:新购 2:续费 3:变配 (Required)
9191
* param orderList: 计算价格的订单 (Optional)
9292
* param operateTime: 操作时间(格式为:yyyy-MM-dd HH:mm:ss) (Optional)
9393
* param promotionInfo: 1:折扣(不需要传) 2:免费活动3:付费活动 4:推荐码 5:会员价 [{"promotionType":1,"activityCode":123},{"promotionType":2,"activityCode":}] (Optional)
@@ -150,57 +150,48 @@ func NewCalculateTotalPriceRequestWithoutParam() *CalculateTotalPriceRequest {
150150
func (r *CalculateTotalPriceRequest) SetRegionId(regionId string) {
151151
r.RegionId = regionId
152152
}
153-
154-
/* param cmd: 操作类型 1:创建 2:续费 3:升配 4:删除(Required) */
153+
/* param cmd: 操作类型 1:新购 2:续费 3:变配(Required) */
155154
func (r *CalculateTotalPriceRequest) SetCmd(cmd int) {
156155
r.Cmd = cmd
157156
}
158-
159157
/* param orderList: 计算价格的订单(Optional) */
160158
func (r *CalculateTotalPriceRequest) SetOrderList(orderList []billing.OrderPriceProtocol) {
161159
r.OrderList = orderList
162160
}
163-
164161
/* param operateTime: 操作时间(格式为:yyyy-MM-dd HH:mm:ss)(Optional) */
165162
func (r *CalculateTotalPriceRequest) SetOperateTime(operateTime string) {
166163
r.OperateTime = &operateTime
167164
}
168-
169165
/* param promotionInfo: 1:折扣(不需要传) 2:免费活动3:付费活动 4:推荐码 5:会员价 [{"promotionType":1,"activityCode":123},{"promotionType":2,"activityCode":}](Optional) */
170166
func (r *CalculateTotalPriceRequest) SetPromotionInfo(promotionInfo string) {
171167
r.PromotionInfo = &promotionInfo
172168
}
173-
174169
/* param clientType: 客户端:1.PC端;2.移动端;(Optional) */
175170
func (r *CalculateTotalPriceRequest) SetClientType(clientType int) {
176171
r.ClientType = &clientType
177172
}
178-
179173
/* param packageCount: 批量购买时数量(Required) */
180174
func (r *CalculateTotalPriceRequest) SetPackageCount(packageCount int) {
181175
r.PackageCount = packageCount
182176
}
183-
184177
/* param processType: 临时升配时必传,3-临时升配(Optional) */
185178
func (r *CalculateTotalPriceRequest) SetProcessType(processType int) {
186179
r.ProcessType = &processType
187180
}
188-
189181
/* param renewMode: 续费方式 0:正常续费 1:续费至统一到期日,续费时必传(Optional) */
190182
func (r *CalculateTotalPriceRequest) SetRenewMode(renewMode int) {
191183
r.RenewMode = &renewMode
192184
}
193-
194185
/* param unifyExpireDay: 续费统一到期日(1-28),续费时必传(Optional) */
195186
func (r *CalculateTotalPriceRequest) SetUnifyExpireDay(unifyExpireDay int) {
196187
r.UnifyExpireDay = &unifyExpireDay
197188
}
198-
199189
/* param totalPriceRule: 计算总价规则 1:计算预付费资源总价(计费类型为包年包月、按次) ;不传计算所有资源总价(Optional) */
200190
func (r *CalculateTotalPriceRequest) SetTotalPriceRule(totalPriceRule int) {
201191
r.TotalPriceRule = &totalPriceRule
202192
}
203193

194+
204195
// GetRegionId returns path parameter 'regionId' if exist,
205196
// otherwise return empty string
206197
func (r CalculateTotalPriceRequest) GetRegionId() string {
@@ -218,9 +209,15 @@ type CalculateTotalPriceResult struct {
218209
TotalPriceScale4 int `json:"totalPriceScale4"`
219210
DiscountedTotalPrice int `json:"discountedTotalPrice"`
220211
TotalDiscount int `json:"totalDiscount"`
212+
AfterFavorableTotalPrice float64 `json:"afterFavorableTotalPrice"`
213+
EraseTotalPrice float64 `json:"eraseTotalPrice"`
221214
List []billing.OrderPriceDetail `json:"list"`
222215
TotalOriginalPrice int `json:"totalOriginalPrice"`
223216
FavorableInfos string `json:"favorableInfos"`
224217
Remark string `json:"remark"`
225218
TotalUnitPrice int `json:"totalUnitPrice"`
219+
RefundTotalPrice float64 `json:"refundTotalPrice"`
220+
CashRefundTotalPrice float64 `json:"cashRefundTotalPrice"`
221+
BalanceRefundTotalPrice float64 `json:"balanceRefundTotalPrice"`
222+
CouponRefundTotalPrice float64 `json:"couponRefundTotalPrice"`
226223
}
Lines changed: 212 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,212 @@
1+
// Copyright 2018 JDCLOUD.COM
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
//
15+
// NOTE: This class is auto generated by the jdcloud code generator program.
16+
17+
package apis
18+
19+
import (
20+
"github.com/jdcloud-api/jdcloud-sdk-go/core"
21+
billing "github.com/jdcloud-api/jdcloud-sdk-go/services/billing/models"
22+
)
23+
24+
type DescribeBillDetailsRequest struct {
25+
26+
core.JDCloudRequest
27+
28+
/* Region ID */
29+
RegionId string `json:"regionId"`
30+
31+
/* 账期开始时间,不支持跨月查询。格式:yyyy-MM-dd HH:mm:ss */
32+
StartTime string `json:"startTime"`
33+
34+
/* 账期结束时间,不支持跨月查询。格式:yyyy-MM-dd HH:mm:ss */
35+
EndTime string `json:"endTime"`
36+
37+
/* 产品线代码 (Optional) */
38+
AppCode *string `json:"appCode"`
39+
40+
/* 产品代码 (Optional) */
41+
ServiceCode *string `json:"serviceCode"`
42+
43+
/* 计费类型 1、按配置 2、按用量 3、包年包月 4、按次 (Optional) */
44+
BillingType *int `json:"billingType"`
45+
46+
/* 资源单id列表,最多支持传入500个 (Optional) */
47+
ResourceIds []string `json:"resourceIds"`
48+
49+
/* 标签,JSON格式:[{"k1":"v1"},{"k1":"v2"},{"k2":""}]
50+
示例:
51+
选择的标签为, 部门:广告部、部门:物流部、项目
52+
则传值为:[{"部门":"广告部"},{"部门":"物流部"},{"项目":""}]
53+
(Optional) */
54+
Tags []interface{} `json:"tags"`
55+
56+
/* pageIndex 分页,默认从1开始 (Optional) */
57+
PageIndex *int `json:"pageIndex"`
58+
59+
/* pageSize 每页查询数据条数,最多支持1000条 (Optional) */
60+
PageSize *int `json:"pageSize"`
61+
}
62+
63+
/*
64+
* param regionId: Region ID (Required)
65+
* param startTime: 账期开始时间,不支持跨月查询。格式:yyyy-MM-dd HH:mm:ss (Required)
66+
* param endTime: 账期结束时间,不支持跨月查询。格式:yyyy-MM-dd HH:mm:ss (Required)
67+
*
68+
* @Deprecated, not compatible when mandatory parameters changed
69+
*/
70+
func NewDescribeBillDetailsRequest(
71+
regionId string,
72+
startTime string,
73+
endTime string,
74+
) *DescribeBillDetailsRequest {
75+
76+
return &DescribeBillDetailsRequest{
77+
JDCloudRequest: core.JDCloudRequest{
78+
URL: "/regions/{regionId}/describeBillDetails",
79+
Method: "POST",
80+
Header: nil,
81+
Version: "v1",
82+
},
83+
RegionId: regionId,
84+
StartTime: startTime,
85+
EndTime: endTime,
86+
}
87+
}
88+
89+
/*
90+
* param regionId: Region ID (Required)
91+
* param startTime: 账期开始时间,不支持跨月查询。格式:yyyy-MM-dd HH:mm:ss (Required)
92+
* param endTime: 账期结束时间,不支持跨月查询。格式:yyyy-MM-dd HH:mm:ss (Required)
93+
* param appCode: 产品线代码 (Optional)
94+
* param serviceCode: 产品代码 (Optional)
95+
* param billingType: 计费类型 1、按配置 2、按用量 3、包年包月 4、按次 (Optional)
96+
* param resourceIds: 资源单id列表,最多支持传入500个 (Optional)
97+
* param tags: 标签,JSON格式:[{"k1":"v1"},{"k1":"v2"},{"k2":""}]
98+
示例:
99+
选择的标签为, 部门:广告部、部门:物流部、项目
100+
则传值为:[{"部门":"广告部"},{"部门":"物流部"},{"项目":""}]
101+
(Optional)
102+
* param pageIndex: pageIndex 分页,默认从1开始 (Optional)
103+
* param pageSize: pageSize 每页查询数据条数,最多支持1000条 (Optional)
104+
*/
105+
func NewDescribeBillDetailsRequestWithAllParams(
106+
regionId string,
107+
startTime string,
108+
endTime string,
109+
appCode *string,
110+
serviceCode *string,
111+
billingType *int,
112+
resourceIds []string,
113+
tags []interface{},
114+
pageIndex *int,
115+
pageSize *int,
116+
) *DescribeBillDetailsRequest {
117+
118+
return &DescribeBillDetailsRequest{
119+
JDCloudRequest: core.JDCloudRequest{
120+
URL: "/regions/{regionId}/describeBillDetails",
121+
Method: "POST",
122+
Header: nil,
123+
Version: "v1",
124+
},
125+
RegionId: regionId,
126+
StartTime: startTime,
127+
EndTime: endTime,
128+
AppCode: appCode,
129+
ServiceCode: serviceCode,
130+
BillingType: billingType,
131+
ResourceIds: resourceIds,
132+
Tags: tags,
133+
PageIndex: pageIndex,
134+
PageSize: pageSize,
135+
}
136+
}
137+
138+
/* This constructor has better compatible ability when API parameters changed */
139+
func NewDescribeBillDetailsRequestWithoutParam() *DescribeBillDetailsRequest {
140+
141+
return &DescribeBillDetailsRequest{
142+
JDCloudRequest: core.JDCloudRequest{
143+
URL: "/regions/{regionId}/describeBillDetails",
144+
Method: "POST",
145+
Header: nil,
146+
Version: "v1",
147+
},
148+
}
149+
}
150+
151+
/* param regionId: Region ID(Required) */
152+
func (r *DescribeBillDetailsRequest) SetRegionId(regionId string) {
153+
r.RegionId = regionId
154+
}
155+
/* param startTime: 账期开始时间,不支持跨月查询。格式:yyyy-MM-dd HH:mm:ss(Required) */
156+
func (r *DescribeBillDetailsRequest) SetStartTime(startTime string) {
157+
r.StartTime = startTime
158+
}
159+
/* param endTime: 账期结束时间,不支持跨月查询。格式:yyyy-MM-dd HH:mm:ss(Required) */
160+
func (r *DescribeBillDetailsRequest) SetEndTime(endTime string) {
161+
r.EndTime = endTime
162+
}
163+
/* param appCode: 产品线代码(Optional) */
164+
func (r *DescribeBillDetailsRequest) SetAppCode(appCode string) {
165+
r.AppCode = &appCode
166+
}
167+
/* param serviceCode: 产品代码(Optional) */
168+
func (r *DescribeBillDetailsRequest) SetServiceCode(serviceCode string) {
169+
r.ServiceCode = &serviceCode
170+
}
171+
/* param billingType: 计费类型 1、按配置 2、按用量 3、包年包月 4、按次(Optional) */
172+
func (r *DescribeBillDetailsRequest) SetBillingType(billingType int) {
173+
r.BillingType = &billingType
174+
}
175+
/* param resourceIds: 资源单id列表,最多支持传入500个(Optional) */
176+
func (r *DescribeBillDetailsRequest) SetResourceIds(resourceIds []string) {
177+
r.ResourceIds = resourceIds
178+
}
179+
/* param tags: 标签,JSON格式:[{"k1":"v1"},{"k1":"v2"},{"k2":""}]
180+
示例:
181+
选择的标签为, 部门:广告部、部门:物流部、项目
182+
则传值为:[{"部门":"广告部"},{"部门":"物流部"},{"项目":""}]
183+
(Optional) */
184+
func (r *DescribeBillDetailsRequest) SetTags(tags []interface{}) {
185+
r.Tags = tags
186+
}
187+
/* param pageIndex: pageIndex 分页,默认从1开始(Optional) */
188+
func (r *DescribeBillDetailsRequest) SetPageIndex(pageIndex int) {
189+
r.PageIndex = &pageIndex
190+
}
191+
/* param pageSize: pageSize 每页查询数据条数,最多支持1000条(Optional) */
192+
func (r *DescribeBillDetailsRequest) SetPageSize(pageSize int) {
193+
r.PageSize = &pageSize
194+
}
195+
196+
197+
// GetRegionId returns path parameter 'regionId' if exist,
198+
// otherwise return empty string
199+
func (r DescribeBillDetailsRequest) GetRegionId() string {
200+
return r.RegionId
201+
}
202+
203+
type DescribeBillDetailsResponse struct {
204+
RequestID string `json:"requestId"`
205+
Error core.ErrorResponse `json:"error"`
206+
Result DescribeBillDetailsResult `json:"result"`
207+
}
208+
209+
type DescribeBillDetailsResult struct {
210+
Pagination billing.Pagination `json:"pagination"`
211+
Result []billing.BillSummaryV2 `json:"result"`
212+
}

0 commit comments

Comments
 (0)