|
35 | 35 | import com.volcengine.vod20250101.model.GetExecutionResponse; |
36 | 36 | import com.volcengine.vod20250101.model.ListAITranslationProjectRequest; |
37 | 37 | import com.volcengine.vod20250101.model.ListAITranslationProjectResponse; |
| 38 | +import com.volcengine.vod20250101.model.RefreshAITranslationProjectRequest; |
| 39 | +import com.volcengine.vod20250101.model.RefreshAITranslationProjectResponse; |
38 | 40 | import com.volcengine.vod20250101.model.StartExecutionRequest; |
39 | 41 | import com.volcengine.vod20250101.model.StartExecutionResponse; |
40 | 42 | import com.volcengine.vod20250101.model.SubmitAITranslationWorkflowRequest; |
@@ -563,6 +565,130 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don |
563 | 565 | apiClient.executeAsync(call, localVarReturnType, callback); |
564 | 566 | return call; |
565 | 567 | } |
| 568 | + /** |
| 569 | + * Build call for refreshAITranslationProject |
| 570 | + * @param body (required) |
| 571 | + * @param progressListener Progress listener |
| 572 | + * @param progressRequestListener Progress request listener |
| 573 | + * @return Call to execute |
| 574 | + * @throws ApiException If fail to serialize the request body object |
| 575 | + */ |
| 576 | + public com.squareup.okhttp.Call refreshAITranslationProjectCall(RefreshAITranslationProjectRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 577 | + Object localVarPostBody = body; |
| 578 | + |
| 579 | + // create path and map variables |
| 580 | + String localVarPath = "/RefreshAITranslationProject/2025-01-01/vod/post/application_json/"; |
| 581 | + |
| 582 | + List<Pair> localVarQueryParams = new ArrayList<Pair>(); |
| 583 | + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); |
| 584 | + |
| 585 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 586 | + |
| 587 | + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); |
| 588 | + |
| 589 | + final String[] localVarAccepts = { |
| 590 | + "application/json" |
| 591 | + }; |
| 592 | + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); |
| 593 | + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); |
| 594 | + |
| 595 | + final String[] localVarContentTypes = { |
| 596 | + "text/plain" |
| 597 | + }; |
| 598 | + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); |
| 599 | + localVarHeaderParams.put("Content-Type", localVarContentType); |
| 600 | + |
| 601 | + if(progressListener != null) { |
| 602 | + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { |
| 603 | + @Override |
| 604 | + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { |
| 605 | + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); |
| 606 | + return originalResponse.newBuilder() |
| 607 | + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) |
| 608 | + .build(); |
| 609 | + } |
| 610 | + }); |
| 611 | + } |
| 612 | + |
| 613 | + String[] localVarAuthNames = new String[] { "volcengineSign" }; |
| 614 | + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); |
| 615 | + } |
| 616 | + |
| 617 | + @SuppressWarnings("rawtypes") |
| 618 | + private com.squareup.okhttp.Call refreshAITranslationProjectValidateBeforeCall(RefreshAITranslationProjectRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 619 | + // verify the required parameter 'body' is set |
| 620 | + if (body == null) { |
| 621 | + throw new ApiException("Missing the required parameter 'body' when calling refreshAITranslationProject(Async)"); |
| 622 | + } |
| 623 | + |
| 624 | + com.squareup.okhttp.Call call = refreshAITranslationProjectCall(body, progressListener, progressRequestListener); |
| 625 | + return call; |
| 626 | + |
| 627 | + |
| 628 | + |
| 629 | + |
| 630 | + |
| 631 | + } |
| 632 | + |
| 633 | + /** |
| 634 | + * |
| 635 | + * |
| 636 | + * @param body (required) |
| 637 | + * @return RefreshAITranslationProjectResponse |
| 638 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 639 | + */ |
| 640 | + public RefreshAITranslationProjectResponse refreshAITranslationProject(RefreshAITranslationProjectRequest body) throws ApiException { |
| 641 | + ApiResponse<RefreshAITranslationProjectResponse> resp = refreshAITranslationProjectWithHttpInfo(body); |
| 642 | + return resp.getData(); |
| 643 | + } |
| 644 | + |
| 645 | + /** |
| 646 | + * |
| 647 | + * |
| 648 | + * @param body (required) |
| 649 | + * @return ApiResponse<RefreshAITranslationProjectResponse> |
| 650 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 651 | + */ |
| 652 | + public ApiResponse<RefreshAITranslationProjectResponse> refreshAITranslationProjectWithHttpInfo( @NotNull RefreshAITranslationProjectRequest body) throws ApiException { |
| 653 | + com.squareup.okhttp.Call call = refreshAITranslationProjectValidateBeforeCall(body, null, null); |
| 654 | + Type localVarReturnType = new TypeToken<RefreshAITranslationProjectResponse>(){}.getType(); |
| 655 | + return apiClient.execute(call, localVarReturnType); |
| 656 | + } |
| 657 | + |
| 658 | + /** |
| 659 | + * (asynchronously) |
| 660 | + * |
| 661 | + * @param body (required) |
| 662 | + * @param callback The callback to be executed when the API call finishes |
| 663 | + * @return The request call |
| 664 | + * @throws ApiException If fail to process the API call, e.g. serializing the request body object |
| 665 | + */ |
| 666 | + public com.squareup.okhttp.Call refreshAITranslationProjectAsync(RefreshAITranslationProjectRequest body, final ApiCallback<RefreshAITranslationProjectResponse> callback) throws ApiException { |
| 667 | + |
| 668 | + ProgressResponseBody.ProgressListener progressListener = null; |
| 669 | + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; |
| 670 | + |
| 671 | + if (callback != null) { |
| 672 | + progressListener = new ProgressResponseBody.ProgressListener() { |
| 673 | + @Override |
| 674 | + public void update(long bytesRead, long contentLength, boolean done) { |
| 675 | + callback.onDownloadProgress(bytesRead, contentLength, done); |
| 676 | + } |
| 677 | + }; |
| 678 | + |
| 679 | + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { |
| 680 | + @Override |
| 681 | + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { |
| 682 | + callback.onUploadProgress(bytesWritten, contentLength, done); |
| 683 | + } |
| 684 | + }; |
| 685 | + } |
| 686 | + |
| 687 | + com.squareup.okhttp.Call call = refreshAITranslationProjectValidateBeforeCall(body, progressListener, progressRequestListener); |
| 688 | + Type localVarReturnType = new TypeToken<RefreshAITranslationProjectResponse>(){}.getType(); |
| 689 | + apiClient.executeAsync(call, localVarReturnType, callback); |
| 690 | + return call; |
| 691 | + } |
566 | 692 | /** |
567 | 693 | * Build call for startExecution |
568 | 694 | * @param body (required) |
|
0 commit comments