|
209 | 209 | import com.volcengine.ecs.model.RenewDedicatedHostResponse; |
210 | 210 | import com.volcengine.ecs.model.RenewInstanceRequest; |
211 | 211 | import com.volcengine.ecs.model.RenewInstanceResponse; |
| 212 | +import com.volcengine.ecs.model.RepairImageRequest; |
| 213 | +import com.volcengine.ecs.model.RepairImageResponse; |
212 | 214 | import com.volcengine.ecs.model.ReplaceSystemVolumeRequest; |
213 | 215 | import com.volcengine.ecs.model.ReplaceSystemVolumeResponse; |
214 | 216 | import com.volcengine.ecs.model.RunCommandRequest; |
@@ -11545,6 +11547,130 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don |
11545 | 11547 | apiClient.executeAsync(call, localVarReturnType, callback); |
11546 | 11548 | return call; |
11547 | 11549 | } |
| 11550 | + /** |
| 11551 | + * Build call for repairImage |
| 11552 | + * @param body (required) |
| 11553 | + * @param progressListener Progress listener |
| 11554 | + * @param progressRequestListener Progress request listener |
| 11555 | + * @return Call to execute |
| 11556 | + * @throws ApiException If fail to serialize the request body object |
| 11557 | + */ |
| 11558 | + public com.squareup.okhttp.Call repairImageCall(RepairImageRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 11559 | + Object localVarPostBody = body; |
| 11560 | + |
| 11561 | + // create path and map variables |
| 11562 | + String localVarPath = "/RepairImage/2020-04-01/ecs/get/text_plain/"; |
| 11563 | + |
| 11564 | + List<Pair> localVarQueryParams = new ArrayList<Pair>(); |
| 11565 | + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); |
| 11566 | + |
| 11567 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 11568 | + |
| 11569 | + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); |
| 11570 | + |
| 11571 | + final String[] localVarAccepts = { |
| 11572 | + "application/json" |
| 11573 | + }; |
| 11574 | + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); |
| 11575 | + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); |
| 11576 | + |
| 11577 | + final String[] localVarContentTypes = { |
| 11578 | + "text/plain" |
| 11579 | + }; |
| 11580 | + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); |
| 11581 | + localVarHeaderParams.put("Content-Type", localVarContentType); |
| 11582 | + |
| 11583 | + if(progressListener != null) { |
| 11584 | + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { |
| 11585 | + @Override |
| 11586 | + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { |
| 11587 | + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); |
| 11588 | + return originalResponse.newBuilder() |
| 11589 | + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) |
| 11590 | + .build(); |
| 11591 | + } |
| 11592 | + }); |
| 11593 | + } |
| 11594 | + |
| 11595 | + String[] localVarAuthNames = new String[] { "volcengineSign" }; |
| 11596 | + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); |
| 11597 | + } |
| 11598 | + |
| 11599 | + @SuppressWarnings("rawtypes") |
| 11600 | + private com.squareup.okhttp.Call repairImageValidateBeforeCall(RepairImageRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 11601 | + // verify the required parameter 'body' is set |
| 11602 | + if (body == null) { |
| 11603 | + throw new ApiException("Missing the required parameter 'body' when calling repairImage(Async)"); |
| 11604 | + } |
| 11605 | + |
| 11606 | + com.squareup.okhttp.Call call = repairImageCall(body, progressListener, progressRequestListener); |
| 11607 | + return call; |
| 11608 | + |
| 11609 | + |
| 11610 | + |
| 11611 | + |
| 11612 | + |
| 11613 | + } |
| 11614 | + |
| 11615 | + /** |
| 11616 | + * |
| 11617 | + * |
| 11618 | + * @param body (required) |
| 11619 | + * @return RepairImageResponse |
| 11620 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 11621 | + */ |
| 11622 | + public RepairImageResponse repairImage(RepairImageRequest body) throws ApiException { |
| 11623 | + ApiResponse<RepairImageResponse> resp = repairImageWithHttpInfo(body); |
| 11624 | + return resp.getData(); |
| 11625 | + } |
| 11626 | + |
| 11627 | + /** |
| 11628 | + * |
| 11629 | + * |
| 11630 | + * @param body (required) |
| 11631 | + * @return ApiResponse<RepairImageResponse> |
| 11632 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 11633 | + */ |
| 11634 | + public ApiResponse<RepairImageResponse> repairImageWithHttpInfo( @NotNull RepairImageRequest body) throws ApiException { |
| 11635 | + com.squareup.okhttp.Call call = repairImageValidateBeforeCall(body, null, null); |
| 11636 | + Type localVarReturnType = new TypeToken<RepairImageResponse>(){}.getType(); |
| 11637 | + return apiClient.execute(call, localVarReturnType); |
| 11638 | + } |
| 11639 | + |
| 11640 | + /** |
| 11641 | + * (asynchronously) |
| 11642 | + * |
| 11643 | + * @param body (required) |
| 11644 | + * @param callback The callback to be executed when the API call finishes |
| 11645 | + * @return The request call |
| 11646 | + * @throws ApiException If fail to process the API call, e.g. serializing the request body object |
| 11647 | + */ |
| 11648 | + public com.squareup.okhttp.Call repairImageAsync(RepairImageRequest body, final ApiCallback<RepairImageResponse> callback) throws ApiException { |
| 11649 | + |
| 11650 | + ProgressResponseBody.ProgressListener progressListener = null; |
| 11651 | + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; |
| 11652 | + |
| 11653 | + if (callback != null) { |
| 11654 | + progressListener = new ProgressResponseBody.ProgressListener() { |
| 11655 | + @Override |
| 11656 | + public void update(long bytesRead, long contentLength, boolean done) { |
| 11657 | + callback.onDownloadProgress(bytesRead, contentLength, done); |
| 11658 | + } |
| 11659 | + }; |
| 11660 | + |
| 11661 | + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { |
| 11662 | + @Override |
| 11663 | + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { |
| 11664 | + callback.onUploadProgress(bytesWritten, contentLength, done); |
| 11665 | + } |
| 11666 | + }; |
| 11667 | + } |
| 11668 | + |
| 11669 | + com.squareup.okhttp.Call call = repairImageValidateBeforeCall(body, progressListener, progressRequestListener); |
| 11670 | + Type localVarReturnType = new TypeToken<RepairImageResponse>(){}.getType(); |
| 11671 | + apiClient.executeAsync(call, localVarReturnType, callback); |
| 11672 | + return call; |
| 11673 | + } |
11548 | 11674 | /** |
11549 | 11675 | * Build call for replaceSystemVolume |
11550 | 11676 | * @param body (required) |
|
0 commit comments