GeezerVison is showing github.com — * api-切换账号计费方式 · ucloud/ucloud-sdk-java@669bf8e
File tree
Expand file treeCollapse file tree
Open diff view settings
ucloud-sdk-java-ucdn/src/main/java/cn/ucloud/ucdn
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: ucloud-sdk-java-ucdn/src/main/java/cn/ucloud/ucdn/client/DefaultUcdnClient.java +16Lines changed: 16 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
4 | 4 | import cn.ucloud.common.handler.UcloudHandler; |
5 | 5 | import cn.ucloud.common.http.UcloudHttp; |
6 | 6 | import cn.ucloud.common.http.UcloudHttpImpl; |
| 7 | +import cn.ucloud.common.pojo.BaseResponseResult; |
7 | 8 | import cn.ucloud.ucdn.model.*; |
8 | 9 | import cn.ucloud.ucdn.pojo.UcdnConfig; |
9 | 10 |
|
@@ -273,4 +274,19 @@ public void refreshNewUcdnDomainCache(RefreshNewUcdnDomainCacheParam param, Uclo |
273 | 274 | } catch (Exception e) { |
274 | 275 | } |
275 | 276 | } |
| 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 | + } |
276 | 292 | } |
Collapse file
Copy file name to clipboardExpand all lines: ucloud-sdk-java-ucdn/src/main/java/cn/ucloud/ucdn/client/UcdnClient.java +19Lines changed: 19 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
3 | 3 | import cn.ucloud.common.client.UcloudClient; |
4 | 4 | import cn.ucloud.common.handler.UcloudHandler; |
5 | 5 | import cn.ucloud.common.pojo.BaseRequestParam; |
| 6 | +import cn.ucloud.common.pojo.BaseResponseResult; |
6 | 7 | import cn.ucloud.ucdn.model.*; |
7 | 8 |
|
8 | 9 | /** |
@@ -319,4 +320,22 @@ public interface UcdnClient extends UcloudClient { |
319 | 320 | * @param asyncFlag 异步标记,默认异步true |
320 | 321 | */ |
321 | 322 | 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); |
322 | 341 | } |
Collapse file
Copy file name to clipboard +41Lines changed: 41 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
| 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 | + |
| 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 | +} |