|
49 | 49 | import com.volcengine.vke.model.DeleteNodePoolResponse; |
50 | 50 | import com.volcengine.vke.model.DeleteNodesRequest; |
51 | 51 | import com.volcengine.vke.model.DeleteNodesResponse; |
| 52 | +import com.volcengine.vke.model.ExecContainerImageCommitmentRequest; |
| 53 | +import com.volcengine.vke.model.ExecContainerImageCommitmentResponse; |
52 | 54 | import com.volcengine.vke.model.ForwardKubernetesApiRequest; |
53 | 55 | import com.volcengine.vke.model.ForwardKubernetesApiResponse; |
54 | 56 | import com.volcengine.vke.model.GetGlobalDefaultDeleteOptionRequest; |
@@ -1475,6 +1477,130 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don |
1475 | 1477 | apiClient.executeAsync(call, localVarReturnType, callback); |
1476 | 1478 | return call; |
1477 | 1479 | } |
| 1480 | + /** |
| 1481 | + * Build call for execContainerImageCommitment |
| 1482 | + * @param body (required) |
| 1483 | + * @param progressListener Progress listener |
| 1484 | + * @param progressRequestListener Progress request listener |
| 1485 | + * @return Call to execute |
| 1486 | + * @throws ApiException If fail to serialize the request body object |
| 1487 | + */ |
| 1488 | + public com.squareup.okhttp.Call execContainerImageCommitmentCall(ExecContainerImageCommitmentRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 1489 | + Object localVarPostBody = body; |
| 1490 | + |
| 1491 | + // create path and map variables |
| 1492 | + String localVarPath = "/ExecContainerImageCommitment/2022-05-12/vke/post/application_json/"; |
| 1493 | + |
| 1494 | + List<Pair> localVarQueryParams = new ArrayList<Pair>(); |
| 1495 | + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); |
| 1496 | + |
| 1497 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 1498 | + |
| 1499 | + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); |
| 1500 | + |
| 1501 | + final String[] localVarAccepts = { |
| 1502 | + "application/json" |
| 1503 | + }; |
| 1504 | + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); |
| 1505 | + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); |
| 1506 | + |
| 1507 | + final String[] localVarContentTypes = { |
| 1508 | + "text/plain" |
| 1509 | + }; |
| 1510 | + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); |
| 1511 | + localVarHeaderParams.put("Content-Type", localVarContentType); |
| 1512 | + |
| 1513 | + if(progressListener != null) { |
| 1514 | + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { |
| 1515 | + @Override |
| 1516 | + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { |
| 1517 | + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); |
| 1518 | + return originalResponse.newBuilder() |
| 1519 | + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) |
| 1520 | + .build(); |
| 1521 | + } |
| 1522 | + }); |
| 1523 | + } |
| 1524 | + |
| 1525 | + String[] localVarAuthNames = new String[] { "volcengineSign" }; |
| 1526 | + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); |
| 1527 | + } |
| 1528 | + |
| 1529 | + @SuppressWarnings("rawtypes") |
| 1530 | + private com.squareup.okhttp.Call execContainerImageCommitmentValidateBeforeCall(ExecContainerImageCommitmentRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 1531 | + // verify the required parameter 'body' is set |
| 1532 | + if (body == null) { |
| 1533 | + throw new ApiException("Missing the required parameter 'body' when calling execContainerImageCommitment(Async)"); |
| 1534 | + } |
| 1535 | + |
| 1536 | + com.squareup.okhttp.Call call = execContainerImageCommitmentCall(body, progressListener, progressRequestListener); |
| 1537 | + return call; |
| 1538 | + |
| 1539 | + |
| 1540 | + |
| 1541 | + |
| 1542 | + |
| 1543 | + } |
| 1544 | + |
| 1545 | + /** |
| 1546 | + * |
| 1547 | + * |
| 1548 | + * @param body (required) |
| 1549 | + * @return ExecContainerImageCommitmentResponse |
| 1550 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 1551 | + */ |
| 1552 | + public ExecContainerImageCommitmentResponse execContainerImageCommitment(ExecContainerImageCommitmentRequest body) throws ApiException { |
| 1553 | + ApiResponse<ExecContainerImageCommitmentResponse> resp = execContainerImageCommitmentWithHttpInfo(body); |
| 1554 | + return resp.getData(); |
| 1555 | + } |
| 1556 | + |
| 1557 | + /** |
| 1558 | + * |
| 1559 | + * |
| 1560 | + * @param body (required) |
| 1561 | + * @return ApiResponse<ExecContainerImageCommitmentResponse> |
| 1562 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 1563 | + */ |
| 1564 | + public ApiResponse<ExecContainerImageCommitmentResponse> execContainerImageCommitmentWithHttpInfo( @NotNull ExecContainerImageCommitmentRequest body) throws ApiException { |
| 1565 | + com.squareup.okhttp.Call call = execContainerImageCommitmentValidateBeforeCall(body, null, null); |
| 1566 | + Type localVarReturnType = new TypeToken<ExecContainerImageCommitmentResponse>(){}.getType(); |
| 1567 | + return apiClient.execute(call, localVarReturnType); |
| 1568 | + } |
| 1569 | + |
| 1570 | + /** |
| 1571 | + * (asynchronously) |
| 1572 | + * |
| 1573 | + * @param body (required) |
| 1574 | + * @param callback The callback to be executed when the API call finishes |
| 1575 | + * @return The request call |
| 1576 | + * @throws ApiException If fail to process the API call, e.g. serializing the request body object |
| 1577 | + */ |
| 1578 | + public com.squareup.okhttp.Call execContainerImageCommitmentAsync(ExecContainerImageCommitmentRequest body, final ApiCallback<ExecContainerImageCommitmentResponse> callback) throws ApiException { |
| 1579 | + |
| 1580 | + ProgressResponseBody.ProgressListener progressListener = null; |
| 1581 | + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; |
| 1582 | + |
| 1583 | + if (callback != null) { |
| 1584 | + progressListener = new ProgressResponseBody.ProgressListener() { |
| 1585 | + @Override |
| 1586 | + public void update(long bytesRead, long contentLength, boolean done) { |
| 1587 | + callback.onDownloadProgress(bytesRead, contentLength, done); |
| 1588 | + } |
| 1589 | + }; |
| 1590 | + |
| 1591 | + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { |
| 1592 | + @Override |
| 1593 | + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { |
| 1594 | + callback.onUploadProgress(bytesWritten, contentLength, done); |
| 1595 | + } |
| 1596 | + }; |
| 1597 | + } |
| 1598 | + |
| 1599 | + com.squareup.okhttp.Call call = execContainerImageCommitmentValidateBeforeCall(body, progressListener, progressRequestListener); |
| 1600 | + Type localVarReturnType = new TypeToken<ExecContainerImageCommitmentResponse>(){}.getType(); |
| 1601 | + apiClient.executeAsync(call, localVarReturnType, callback); |
| 1602 | + return call; |
| 1603 | + } |
1478 | 1604 | /** |
1479 | 1605 | * Build call for forwardKubernetesApi |
1480 | 1606 | * @param body (required) |
|
0 commit comments