Skip to content

Commit 9e727fc

Browse files
author
BitsAdmin
committed
Merge branch 'cdn-Java-2021-03-01-online-1016-2025_03_10_17_14_03' into 'integration_2025-03-20_797631155970'
feat: [development task] CDN-1016-Java (1094075) See merge request iaasng/volcengine-java-sdk!413
2 parents fce4882 + 44bc51e commit 9e727fc

File tree

5 files changed

+672
-2
lines changed

5 files changed

+672
-2
lines changed

volcengine-java-sdk-cdn/src/main/java/com/volcengine/cdn/CdnApi.java

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@
5151
import com.volcengine.cdn.model.DeleteSharedConfigResponse;
5252
import com.volcengine.cdn.model.DeleteUsageReportRequest;
5353
import com.volcengine.cdn.model.DeleteUsageReportResponse;
54+
import com.volcengine.cdn.model.DescribeBillingDetailRequest;
55+
import com.volcengine.cdn.model.DescribeBillingDetailResponse;
5456
import com.volcengine.cdn.model.DescribeCdnAccessLogRequest;
5557
import com.volcengine.cdn.model.DescribeCdnAccessLogResponse;
5658
import com.volcengine.cdn.model.DescribeCdnConfigRequest;
@@ -1645,6 +1647,130 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don
16451647
apiClient.executeAsync(call, localVarReturnType, callback);
16461648
return call;
16471649
}
1650+
/**
1651+
* Build call for describeBillingDetail
1652+
* @param body (required)
1653+
* @param progressListener Progress listener
1654+
* @param progressRequestListener Progress request listener
1655+
* @return Call to execute
1656+
* @throws ApiException If fail to serialize the request body object
1657+
*/
1658+
public com.squareup.okhttp.Call describeBillingDetailCall(DescribeBillingDetailRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
1659+
Object localVarPostBody = body;
1660+
1661+
// create path and map variables
1662+
String localVarPath = "/DescribeBillingDetail/2021-03-01/cdn/post/application_json/";
1663+
1664+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
1665+
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
1666+
1667+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
1668+
1669+
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
1670+
1671+
final String[] localVarAccepts = {
1672+
"application/json"
1673+
};
1674+
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
1675+
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
1676+
1677+
final String[] localVarContentTypes = {
1678+
"text/plain"
1679+
};
1680+
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
1681+
localVarHeaderParams.put("Content-Type", localVarContentType);
1682+
1683+
if(progressListener != null) {
1684+
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
1685+
@Override
1686+
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
1687+
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
1688+
return originalResponse.newBuilder()
1689+
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
1690+
.build();
1691+
}
1692+
});
1693+
}
1694+
1695+
String[] localVarAuthNames = new String[] { "volcengineSign" };
1696+
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
1697+
}
1698+
1699+
@SuppressWarnings("rawtypes")
1700+
private com.squareup.okhttp.Call describeBillingDetailValidateBeforeCall(DescribeBillingDetailRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
1701+
// verify the required parameter 'body' is set
1702+
if (body == null) {
1703+
throw new ApiException("Missing the required parameter 'body' when calling describeBillingDetail(Async)");
1704+
}
1705+
1706+
com.squareup.okhttp.Call call = describeBillingDetailCall(body, progressListener, progressRequestListener);
1707+
return call;
1708+
1709+
1710+
1711+
1712+
1713+
}
1714+
1715+
/**
1716+
*
1717+
*
1718+
* @param body (required)
1719+
* @return DescribeBillingDetailResponse
1720+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
1721+
*/
1722+
public DescribeBillingDetailResponse describeBillingDetail(DescribeBillingDetailRequest body) throws ApiException {
1723+
ApiResponse<DescribeBillingDetailResponse> resp = describeBillingDetailWithHttpInfo(body);
1724+
return resp.getData();
1725+
}
1726+
1727+
/**
1728+
*
1729+
*
1730+
* @param body (required)
1731+
* @return ApiResponse&lt;DescribeBillingDetailResponse&gt;
1732+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
1733+
*/
1734+
public ApiResponse<DescribeBillingDetailResponse> describeBillingDetailWithHttpInfo( @NotNull DescribeBillingDetailRequest body) throws ApiException {
1735+
com.squareup.okhttp.Call call = describeBillingDetailValidateBeforeCall(body, null, null);
1736+
Type localVarReturnType = new TypeToken<DescribeBillingDetailResponse>(){}.getType();
1737+
return apiClient.execute(call, localVarReturnType);
1738+
}
1739+
1740+
/**
1741+
* (asynchronously)
1742+
*
1743+
* @param body (required)
1744+
* @param callback The callback to be executed when the API call finishes
1745+
* @return The request call
1746+
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
1747+
*/
1748+
public com.squareup.okhttp.Call describeBillingDetailAsync(DescribeBillingDetailRequest body, final ApiCallback<DescribeBillingDetailResponse> callback) throws ApiException {
1749+
1750+
ProgressResponseBody.ProgressListener progressListener = null;
1751+
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
1752+
1753+
if (callback != null) {
1754+
progressListener = new ProgressResponseBody.ProgressListener() {
1755+
@Override
1756+
public void update(long bytesRead, long contentLength, boolean done) {
1757+
callback.onDownloadProgress(bytesRead, contentLength, done);
1758+
}
1759+
};
1760+
1761+
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
1762+
@Override
1763+
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
1764+
callback.onUploadProgress(bytesWritten, contentLength, done);
1765+
}
1766+
};
1767+
}
1768+
1769+
com.squareup.okhttp.Call call = describeBillingDetailValidateBeforeCall(body, progressListener, progressRequestListener);
1770+
Type localVarReturnType = new TypeToken<DescribeBillingDetailResponse>(){}.getType();
1771+
apiClient.executeAsync(call, localVarReturnType, callback);
1772+
return call;
1773+
}
16481774
/**
16491775
* Build call for describeCdnAccessLog
16501776
* @param body (required)

volcengine-java-sdk-cdn/src/main/java/com/volcengine/cdn/model/AddCdnDomainResponse.java

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@
1414

1515
import java.util.Objects;
1616
import java.util.Arrays;
17+
import com.google.gson.TypeAdapter;
18+
import com.google.gson.annotations.JsonAdapter;
19+
import com.google.gson.annotations.SerializedName;
20+
import com.google.gson.stream.JsonReader;
21+
import com.google.gson.stream.JsonWriter;
22+
import io.swagger.v3.oas.annotations.media.Schema;
23+
import java.io.IOException;
24+
import java.util.ArrayList;
25+
import java.util.List;
1726
import javax.validation.constraints.*;
1827
import javax.validation.Valid;
1928
/**
@@ -23,6 +32,35 @@
2332

2433

2534
public class AddCdnDomainResponse extends com.volcengine.model.AbstractResponse {
35+
@SerializedName("ResourceIds")
36+
private List<String> resourceIds = null;
37+
38+
public AddCdnDomainResponse resourceIds(List<String> resourceIds) {
39+
this.resourceIds = resourceIds;
40+
return this;
41+
}
42+
43+
public AddCdnDomainResponse addResourceIdsItem(String resourceIdsItem) {
44+
if (this.resourceIds == null) {
45+
this.resourceIds = new ArrayList<String>();
46+
}
47+
this.resourceIds.add(resourceIdsItem);
48+
return this;
49+
}
50+
51+
/**
52+
* Get resourceIds
53+
* @return resourceIds
54+
**/
55+
@Schema(description = "")
56+
public List<String> getResourceIds() {
57+
return resourceIds;
58+
}
59+
60+
public void setResourceIds(List<String> resourceIds) {
61+
this.resourceIds = resourceIds;
62+
}
63+
2664

2765
@Override
2866
public boolean equals(java.lang.Object o) {
@@ -32,12 +70,13 @@ public boolean equals(java.lang.Object o) {
3270
if (o == null || getClass() != o.getClass()) {
3371
return false;
3472
}
35-
return true;
73+
AddCdnDomainResponse addCdnDomainResponse = (AddCdnDomainResponse) o;
74+
return Objects.equals(this.resourceIds, addCdnDomainResponse.resourceIds);
3675
}
3776

3877
@Override
3978
public int hashCode() {
40-
return Objects.hash();
79+
return Objects.hash(resourceIds);
4180
}
4281

4382

@@ -46,6 +85,7 @@ public String toString() {
4685
StringBuilder sb = new StringBuilder();
4786
sb.append("class AddCdnDomainResponse {\n");
4887

88+
sb.append(" resourceIds: ").append(toIndentedString(resourceIds)).append("\n");
4989
sb.append("}");
5090
return sb.toString();
5191
}

0 commit comments

Comments
 (0)