Skip to content

Commit 3c79ae4

Browse files
author
BitsAdmin
committed
Merge branch 'mcdn-Java-2022-03-01-online-1487-2025_08_27_14_53_48' into 'integration_2025-08-28_1042083431682'
feat: [development task] mcdn-1487-Java (1602210) See merge request iaasng/volcengine-java-sdk!628
2 parents aebb0ed + 0b27865 commit 3c79ae4

27 files changed

+2840
-17
lines changed

volcengine-java-sdk-mcdn/src/main/java/com/volcengine/mcdn/McdnApi.java

Lines changed: 252 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@
4141
import com.volcengine.mcdn.model.DescribeCdnOriginDataOfflineResponse;
4242
import com.volcengine.mcdn.model.DescribeCdnRegionAndIspRequest;
4343
import com.volcengine.mcdn.model.DescribeCdnRegionAndIspResponse;
44+
import com.volcengine.mcdn.model.DescribeCdnTopIpRequest;
45+
import com.volcengine.mcdn.model.DescribeCdnTopIpResponse;
46+
import com.volcengine.mcdn.model.DescribeCdnTopUrlRequest;
47+
import com.volcengine.mcdn.model.DescribeCdnTopUrlResponse;
4448
import com.volcengine.mcdn.model.DescribeContentQuotaRequest;
4549
import com.volcengine.mcdn.model.DescribeContentQuotaResponse;
4650
import com.volcengine.mcdn.model.DescribeContentTaskByTaskIdRequest;
@@ -973,6 +977,254 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don
973977
apiClient.executeAsync(call, localVarReturnType, callback);
974978
return call;
975979
}
980+
/**
981+
* Build call for describeCdnTopIp
982+
* @param body (required)
983+
* @param progressListener Progress listener
984+
* @param progressRequestListener Progress request listener
985+
* @return Call to execute
986+
* @throws ApiException If fail to serialize the request body object
987+
*/
988+
public com.squareup.okhttp.Call describeCdnTopIpCall(DescribeCdnTopIpRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
989+
Object localVarPostBody = body;
990+
991+
// create path and map variables
992+
String localVarPath = "/DescribeCdnTopIp/2022-03-01/mcdn/post/application_json/";
993+
994+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
995+
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
996+
997+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
998+
999+
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
1000+
1001+
final String[] localVarAccepts = {
1002+
"application/json"
1003+
};
1004+
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
1005+
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
1006+
1007+
final String[] localVarContentTypes = {
1008+
"text/plain"
1009+
};
1010+
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
1011+
localVarHeaderParams.put("Content-Type", localVarContentType);
1012+
1013+
if(progressListener != null) {
1014+
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
1015+
@Override
1016+
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
1017+
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
1018+
return originalResponse.newBuilder()
1019+
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
1020+
.build();
1021+
}
1022+
});
1023+
}
1024+
1025+
String[] localVarAuthNames = new String[] { "volcengineSign" };
1026+
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
1027+
}
1028+
1029+
@SuppressWarnings("rawtypes")
1030+
private com.squareup.okhttp.Call describeCdnTopIpValidateBeforeCall(DescribeCdnTopIpRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
1031+
// verify the required parameter 'body' is set
1032+
if (body == null) {
1033+
throw new ApiException("Missing the required parameter 'body' when calling describeCdnTopIp(Async)");
1034+
}
1035+
1036+
com.squareup.okhttp.Call call = describeCdnTopIpCall(body, progressListener, progressRequestListener);
1037+
return call;
1038+
1039+
1040+
1041+
1042+
1043+
}
1044+
1045+
/**
1046+
*
1047+
*
1048+
* @param body (required)
1049+
* @return DescribeCdnTopIpResponse
1050+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
1051+
*/
1052+
public DescribeCdnTopIpResponse describeCdnTopIp(DescribeCdnTopIpRequest body) throws ApiException {
1053+
ApiResponse<DescribeCdnTopIpResponse> resp = describeCdnTopIpWithHttpInfo(body);
1054+
return resp.getData();
1055+
}
1056+
1057+
/**
1058+
*
1059+
*
1060+
* @param body (required)
1061+
* @return ApiResponse&lt;DescribeCdnTopIpResponse&gt;
1062+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
1063+
*/
1064+
public ApiResponse<DescribeCdnTopIpResponse> describeCdnTopIpWithHttpInfo( @NotNull DescribeCdnTopIpRequest body) throws ApiException {
1065+
com.squareup.okhttp.Call call = describeCdnTopIpValidateBeforeCall(body, null, null);
1066+
Type localVarReturnType = new TypeToken<DescribeCdnTopIpResponse>(){}.getType();
1067+
return apiClient.execute(call, localVarReturnType);
1068+
}
1069+
1070+
/**
1071+
* (asynchronously)
1072+
*
1073+
* @param body (required)
1074+
* @param callback The callback to be executed when the API call finishes
1075+
* @return The request call
1076+
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
1077+
*/
1078+
public com.squareup.okhttp.Call describeCdnTopIpAsync(DescribeCdnTopIpRequest body, final ApiCallback<DescribeCdnTopIpResponse> callback) throws ApiException {
1079+
1080+
ProgressResponseBody.ProgressListener progressListener = null;
1081+
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
1082+
1083+
if (callback != null) {
1084+
progressListener = new ProgressResponseBody.ProgressListener() {
1085+
@Override
1086+
public void update(long bytesRead, long contentLength, boolean done) {
1087+
callback.onDownloadProgress(bytesRead, contentLength, done);
1088+
}
1089+
};
1090+
1091+
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
1092+
@Override
1093+
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
1094+
callback.onUploadProgress(bytesWritten, contentLength, done);
1095+
}
1096+
};
1097+
}
1098+
1099+
com.squareup.okhttp.Call call = describeCdnTopIpValidateBeforeCall(body, progressListener, progressRequestListener);
1100+
Type localVarReturnType = new TypeToken<DescribeCdnTopIpResponse>(){}.getType();
1101+
apiClient.executeAsync(call, localVarReturnType, callback);
1102+
return call;
1103+
}
1104+
/**
1105+
* Build call for describeCdnTopUrl
1106+
* @param body (required)
1107+
* @param progressListener Progress listener
1108+
* @param progressRequestListener Progress request listener
1109+
* @return Call to execute
1110+
* @throws ApiException If fail to serialize the request body object
1111+
*/
1112+
public com.squareup.okhttp.Call describeCdnTopUrlCall(DescribeCdnTopUrlRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
1113+
Object localVarPostBody = body;
1114+
1115+
// create path and map variables
1116+
String localVarPath = "/DescribeCdnTopUrl/2022-03-01/mcdn/post/application_json/";
1117+
1118+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
1119+
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
1120+
1121+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
1122+
1123+
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
1124+
1125+
final String[] localVarAccepts = {
1126+
"application/json"
1127+
};
1128+
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
1129+
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
1130+
1131+
final String[] localVarContentTypes = {
1132+
"text/plain"
1133+
};
1134+
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
1135+
localVarHeaderParams.put("Content-Type", localVarContentType);
1136+
1137+
if(progressListener != null) {
1138+
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
1139+
@Override
1140+
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
1141+
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
1142+
return originalResponse.newBuilder()
1143+
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
1144+
.build();
1145+
}
1146+
});
1147+
}
1148+
1149+
String[] localVarAuthNames = new String[] { "volcengineSign" };
1150+
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
1151+
}
1152+
1153+
@SuppressWarnings("rawtypes")
1154+
private com.squareup.okhttp.Call describeCdnTopUrlValidateBeforeCall(DescribeCdnTopUrlRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
1155+
// verify the required parameter 'body' is set
1156+
if (body == null) {
1157+
throw new ApiException("Missing the required parameter 'body' when calling describeCdnTopUrl(Async)");
1158+
}
1159+
1160+
com.squareup.okhttp.Call call = describeCdnTopUrlCall(body, progressListener, progressRequestListener);
1161+
return call;
1162+
1163+
1164+
1165+
1166+
1167+
}
1168+
1169+
/**
1170+
*
1171+
*
1172+
* @param body (required)
1173+
* @return DescribeCdnTopUrlResponse
1174+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
1175+
*/
1176+
public DescribeCdnTopUrlResponse describeCdnTopUrl(DescribeCdnTopUrlRequest body) throws ApiException {
1177+
ApiResponse<DescribeCdnTopUrlResponse> resp = describeCdnTopUrlWithHttpInfo(body);
1178+
return resp.getData();
1179+
}
1180+
1181+
/**
1182+
*
1183+
*
1184+
* @param body (required)
1185+
* @return ApiResponse&lt;DescribeCdnTopUrlResponse&gt;
1186+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
1187+
*/
1188+
public ApiResponse<DescribeCdnTopUrlResponse> describeCdnTopUrlWithHttpInfo( @NotNull DescribeCdnTopUrlRequest body) throws ApiException {
1189+
com.squareup.okhttp.Call call = describeCdnTopUrlValidateBeforeCall(body, null, null);
1190+
Type localVarReturnType = new TypeToken<DescribeCdnTopUrlResponse>(){}.getType();
1191+
return apiClient.execute(call, localVarReturnType);
1192+
}
1193+
1194+
/**
1195+
* (asynchronously)
1196+
*
1197+
* @param body (required)
1198+
* @param callback The callback to be executed when the API call finishes
1199+
* @return The request call
1200+
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
1201+
*/
1202+
public com.squareup.okhttp.Call describeCdnTopUrlAsync(DescribeCdnTopUrlRequest body, final ApiCallback<DescribeCdnTopUrlResponse> callback) throws ApiException {
1203+
1204+
ProgressResponseBody.ProgressListener progressListener = null;
1205+
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
1206+
1207+
if (callback != null) {
1208+
progressListener = new ProgressResponseBody.ProgressListener() {
1209+
@Override
1210+
public void update(long bytesRead, long contentLength, boolean done) {
1211+
callback.onDownloadProgress(bytesRead, contentLength, done);
1212+
}
1213+
};
1214+
1215+
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
1216+
@Override
1217+
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
1218+
callback.onUploadProgress(bytesWritten, contentLength, done);
1219+
}
1220+
};
1221+
}
1222+
1223+
com.squareup.okhttp.Call call = describeCdnTopUrlValidateBeforeCall(body, progressListener, progressRequestListener);
1224+
Type localVarReturnType = new TypeToken<DescribeCdnTopUrlResponse>(){}.getType();
1225+
apiClient.executeAsync(call, localVarReturnType, callback);
1226+
return call;
1227+
}
9761228
/**
9771229
* Build call for describeContentQuota
9781230
* @param body (required)
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
/*
2+
* mcdn
3+
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
4+
*
5+
* OpenAPI spec version: common-version
6+
*
7+
*
8+
* NOTE: This class is auto generated by the swagger code generator program.
9+
* https://github.com/swagger-api/swagger-codegen.git
10+
* Do not edit the class manually.
11+
*/
12+
13+
package com.volcengine.mcdn.model;
14+
15+
import java.util.Objects;
16+
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 com.volcengine.mcdn.model.OriginForListCdnDomainsOutput;
23+
import io.swagger.v3.oas.annotations.media.Schema;
24+
import java.io.IOException;
25+
import java.util.ArrayList;
26+
import java.util.List;
27+
import javax.validation.constraints.*;
28+
import javax.validation.Valid;
29+
/**
30+
* ConfigsForListCdnDomainsOutput
31+
*/
32+
33+
34+
35+
public class ConfigsForListCdnDomainsOutput {
36+
@SerializedName("Origins")
37+
private List<OriginForListCdnDomainsOutput> origins = null;
38+
39+
public ConfigsForListCdnDomainsOutput origins(List<OriginForListCdnDomainsOutput> origins) {
40+
this.origins = origins;
41+
return this;
42+
}
43+
44+
public ConfigsForListCdnDomainsOutput addOriginsItem(OriginForListCdnDomainsOutput originsItem) {
45+
if (this.origins == null) {
46+
this.origins = new ArrayList<OriginForListCdnDomainsOutput>();
47+
}
48+
this.origins.add(originsItem);
49+
return this;
50+
}
51+
52+
/**
53+
* Get origins
54+
* @return origins
55+
**/
56+
@Valid
57+
@Schema(description = "")
58+
public List<OriginForListCdnDomainsOutput> getOrigins() {
59+
return origins;
60+
}
61+
62+
public void setOrigins(List<OriginForListCdnDomainsOutput> origins) {
63+
this.origins = origins;
64+
}
65+
66+
67+
@Override
68+
public boolean equals(java.lang.Object o) {
69+
if (this == o) {
70+
return true;
71+
}
72+
if (o == null || getClass() != o.getClass()) {
73+
return false;
74+
}
75+
ConfigsForListCdnDomainsOutput configsForListCdnDomainsOutput = (ConfigsForListCdnDomainsOutput) o;
76+
return Objects.equals(this.origins, configsForListCdnDomainsOutput.origins);
77+
}
78+
79+
@Override
80+
public int hashCode() {
81+
return Objects.hash(origins);
82+
}
83+
84+
85+
@Override
86+
public String toString() {
87+
StringBuilder sb = new StringBuilder();
88+
sb.append("class ConfigsForListCdnDomainsOutput {\n");
89+
90+
sb.append(" origins: ").append(toIndentedString(origins)).append("\n");
91+
sb.append("}");
92+
return sb.toString();
93+
}
94+
95+
/**
96+
* Convert the given object to string with each line indented by 4 spaces
97+
* (except the first line).
98+
*/
99+
private String toIndentedString(java.lang.Object o) {
100+
if (o == null) {
101+
return "null";
102+
}
103+
return o.toString().replace("\n", "\n ");
104+
}
105+
106+
}

0 commit comments

Comments
 (0)