Skip to content

Commit

Permalink
release 3.0.17-beta source code for java
Browse files Browse the repository at this point in the history
  • Loading branch information
Huaweicloud-SDK committed Oct 14, 2020
1 parent ccf4824 commit 2342973
Show file tree
Hide file tree
Showing 245 changed files with 27,175 additions and 2,128 deletions.
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
## 3.0.17-beta 2020-10-14
## HuaweiCloud SDK Bss
- ### Features
- Partner center supports exporting product catalog prices.
- ### Bug Fix
- None
- ### Change
- None

## HuaweiCloud SDK Dcs
- ### Features
- Support more interfaces.
- ### Bug Fix
- None
- ### Change
- None

## HuaweiCloud SDK Live
- ### Features
- Support more interfaces of version v2 of Live.
- ### Bug Fix
- None
- ### Change
- None


## 3.0.16-beta 2020-10-12
## HuaweiCloud SDK CTS
- ### Features
Expand Down
26 changes: 26 additions & 0 deletions CHANGELOG_CN.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
## 3.0.17-beta 2020-10-14
## HuaweiCloud SDK Bss
- ### 新增特性
- 伙伴中心支持导出产品目录价
- ### 解决问题
-
- ### 特性变更
-

## HuaweiCloud SDK Dcs
- ### 新增特性
- 增加支持接口
- ### 解决问题
-
- ### 特性变更
-

## HuaweiCloud SDK Live
- ### 新增特性
- 新增直播V2接口
- ### 解决问题
-
- ### 特性变更
-


## 3.0.16-beta 2020-10-12
## HuaweiCloud SDK CTS
- ### 新增特性
Expand Down
4 changes: 2 additions & 2 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

<parent>
<groupId>com.huaweicloud.sdk</groupId>
<version>3.0.16-beta</version>
<version>3.0.17-beta</version>
<artifactId>huaweicloud-sdk</artifactId>
</parent>

