Skip to content

Commit 669bf8e

Browse files
author
Joshua Yin
committed
* api-切换账号计费方式
1 parent db3895f commit 669bf8e

File tree

3 files changed

+76
-0
lines changed

3 files changed

+76
-0
lines changed

ucloud-sdk-java-ucdn/src/main/java/cn/ucloud/ucdn/client/DefaultUcdnClient.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import cn.ucloud.common.handler.UcloudHandler;
55
import cn.ucloud.common.http.UcloudHttp;
66
import cn.ucloud.common.http.UcloudHttpImpl;
7+
import cn.ucloud.common.pojo.BaseResponseResult;
78
import cn.ucloud.ucdn.model.*;
89
import cn.ucloud.ucdn.pojo.UcdnConfig;
910

@@ -273,4 +274,19 @@ public void refreshNewUcdnDomainCache(RefreshNewUcdnDomainCacheParam param, Uclo
273274
} catch (Exception e) {
274275
}
275276
}
277+
278+
@Override
279+
public BaseResponseResult switchUcdnChargeType(SwitchUcdnChargeTypeParam param) throws Exception {
280+
UcloudHttp http = new UcloudHttpImpl(BaseResponseResult.class);
281+
return (BaseResponseResult) http.doGet(param, config, null);
282+
}
283+
284+
@Override
285+
public void switchUcdnChargeType(SwitchUcdnChargeTypeParam param, UcloudHandler<BaseResponseResult> handler, Boolean... asyncFlag) {
286+
UcloudHttp http = new UcloudHttpImpl(BaseResponseResult.class);
287+
try {
288+
http.doGet(param, config, handler, asyncFlag);
289+
} catch (Exception e) {
290+
}
291+
}
276292
}

ucloud-sdk-java-ucdn/src/main/java/cn/ucloud/ucdn/client/UcdnClient.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import cn.ucloud.common.client.UcloudClient;
44
import cn.ucloud.common.handler.UcloudHandler;
55
import cn.ucloud.common.pojo.BaseRequestParam;
6+
import cn.ucloud.common.pojo.BaseResponseResult;
67
import cn.ucloud.ucdn.model.*;
78

89
/**
@@ -319,4 +320,22 @@ public interface UcdnClient extends UcloudClient {
319320
* @param asyncFlag 异步标记,默认异步true
320321
*/
321322
void refreshNewUcdnDomainCache(RefreshNewUcdnDomainCacheParam param, UcloudHandler<RefreshNewUcdnDomainCacheResult> handler, Boolean... asyncFlag);
323+
324+
/**
325+
* 切换账号计费方式
326+
*
327+
* @param param 参数对象
328+
* @return 结果对象
329+
* @throws Exception 出错则抛出异常
330+
*/
331+
BaseResponseResult switchUcdnChargeType(SwitchUcdnChargeTypeParam param) throws Exception;
332+
333+
/**
334+
* 切换账号计费方式
335+
*
336+
* @param param 参数对象
337+
* @param handler 回调处理器
338+
* @param asyncFlag 异步标记,默认异步true
339+
*/
340+
void switchUcdnChargeType(SwitchUcdnChargeTypeParam param, UcloudHandler<BaseResponseResult> handler, Boolean... asyncFlag);
322341
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
package cn.ucloud.ucdn.model;
2+
3+
import cn.ucloud.common.annotation.UcloudParam;
4+
import cn.ucloud.common.pojo.BaseRequestParam;
5+
import cn.ucloud.common.pojo.Param;
6+
7+
import javax.validation.ValidationException;
8+
import javax.validation.constraints.NotEmpty;
9+
import javax.validation.constraints.NotNull;
10+
import java.util.ArrayList;
11+
import java.util.List;
12+
13+
14+
/**
15+
* @description: 切换账号计费方式 param
16+
* @author: joshua
17+
* @E-mail: [email protected]
18+
* @date: 2020/8/6 15:59
19+
*/
20+
public class SwitchUcdnChargeTypeParam extends BaseRequestParam {
21+
22+
/**
23+
* 计费方式。traffic代表按流量包计费,bandwidth按带宽付费
24+
*/
25+
@UcloudParam("ChargeType")
26+
@NotEmpty(message = "ChargeType can not be empty")
27+
private String chargeType;
28+
29+
public SwitchUcdnChargeTypeParam(@NotEmpty(message = "ChargeType can not be empty") String chargeType) {
30+
super("SwitchUcdnChargeType");
31+
this.chargeType = chargeType;
32+
}
33+
34+
public String getChargeType() {
35+
return chargeType;
36+
}
37+
38+
public void setChargeType(String chargeType) {
39+
this.chargeType = chargeType;
40+
}
41+
}

0 commit comments

Comments
 (0)