|
33 | 33 | import com.volcengine.flink20250101.model.GetApplicationInstanceResponse; |
34 | 34 | import com.volcengine.flink20250101.model.ListApplicationInstanceRequest; |
35 | 35 | import com.volcengine.flink20250101.model.ListApplicationInstanceResponse; |
| 36 | +import com.volcengine.flink20250101.model.RestartGWSApplicationRequest; |
| 37 | +import com.volcengine.flink20250101.model.RestartGWSApplicationResponse; |
36 | 38 | import com.volcengine.flink20250101.model.StartApplicationInstanceRequest; |
37 | 39 | import com.volcengine.flink20250101.model.StartApplicationInstanceResponse; |
38 | 40 |
|
@@ -433,6 +435,130 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don |
433 | 435 | apiClient.executeAsync(call, localVarReturnType, callback); |
434 | 436 | return call; |
435 | 437 | } |
| 438 | + /** |
| 439 | + * Build call for restartGWSApplication |
| 440 | + * @param body (required) |
| 441 | + * @param progressListener Progress listener |
| 442 | + * @param progressRequestListener Progress request listener |
| 443 | + * @return Call to execute |
| 444 | + * @throws ApiException If fail to serialize the request body object |
| 445 | + */ |
| 446 | + public com.squareup.okhttp.Call restartGWSApplicationCall(RestartGWSApplicationRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 447 | + Object localVarPostBody = body; |
| 448 | + |
| 449 | + // create path and map variables |
| 450 | + String localVarPath = "/RestartGWSApplication/2025-01-01/flink/post/application_json/"; |
| 451 | + |
| 452 | + List<Pair> localVarQueryParams = new ArrayList<Pair>(); |
| 453 | + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); |
| 454 | + |
| 455 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 456 | + |
| 457 | + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); |
| 458 | + |
| 459 | + final String[] localVarAccepts = { |
| 460 | + "application/json" |
| 461 | + }; |
| 462 | + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); |
| 463 | + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); |
| 464 | + |
| 465 | + final String[] localVarContentTypes = { |
| 466 | + "text/plain" |
| 467 | + }; |
| 468 | + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); |
| 469 | + localVarHeaderParams.put("Content-Type", localVarContentType); |
| 470 | + |
| 471 | + if(progressListener != null) { |
| 472 | + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { |
| 473 | + @Override |
| 474 | + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { |
| 475 | + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); |
| 476 | + return originalResponse.newBuilder() |
| 477 | + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) |
| 478 | + .build(); |
| 479 | + } |
| 480 | + }); |
| 481 | + } |
| 482 | + |
| 483 | + String[] localVarAuthNames = new String[] { "volcengineSign" }; |
| 484 | + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); |
| 485 | + } |
| 486 | + |
| 487 | + @SuppressWarnings("rawtypes") |
| 488 | + private com.squareup.okhttp.Call restartGWSApplicationValidateBeforeCall(RestartGWSApplicationRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 489 | + // verify the required parameter 'body' is set |
| 490 | + if (body == null) { |
| 491 | + throw new ApiException("Missing the required parameter 'body' when calling restartGWSApplication(Async)"); |
| 492 | + } |
| 493 | + |
| 494 | + com.squareup.okhttp.Call call = restartGWSApplicationCall(body, progressListener, progressRequestListener); |
| 495 | + return call; |
| 496 | + |
| 497 | + |
| 498 | + |
| 499 | + |
| 500 | + |
| 501 | + } |
| 502 | + |
| 503 | + /** |
| 504 | + * |
| 505 | + * |
| 506 | + * @param body (required) |
| 507 | + * @return RestartGWSApplicationResponse |
| 508 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 509 | + */ |
| 510 | + public RestartGWSApplicationResponse restartGWSApplication(RestartGWSApplicationRequest body) throws ApiException { |
| 511 | + ApiResponse<RestartGWSApplicationResponse> resp = restartGWSApplicationWithHttpInfo(body); |
| 512 | + return resp.getData(); |
| 513 | + } |
| 514 | + |
| 515 | + /** |
| 516 | + * |
| 517 | + * |
| 518 | + * @param body (required) |
| 519 | + * @return ApiResponse<RestartGWSApplicationResponse> |
| 520 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 521 | + */ |
| 522 | + public ApiResponse<RestartGWSApplicationResponse> restartGWSApplicationWithHttpInfo( @NotNull RestartGWSApplicationRequest body) throws ApiException { |
| 523 | + com.squareup.okhttp.Call call = restartGWSApplicationValidateBeforeCall(body, null, null); |
| 524 | + Type localVarReturnType = new TypeToken<RestartGWSApplicationResponse>(){}.getType(); |
| 525 | + return apiClient.execute(call, localVarReturnType); |
| 526 | + } |
| 527 | + |
| 528 | + /** |
| 529 | + * (asynchronously) |
| 530 | + * |
| 531 | + * @param body (required) |
| 532 | + * @param callback The callback to be executed when the API call finishes |
| 533 | + * @return The request call |
| 534 | + * @throws ApiException If fail to process the API call, e.g. serializing the request body object |
| 535 | + */ |
| 536 | + public com.squareup.okhttp.Call restartGWSApplicationAsync(RestartGWSApplicationRequest body, final ApiCallback<RestartGWSApplicationResponse> callback) throws ApiException { |
| 537 | + |
| 538 | + ProgressResponseBody.ProgressListener progressListener = null; |
| 539 | + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; |
| 540 | + |
| 541 | + if (callback != null) { |
| 542 | + progressListener = new ProgressResponseBody.ProgressListener() { |
| 543 | + @Override |
| 544 | + public void update(long bytesRead, long contentLength, boolean done) { |
| 545 | + callback.onDownloadProgress(bytesRead, contentLength, done); |
| 546 | + } |
| 547 | + }; |
| 548 | + |
| 549 | + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { |
| 550 | + @Override |
| 551 | + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { |
| 552 | + callback.onUploadProgress(bytesWritten, contentLength, done); |
| 553 | + } |
| 554 | + }; |
| 555 | + } |
| 556 | + |
| 557 | + com.squareup.okhttp.Call call = restartGWSApplicationValidateBeforeCall(body, progressListener, progressRequestListener); |
| 558 | + Type localVarReturnType = new TypeToken<RestartGWSApplicationResponse>(){}.getType(); |
| 559 | + apiClient.executeAsync(call, localVarReturnType, callback); |
| 560 | + return call; |
| 561 | + } |
436 | 562 | /** |
437 | 563 | * Build call for startApplicationInstance |
438 | 564 | * @param body (required) |
|
0 commit comments