<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
<artifactId>huaweicloud-sdk-core</artifactId>
<version>3.0.16-beta</version>
<version>3.0.17-beta</version>
<name>Huaweicloud SDK for Java Core</name>
<description>Core code for Huaweicloud SDK for Java</description>
<url>https://github.com/huaweicloud/huaweicloud-sdk-java-v3</url>
Expand Down
31 changes: 28 additions & 3 deletions core/src/main/java/com/huaweicloud/sdk/core/HcClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.huaweicloud.sdk.core.auth.ICredential;
import com.huaweicloud.sdk.core.exception.SdkErrorMessage;
Expand Down Expand Up @@ -124,11 +125,11 @@ public <ReqT, ResT> CompletableFuture<ResT> asyncInvokeHttp(ReqT request, HttpRe
validHttpRequestStage = credential.processAuthRequest(httpRequest, this.httpClient);
}
return validHttpRequestStage
.thenCompose(vaildHttpRequest -> httpClient.asyncInvokeHttp(vaildHttpRequest).thenApply(httpResponse -> {
printAccessLog(vaildHttpRequest, httpResponse);
.thenCompose(validHttpRequest -> httpClient.asyncInvokeHttp(validHttpRequest).thenApply(httpResponse -> {
printAccessLog(validHttpRequest, httpResponse);
if (httpResponse.getStatusCode() >= STATUS_CODE_WITH_RESPONSE_ERROR) {
logger.error("ServiceResponseException occurred. Host: {} Uri: {} ServiceResponseException: {}",
vaildHttpRequest.getUrl().getHost(), vaildHttpRequest.getUrl(),
validHttpRequest.getUrl().getHost(), validHttpRequest.getUrl(),
extractErrorMessage(httpResponse));
throw ServiceResponseException.mapException(httpResponse.getStatusCode(),
extractErrorMessage(httpResponse));
Expand Down Expand Up @@ -254,6 +255,8 @@ private <ReqT, ResT> ResT extractResponse(HttpResponse httpResponse, HttpRequest
if (resT instanceof SdkResponse) {
SdkResponse sdkResponse = (SdkResponse) resT;
sdkResponse.setHttpStatusCode(httpResponse.getStatusCode());
// reflect header parameter in response.
setResponseHeaders(httpResponse, sdkResponse);
}
return resT;
} catch (InstantiationException | IllegalAccessException e) {
Expand All @@ -266,6 +269,28 @@ private <ReqT, ResT> ResT extractResponse(HttpResponse httpResponse, HttpRequest
}
}

private <ResT> void setResponseHeaders(HttpResponse httpResponse, ResT resT) {
if (httpResponse.getHeaders().size() == 0) {
return;
}
try {
java.lang.reflect.Field[] fields = resT.getClass().getDeclaredFields();
for (java.lang.reflect.Field field : fields) {
boolean fieldHasAno = field.isAnnotationPresent(JsonProperty.class);
if (fieldHasAno) {
JsonProperty fieldProperty = field.getAnnotation(JsonProperty.class);
String jsonValue = fieldProperty.value();
if (Objects.nonNull(httpResponse.getHeader(jsonValue))) {
field.setAccessible(true);
field.set(resT, httpResponse.getHeader(jsonValue));
}
}
}
} catch (IllegalAccessException e) {
throw new SdkException(e);
}
}

public <ResT> Object responseToObject(String respBody, Field<ResT, ?> responseField) {
Object obj;
if (responseField.getFieldType().isAssignableFrom(List.class)) {
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<packaging>pom</packaging>
<groupId>com.huaweicloud.sdk</groupId>
<artifactId>huaweicloud-sdk</artifactId>
<version>3.0.16-beta</version>
<version>3.0.17-beta</version>
<name>Huaweicloud SDK for Java</name>
<description>Huaweicloud SDK for Java</description>
<url>https://github.com/huaweicloud/huaweicloud-sdk-java-v3</url>
Expand Down Expand Up @@ -48,7 +48,7 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<revision>3.0.16-beta</revision>
<revision>3.0.17-beta</revision>
<jackson.version>2.11.1</jackson.version>
<validation-api.version>2.0.1.Final</validation-api.version>
<okhttp.version>3.14.2</okhttp.version>
Expand Down
4 changes: 2 additions & 2 deletions services/apig/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.huaweicloud.sdk</groupId>
<version>3.0.16-beta</version>
<version>3.0.17-beta</version>
<artifactId>huaweicloud-sdk-services</artifactId>
<relativePath>..</relativePath>
</parent>
<groupId>com.huaweicloud.sdk</groupId>
<artifactId>huaweicloud-sdk-apig</artifactId>
<version>3.0.16-beta</version>
<version>3.0.17-beta</version>
<name>huaweicloud sdk apig</name>

<modelVersion>4.0.0</modelVersion>
Expand Down
4 changes: 2 additions & 2 deletions services/as/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.huaweicloud.sdk</groupId>
<version>3.0.16-beta</version>
<version>3.0.17-beta</version>
<artifactId>huaweicloud-sdk-services</artifactId>
<relativePath>..</relativePath>
</parent>
<groupId>com.huaweicloud.sdk</groupId>
<artifactId>huaweicloud-sdk-as</artifactId>
<version>3.0.16-beta</version>
<version>3.0.17-beta</version>
<name>huaweicloud sdk as</name>

<modelVersion>4.0.0</modelVersion>
Expand Down
4 changes: 2 additions & 2 deletions services/bss/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.huaweicloud.sdk</groupId>
<version>3.0.16-beta</version>
<version>3.0.17-beta</version>
<artifactId>huaweicloud-sdk-services</artifactId>
<relativePath>..</relativePath>
</parent>
<groupId>com.huaweicloud.sdk</groupId>
<artifactId>huaweicloud-sdk-bss</artifactId>
<version>3.0.16-beta</version>
<version>3.0.17-beta</version>
<name>huaweicloud sdk bss</name>

<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,17 @@ public CompletableFuture<ListCouponQuotasRecordsResponse> listCouponQuotasRecord
return hcClient.asyncInvokeHttp(request, BssMeta.listCouponQuotasRecords);
}

/**
* 查询流水账单
* 功能描述:客户在客户自建平台查询自己的流水账单
*
* @param ListCustomerBillsFeeRecordsRequest 请求对象
* @return CompletableFuture<ListCustomerBillsFeeRecordsResponse>
*/
public CompletableFuture<ListCustomerBillsFeeRecordsResponse> listCustomerBillsFeeRecordsAsync(ListCustomerBillsFeeRecordsRequest request) {
return hcClient.asyncInvokeHttp(request, BssMeta.listCustomerBillsFeeRecords);
}

/**
* 查询客户按需资源列表
* 功能描述:查询客户按需资源列表
Expand Down Expand Up @@ -283,6 +294,28 @@ public CompletableFuture<ListEnterpriseMultiAccountResponse> listEnterpriseMulti
return hcClient.asyncInvokeHttp(request, BssMeta.listEnterpriseMultiAccount);
}

/**
* 查询企业组织结构
* 功能描述:企业主账号在客户自建平台查询企业组织结构
*
* @param ListEnterpriseOrganizationsRequest 请求对象
* @return CompletableFuture<ListEnterpriseOrganizationsResponse>
*/
public CompletableFuture<ListEnterpriseOrganizationsResponse> listEnterpriseOrganizationsAsync(ListEnterpriseOrganizationsRequest request) {
return hcClient.asyncInvokeHttp(request, BssMeta.listEnterpriseOrganizations);
}

/**
* 查询企业子账号列表
* 功能描述:企业主账号在客户自建平台查询企业子账号信息列表
*
* @param ListEnterpriseSubCustomersRequest 请求对象
* @return CompletableFuture<ListEnterpriseSubCustomersResponse>
*/
public CompletableFuture<ListEnterpriseSubCustomersResponse> listEnterpriseSubCustomersAsync(ListEnterpriseSubCustomersRequest request) {
return hcClient.asyncInvokeHttp(request, BssMeta.listEnterpriseSubCustomers);
}

/**
* 查询精英服务商列表
* 功能描述:查询精英服务商列表
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,17 @@ public ListCouponQuotasRecordsResponse listCouponQuotasRecords(ListCouponQuotasR
return hcClient.syncInvokeHttp(request, BssMeta.listCouponQuotasRecords);
}

/**
* 查询流水账单
* 功能描述:客户在客户自建平台查询自己的流水账单
*
* @param ListCustomerBillsFeeRecordsRequest 请求对象
* @return ListCustomerBillsFeeRecordsResponse
*/
public ListCustomerBillsFeeRecordsResponse listCustomerBillsFeeRecords(ListCustomerBillsFeeRecordsRequest request) {
return hcClient.syncInvokeHttp(request, BssMeta.listCustomerBillsFeeRecords);
}

/**
* 查询客户按需资源列表
* 功能描述:查询客户按需资源列表
Expand Down Expand Up @@ -280,6 +291,28 @@ public ListEnterpriseMultiAccountResponse listEnterpriseMultiAccount(ListEnterpr
return hcClient.syncInvokeHttp(request, BssMeta.listEnterpriseMultiAccount);
}

/**
* 查询企业组织结构
* 功能描述:企业主账号在客户自建平台查询企业组织结构
*
* @param ListEnterpriseOrganizationsRequest 请求对象
* @return ListEnterpriseOrganizationsResponse
*/
public ListEnterpriseOrganizationsResponse listEnterpriseOrganizations(ListEnterpriseOrganizationsRequest request) {
return hcClient.syncInvokeHttp(request, BssMeta.listEnterpriseOrganizations);
}

/**
* 查询企业子账号列表
* 功能描述:企业主账号在客户自建平台查询企业子账号信息列表
*
* @param ListEnterpriseSubCustomersRequest 请求对象
* @return ListEnterpriseSubCustomersResponse
*/
public ListEnterpriseSubCustomersResponse listEnterpriseSubCustomers(ListEnterpriseSubCustomersRequest request) {
return hcClient.syncInvokeHttp(request, BssMeta.listEnterpriseSubCustomers);
}

/**
* 查询精英服务商列表
* 功能描述:查询精英服务商列表
Expand Down
Loading

0 comments on commit 2342973

Please sign in to comment.