|
33 | 33 | import com.volcengine.vod20250101.model.CreateAITranslationSpeakerResponse; |
34 | 34 | import com.volcengine.vod20250101.model.CreateAITranslationSpeechRequest; |
35 | 35 | import com.volcengine.vod20250101.model.CreateAITranslationSpeechResponse; |
| 36 | +import com.volcengine.vod20250101.model.CreateAITranslationUtteranceRequest; |
| 37 | +import com.volcengine.vod20250101.model.CreateAITranslationUtteranceResponse; |
36 | 38 | import com.volcengine.vod20250101.model.DeleteAITranslationSpeechRequest; |
37 | 39 | import com.volcengine.vod20250101.model.DeleteAITranslationSpeechResponse; |
38 | 40 | import com.volcengine.vod20250101.model.GenerateAITranslationUtteranceAudioRequest; |
|
47 | 49 | import com.volcengine.vod20250101.model.ListAITranslationSpeechResponse; |
48 | 50 | import com.volcengine.vod20250101.model.RefreshAITranslationProjectRequest; |
49 | 51 | import com.volcengine.vod20250101.model.RefreshAITranslationProjectResponse; |
| 52 | +import com.volcengine.vod20250101.model.RemoveAITranslationUtteranceRequest; |
| 53 | +import com.volcengine.vod20250101.model.RemoveAITranslationUtteranceResponse; |
50 | 54 | import com.volcengine.vod20250101.model.StartExecutionRequest; |
51 | 55 | import com.volcengine.vod20250101.model.StartExecutionResponse; |
52 | 56 | import com.volcengine.vod20250101.model.SubmitAITranslationWorkflowRequest; |
@@ -455,6 +459,130 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don |
455 | 459 | apiClient.executeAsync(call, localVarReturnType, callback); |
456 | 460 | return call; |
457 | 461 | } |
| 462 | + /** |
| 463 | + * Build call for createAITranslationUtterance |
| 464 | + * @param body (required) |
| 465 | + * @param progressListener Progress listener |
| 466 | + * @param progressRequestListener Progress request listener |
| 467 | + * @return Call to execute |
| 468 | + * @throws ApiException If fail to serialize the request body object |
| 469 | + */ |
| 470 | + public com.squareup.okhttp.Call createAITranslationUtteranceCall(CreateAITranslationUtteranceRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 471 | + Object localVarPostBody = body; |
| 472 | + |
| 473 | + // create path and map variables |
| 474 | + String localVarPath = "/CreateAITranslationUtterance/2025-01-01/vod/post/application_json/"; |
| 475 | + |
| 476 | + List<Pair> localVarQueryParams = new ArrayList<Pair>(); |
| 477 | + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); |
| 478 | + |
| 479 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 480 | + |
| 481 | + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); |
| 482 | + |
| 483 | + final String[] localVarAccepts = { |
| 484 | + "application/json" |
| 485 | + }; |
| 486 | + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); |
| 487 | + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); |
| 488 | + |
| 489 | + final String[] localVarContentTypes = { |
| 490 | + "text/plain" |
| 491 | + }; |
| 492 | + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); |
| 493 | + localVarHeaderParams.put("Content-Type", localVarContentType); |
| 494 | + |
| 495 | + if(progressListener != null) { |
| 496 | + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { |
| 497 | + @Override |
| 498 | + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { |
| 499 | + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); |
| 500 | + return originalResponse.newBuilder() |
| 501 | + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) |
| 502 | + .build(); |
| 503 | + } |
| 504 | + }); |
| 505 | + } |
| 506 | + |
| 507 | + String[] localVarAuthNames = new String[] { "volcengineSign" }; |
| 508 | + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); |
| 509 | + } |
| 510 | + |
| 511 | + @SuppressWarnings("rawtypes") |
| 512 | + private com.squareup.okhttp.Call createAITranslationUtteranceValidateBeforeCall(CreateAITranslationUtteranceRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 513 | + // verify the required parameter 'body' is set |
| 514 | + if (body == null) { |
| 515 | + throw new ApiException("Missing the required parameter 'body' when calling createAITranslationUtterance(Async)"); |
| 516 | + } |
| 517 | + |
| 518 | + com.squareup.okhttp.Call call = createAITranslationUtteranceCall(body, progressListener, progressRequestListener); |
| 519 | + return call; |
| 520 | + |
| 521 | + |
| 522 | + |
| 523 | + |
| 524 | + |
| 525 | + } |
| 526 | + |
| 527 | + /** |
| 528 | + * |
| 529 | + * |
| 530 | + * @param body (required) |
| 531 | + * @return CreateAITranslationUtteranceResponse |
| 532 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 533 | + */ |
| 534 | + public CreateAITranslationUtteranceResponse createAITranslationUtterance(CreateAITranslationUtteranceRequest body) throws ApiException { |
| 535 | + ApiResponse<CreateAITranslationUtteranceResponse> resp = createAITranslationUtteranceWithHttpInfo(body); |
| 536 | + return resp.getData(); |
| 537 | + } |
| 538 | + |
| 539 | + /** |
| 540 | + * |
| 541 | + * |
| 542 | + * @param body (required) |
| 543 | + * @return ApiResponse<CreateAITranslationUtteranceResponse> |
| 544 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 545 | + */ |
| 546 | + public ApiResponse<CreateAITranslationUtteranceResponse> createAITranslationUtteranceWithHttpInfo( @NotNull CreateAITranslationUtteranceRequest body) throws ApiException { |
| 547 | + com.squareup.okhttp.Call call = createAITranslationUtteranceValidateBeforeCall(body, null, null); |
| 548 | + Type localVarReturnType = new TypeToken<CreateAITranslationUtteranceResponse>(){}.getType(); |
| 549 | + return apiClient.execute(call, localVarReturnType); |
| 550 | + } |
| 551 | + |
| 552 | + /** |
| 553 | + * (asynchronously) |
| 554 | + * |
| 555 | + * @param body (required) |
| 556 | + * @param callback The callback to be executed when the API call finishes |
| 557 | + * @return The request call |
| 558 | + * @throws ApiException If fail to process the API call, e.g. serializing the request body object |
| 559 | + */ |
| 560 | + public com.squareup.okhttp.Call createAITranslationUtteranceAsync(CreateAITranslationUtteranceRequest body, final ApiCallback<CreateAITranslationUtteranceResponse> callback) throws ApiException { |
| 561 | + |
| 562 | + ProgressResponseBody.ProgressListener progressListener = null; |
| 563 | + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; |
| 564 | + |
| 565 | + if (callback != null) { |
| 566 | + progressListener = new ProgressResponseBody.ProgressListener() { |
| 567 | + @Override |
| 568 | + public void update(long bytesRead, long contentLength, boolean done) { |
| 569 | + callback.onDownloadProgress(bytesRead, contentLength, done); |
| 570 | + } |
| 571 | + }; |
| 572 | + |
| 573 | + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { |
| 574 | + @Override |
| 575 | + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { |
| 576 | + callback.onUploadProgress(bytesWritten, contentLength, done); |
| 577 | + } |
| 578 | + }; |
| 579 | + } |
| 580 | + |
| 581 | + com.squareup.okhttp.Call call = createAITranslationUtteranceValidateBeforeCall(body, progressListener, progressRequestListener); |
| 582 | + Type localVarReturnType = new TypeToken<CreateAITranslationUtteranceResponse>(){}.getType(); |
| 583 | + apiClient.executeAsync(call, localVarReturnType, callback); |
| 584 | + return call; |
| 585 | + } |
458 | 586 | /** |
459 | 587 | * Build call for deleteAITranslationSpeech |
460 | 588 | * @param body (required) |
@@ -1323,6 +1451,130 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don |
1323 | 1451 | apiClient.executeAsync(call, localVarReturnType, callback); |
1324 | 1452 | return call; |
1325 | 1453 | } |
| 1454 | + /** |
| 1455 | + * Build call for removeAITranslationUtterance |
| 1456 | + * @param body (required) |
| 1457 | + * @param progressListener Progress listener |
| 1458 | + * @param progressRequestListener Progress request listener |
| 1459 | + * @return Call to execute |
| 1460 | + * @throws ApiException If fail to serialize the request body object |
| 1461 | + */ |
| 1462 | + public com.squareup.okhttp.Call removeAITranslationUtteranceCall(RemoveAITranslationUtteranceRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 1463 | + Object localVarPostBody = body; |
| 1464 | + |
| 1465 | + // create path and map variables |
| 1466 | + String localVarPath = "/RemoveAITranslationUtterance/2025-01-01/vod/post/application_json/"; |
| 1467 | + |
| 1468 | + List<Pair> localVarQueryParams = new ArrayList<Pair>(); |
| 1469 | + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); |
| 1470 | + |
| 1471 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 1472 | + |
| 1473 | + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); |
| 1474 | + |
| 1475 | + final String[] localVarAccepts = { |
| 1476 | + "application/json" |
| 1477 | + }; |
| 1478 | + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); |
| 1479 | + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); |
| 1480 | + |
| 1481 | + final String[] localVarContentTypes = { |
| 1482 | + "text/plain" |
| 1483 | + }; |
| 1484 | + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); |
| 1485 | + localVarHeaderParams.put("Content-Type", localVarContentType); |
| 1486 | + |
| 1487 | + if(progressListener != null) { |
| 1488 | + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { |
| 1489 | + @Override |
| 1490 | + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { |
| 1491 | + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); |
| 1492 | + return originalResponse.newBuilder() |
| 1493 | + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) |
| 1494 | + .build(); |
| 1495 | + } |
| 1496 | + }); |
| 1497 | + } |
| 1498 | + |
| 1499 | + String[] localVarAuthNames = new String[] { "volcengineSign" }; |
| 1500 | + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); |
| 1501 | + } |
| 1502 | + |
| 1503 | + @SuppressWarnings("rawtypes") |
| 1504 | + private com.squareup.okhttp.Call removeAITranslationUtteranceValidateBeforeCall(RemoveAITranslationUtteranceRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 1505 | + // verify the required parameter 'body' is set |
| 1506 | + if (body == null) { |
| 1507 | + throw new ApiException("Missing the required parameter 'body' when calling removeAITranslationUtterance(Async)"); |
| 1508 | + } |
| 1509 | + |
| 1510 | + com.squareup.okhttp.Call call = removeAITranslationUtteranceCall(body, progressListener, progressRequestListener); |
| 1511 | + return call; |
| 1512 | + |
| 1513 | + |
| 1514 | + |
| 1515 | + |
| 1516 | + |
| 1517 | + } |
| 1518 | + |
| 1519 | + /** |
| 1520 | + * |
| 1521 | + * |
| 1522 | + * @param body (required) |
| 1523 | + * @return RemoveAITranslationUtteranceResponse |
| 1524 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 1525 | + */ |
| 1526 | + public RemoveAITranslationUtteranceResponse removeAITranslationUtterance(RemoveAITranslationUtteranceRequest body) throws ApiException { |
| 1527 | + ApiResponse<RemoveAITranslationUtteranceResponse> resp = removeAITranslationUtteranceWithHttpInfo(body); |
| 1528 | + return resp.getData(); |
| 1529 | + } |
| 1530 | + |
| 1531 | + /** |
| 1532 | + * |
| 1533 | + * |
| 1534 | + * @param body (required) |
| 1535 | + * @return ApiResponse<RemoveAITranslationUtteranceResponse> |
| 1536 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 1537 | + */ |
| 1538 | + public ApiResponse<RemoveAITranslationUtteranceResponse> removeAITranslationUtteranceWithHttpInfo( @NotNull RemoveAITranslationUtteranceRequest body) throws ApiException { |
| 1539 | + com.squareup.okhttp.Call call = removeAITranslationUtteranceValidateBeforeCall(body, null, null); |
| 1540 | + Type localVarReturnType = new TypeToken<RemoveAITranslationUtteranceResponse>(){}.getType(); |
| 1541 | + return apiClient.execute(call, localVarReturnType); |
| 1542 | + } |
| 1543 | + |
| 1544 | + /** |
| 1545 | + * (asynchronously) |
| 1546 | + * |
| 1547 | + * @param body (required) |
| 1548 | + * @param callback The callback to be executed when the API call finishes |
| 1549 | + * @return The request call |
| 1550 | + * @throws ApiException If fail to process the API call, e.g. serializing the request body object |
| 1551 | + */ |
| 1552 | + public com.squareup.okhttp.Call removeAITranslationUtteranceAsync(RemoveAITranslationUtteranceRequest body, final ApiCallback<RemoveAITranslationUtteranceResponse> callback) throws ApiException { |
| 1553 | + |
| 1554 | + ProgressResponseBody.ProgressListener progressListener = null; |
| 1555 | + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; |
| 1556 | + |
| 1557 | + if (callback != null) { |
| 1558 | + progressListener = new ProgressResponseBody.ProgressListener() { |
| 1559 | + @Override |
| 1560 | + public void update(long bytesRead, long contentLength, boolean done) { |
| 1561 | + callback.onDownloadProgress(bytesRead, contentLength, done); |
| 1562 | + } |
| 1563 | + }; |
| 1564 | + |
| 1565 | + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { |
| 1566 | + @Override |
| 1567 | + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { |
| 1568 | + callback.onUploadProgress(bytesWritten, contentLength, done); |
| 1569 | + } |
| 1570 | + }; |
| 1571 | + } |
| 1572 | + |
| 1573 | + com.squareup.okhttp.Call call = removeAITranslationUtteranceValidateBeforeCall(body, progressListener, progressRequestListener); |
| 1574 | + Type localVarReturnType = new TypeToken<RemoveAITranslationUtteranceResponse>(){}.getType(); |
| 1575 | + apiClient.executeAsync(call, localVarReturnType, callback); |
| 1576 | + return call; |
| 1577 | + } |
1326 | 1578 | /** |
1327 | 1579 | * Build call for startExecution |
1328 | 1580 | * @param body (required) |
|
0 commit comments