|
45 | 45 | import com.volcengine.vke.model.DeleteNodePoolResponse; |
46 | 46 | import com.volcengine.vke.model.DeleteNodesRequest; |
47 | 47 | import com.volcengine.vke.model.DeleteNodesResponse; |
| 48 | +import com.volcengine.vke.model.ForwardKubernetesApiRequest; |
| 49 | +import com.volcengine.vke.model.ForwardKubernetesApiResponse; |
48 | 50 | import com.volcengine.vke.model.ListAddonsRequest; |
49 | 51 | import com.volcengine.vke.model.ListAddonsResponse; |
50 | 52 | import com.volcengine.vke.model.ListClustersRequest; |
@@ -1207,6 +1209,130 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don |
1207 | 1209 | apiClient.executeAsync(call, localVarReturnType, callback); |
1208 | 1210 | return call; |
1209 | 1211 | } |
| 1212 | + /** |
| 1213 | + * Build call for forwardKubernetesApi |
| 1214 | + * @param body (required) |
| 1215 | + * @param progressListener Progress listener |
| 1216 | + * @param progressRequestListener Progress request listener |
| 1217 | + * @return Call to execute |
| 1218 | + * @throws ApiException If fail to serialize the request body object |
| 1219 | + */ |
| 1220 | + public com.squareup.okhttp.Call forwardKubernetesApiCall(ForwardKubernetesApiRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 1221 | + Object localVarPostBody = body; |
| 1222 | + |
| 1223 | + // create path and map variables |
| 1224 | + String localVarPath = "/ForwardKubernetesApi/2022-05-12/vke/post/"; |
| 1225 | + |
| 1226 | + List<Pair> localVarQueryParams = new ArrayList<Pair>(); |
| 1227 | + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); |
| 1228 | + |
| 1229 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 1230 | + |
| 1231 | + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); |
| 1232 | + |
| 1233 | + final String[] localVarAccepts = { |
| 1234 | + "application/json" |
| 1235 | + }; |
| 1236 | + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); |
| 1237 | + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); |
| 1238 | + |
| 1239 | + final String[] localVarContentTypes = { |
| 1240 | + "application/json" |
| 1241 | + }; |
| 1242 | + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); |
| 1243 | + localVarHeaderParams.put("Content-Type", localVarContentType); |
| 1244 | + |
| 1245 | + if(progressListener != null) { |
| 1246 | + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { |
| 1247 | + @Override |
| 1248 | + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { |
| 1249 | + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); |
| 1250 | + return originalResponse.newBuilder() |
| 1251 | + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) |
| 1252 | + .build(); |
| 1253 | + } |
| 1254 | + }); |
| 1255 | + } |
| 1256 | + |
| 1257 | + String[] localVarAuthNames = new String[] { "volcengineSign" }; |
| 1258 | + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); |
| 1259 | + } |
| 1260 | + |
| 1261 | + @SuppressWarnings("rawtypes") |
| 1262 | + private com.squareup.okhttp.Call forwardKubernetesApiValidateBeforeCall(ForwardKubernetesApiRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 1263 | + // verify the required parameter 'body' is set |
| 1264 | + if (body == null) { |
| 1265 | + throw new ApiException("Missing the required parameter 'body' when calling forwardKubernetesApi(Async)"); |
| 1266 | + } |
| 1267 | + |
| 1268 | + com.squareup.okhttp.Call call = forwardKubernetesApiCall(body, progressListener, progressRequestListener); |
| 1269 | + return call; |
| 1270 | + |
| 1271 | + |
| 1272 | + |
| 1273 | + |
| 1274 | + |
| 1275 | + } |
| 1276 | + |
| 1277 | + /** |
| 1278 | + * |
| 1279 | + * |
| 1280 | + * @param body (required) |
| 1281 | + * @return ForwardKubernetesApiResponse |
| 1282 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 1283 | + */ |
| 1284 | + public ForwardKubernetesApiResponse forwardKubernetesApi(ForwardKubernetesApiRequest body) throws ApiException { |
| 1285 | + ApiResponse<ForwardKubernetesApiResponse> resp = forwardKubernetesApiWithHttpInfo(body); |
| 1286 | + return resp.getData(); |
| 1287 | + } |
| 1288 | + |
| 1289 | + /** |
| 1290 | + * |
| 1291 | + * |
| 1292 | + * @param body (required) |
| 1293 | + * @return ApiResponse<ForwardKubernetesApiResponse> |
| 1294 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 1295 | + */ |
| 1296 | + public ApiResponse<ForwardKubernetesApiResponse> forwardKubernetesApiWithHttpInfo( @NotNull ForwardKubernetesApiRequest body) throws ApiException { |
| 1297 | + com.squareup.okhttp.Call call = forwardKubernetesApiValidateBeforeCall(body, null, null); |
| 1298 | + Type localVarReturnType = new TypeToken<ForwardKubernetesApiResponse>(){}.getType(); |
| 1299 | + return apiClient.execute(call, localVarReturnType); |
| 1300 | + } |
| 1301 | + |
| 1302 | + /** |
| 1303 | + * (asynchronously) |
| 1304 | + * |
| 1305 | + * @param body (required) |
| 1306 | + * @param callback The callback to be executed when the API call finishes |
| 1307 | + * @return The request call |
| 1308 | + * @throws ApiException If fail to process the API call, e.g. serializing the request body object |
| 1309 | + */ |
| 1310 | + public com.squareup.okhttp.Call forwardKubernetesApiAsync(ForwardKubernetesApiRequest body, final ApiCallback<ForwardKubernetesApiResponse> callback) throws ApiException { |
| 1311 | + |
| 1312 | + ProgressResponseBody.ProgressListener progressListener = null; |
| 1313 | + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; |
| 1314 | + |
| 1315 | + if (callback != null) { |
| 1316 | + progressListener = new ProgressResponseBody.ProgressListener() { |
| 1317 | + @Override |
| 1318 | + public void update(long bytesRead, long contentLength, boolean done) { |
| 1319 | + callback.onDownloadProgress(bytesRead, contentLength, done); |
| 1320 | + } |
| 1321 | + }; |
| 1322 | + |
| 1323 | + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { |
| 1324 | + @Override |
| 1325 | + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { |
| 1326 | + callback.onUploadProgress(bytesWritten, contentLength, done); |
| 1327 | + } |
| 1328 | + }; |
| 1329 | + } |
| 1330 | + |
| 1331 | + com.squareup.okhttp.Call call = forwardKubernetesApiValidateBeforeCall(body, progressListener, progressRequestListener); |
| 1332 | + Type localVarReturnType = new TypeToken<ForwardKubernetesApiResponse>(){}.getType(); |
| 1333 | + apiClient.executeAsync(call, localVarReturnType, callback); |
| 1334 | + return call; |
| 1335 | + } |
1210 | 1336 | /** |
1211 | 1337 | * Build call for listAddons |
1212 | 1338 | * @param body (required) |
|
0 commit comments