|
29 | 29 |
|
30 | 30 | import com.volcengine.vod20250101.model.ContinueAITranslationWorkflowRequest; |
31 | 31 | import com.volcengine.vod20250101.model.ContinueAITranslationWorkflowResponse; |
| 32 | +import com.volcengine.vod20250101.model.GenerateAITranslationUtteranceAudioRequest; |
| 33 | +import com.volcengine.vod20250101.model.GenerateAITranslationUtteranceAudioResponse; |
32 | 34 | import com.volcengine.vod20250101.model.GetAITranslationProjectRequest; |
33 | 35 | import com.volcengine.vod20250101.model.GetAITranslationProjectResponse; |
34 | 36 | import com.volcengine.vod20250101.model.GetExecutionRequest; |
|
41 | 43 | import com.volcengine.vod20250101.model.StartExecutionResponse; |
42 | 44 | import com.volcengine.vod20250101.model.SubmitAITranslationWorkflowRequest; |
43 | 45 | import com.volcengine.vod20250101.model.SubmitAITranslationWorkflowResponse; |
| 46 | +import com.volcengine.vod20250101.model.UpdateAITranslationSpeakersRequest; |
| 47 | +import com.volcengine.vod20250101.model.UpdateAITranslationSpeakersResponse; |
44 | 48 | import com.volcengine.vod20250101.model.UpdateAITranslationUtterancesRequest; |
45 | 49 | import com.volcengine.vod20250101.model.UpdateAITranslationUtterancesResponse; |
46 | 50 |
|
@@ -193,6 +197,130 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don |
193 | 197 | apiClient.executeAsync(call, localVarReturnType, callback); |
194 | 198 | return call; |
195 | 199 | } |
| 200 | + /** |
| 201 | + * Build call for generateAITranslationUtteranceAudio |
| 202 | + * @param body (required) |
| 203 | + * @param progressListener Progress listener |
| 204 | + * @param progressRequestListener Progress request listener |
| 205 | + * @return Call to execute |
| 206 | + * @throws ApiException If fail to serialize the request body object |
| 207 | + */ |
| 208 | + public com.squareup.okhttp.Call generateAITranslationUtteranceAudioCall(GenerateAITranslationUtteranceAudioRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 209 | + Object localVarPostBody = body; |
| 210 | + |
| 211 | + // create path and map variables |
| 212 | + String localVarPath = "/GenerateAITranslationUtteranceAudio/2025-01-01/vod/post/application_json/"; |
| 213 | + |
| 214 | + List<Pair> localVarQueryParams = new ArrayList<Pair>(); |
| 215 | + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); |
| 216 | + |
| 217 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 218 | + |
| 219 | + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); |
| 220 | + |
| 221 | + final String[] localVarAccepts = { |
| 222 | + "application/json" |
| 223 | + }; |
| 224 | + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); |
| 225 | + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); |
| 226 | + |
| 227 | + final String[] localVarContentTypes = { |
| 228 | + "text/plain" |
| 229 | + }; |
| 230 | + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); |
| 231 | + localVarHeaderParams.put("Content-Type", localVarContentType); |
| 232 | + |
| 233 | + if(progressListener != null) { |
| 234 | + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { |
| 235 | + @Override |
| 236 | + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { |
| 237 | + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); |
| 238 | + return originalResponse.newBuilder() |
| 239 | + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) |
| 240 | + .build(); |
| 241 | + } |
| 242 | + }); |
| 243 | + } |
| 244 | + |
| 245 | + String[] localVarAuthNames = new String[] { "volcengineSign" }; |
| 246 | + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); |
| 247 | + } |
| 248 | + |
| 249 | + @SuppressWarnings("rawtypes") |
| 250 | + private com.squareup.okhttp.Call generateAITranslationUtteranceAudioValidateBeforeCall(GenerateAITranslationUtteranceAudioRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 251 | + // verify the required parameter 'body' is set |
| 252 | + if (body == null) { |
| 253 | + throw new ApiException("Missing the required parameter 'body' when calling generateAITranslationUtteranceAudio(Async)"); |
| 254 | + } |
| 255 | + |
| 256 | + com.squareup.okhttp.Call call = generateAITranslationUtteranceAudioCall(body, progressListener, progressRequestListener); |
| 257 | + return call; |
| 258 | + |
| 259 | + |
| 260 | + |
| 261 | + |
| 262 | + |
| 263 | + } |
| 264 | + |
| 265 | + /** |
| 266 | + * |
| 267 | + * |
| 268 | + * @param body (required) |
| 269 | + * @return GenerateAITranslationUtteranceAudioResponse |
| 270 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 271 | + */ |
| 272 | + public GenerateAITranslationUtteranceAudioResponse generateAITranslationUtteranceAudio(GenerateAITranslationUtteranceAudioRequest body) throws ApiException { |
| 273 | + ApiResponse<GenerateAITranslationUtteranceAudioResponse> resp = generateAITranslationUtteranceAudioWithHttpInfo(body); |
| 274 | + return resp.getData(); |
| 275 | + } |
| 276 | + |
| 277 | + /** |
| 278 | + * |
| 279 | + * |
| 280 | + * @param body (required) |
| 281 | + * @return ApiResponse<GenerateAITranslationUtteranceAudioResponse> |
| 282 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 283 | + */ |
| 284 | + public ApiResponse<GenerateAITranslationUtteranceAudioResponse> generateAITranslationUtteranceAudioWithHttpInfo( @NotNull GenerateAITranslationUtteranceAudioRequest body) throws ApiException { |
| 285 | + com.squareup.okhttp.Call call = generateAITranslationUtteranceAudioValidateBeforeCall(body, null, null); |
| 286 | + Type localVarReturnType = new TypeToken<GenerateAITranslationUtteranceAudioResponse>(){}.getType(); |
| 287 | + return apiClient.execute(call, localVarReturnType); |
| 288 | + } |
| 289 | + |
| 290 | + /** |
| 291 | + * (asynchronously) |
| 292 | + * |
| 293 | + * @param body (required) |
| 294 | + * @param callback The callback to be executed when the API call finishes |
| 295 | + * @return The request call |
| 296 | + * @throws ApiException If fail to process the API call, e.g. serializing the request body object |
| 297 | + */ |
| 298 | + public com.squareup.okhttp.Call generateAITranslationUtteranceAudioAsync(GenerateAITranslationUtteranceAudioRequest body, final ApiCallback<GenerateAITranslationUtteranceAudioResponse> callback) throws ApiException { |
| 299 | + |
| 300 | + ProgressResponseBody.ProgressListener progressListener = null; |
| 301 | + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; |
| 302 | + |
| 303 | + if (callback != null) { |
| 304 | + progressListener = new ProgressResponseBody.ProgressListener() { |
| 305 | + @Override |
| 306 | + public void update(long bytesRead, long contentLength, boolean done) { |
| 307 | + callback.onDownloadProgress(bytesRead, contentLength, done); |
| 308 | + } |
| 309 | + }; |
| 310 | + |
| 311 | + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { |
| 312 | + @Override |
| 313 | + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { |
| 314 | + callback.onUploadProgress(bytesWritten, contentLength, done); |
| 315 | + } |
| 316 | + }; |
| 317 | + } |
| 318 | + |
| 319 | + com.squareup.okhttp.Call call = generateAITranslationUtteranceAudioValidateBeforeCall(body, progressListener, progressRequestListener); |
| 320 | + Type localVarReturnType = new TypeToken<GenerateAITranslationUtteranceAudioResponse>(){}.getType(); |
| 321 | + apiClient.executeAsync(call, localVarReturnType, callback); |
| 322 | + return call; |
| 323 | + } |
196 | 324 | /** |
197 | 325 | * Build call for getAITranslationProject |
198 | 326 | * @param body (required) |
@@ -937,6 +1065,130 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don |
937 | 1065 | apiClient.executeAsync(call, localVarReturnType, callback); |
938 | 1066 | return call; |
939 | 1067 | } |
| 1068 | + /** |
| 1069 | + * Build call for updateAITranslationSpeakers |
| 1070 | + * @param body (required) |
| 1071 | + * @param progressListener Progress listener |
| 1072 | + * @param progressRequestListener Progress request listener |
| 1073 | + * @return Call to execute |
| 1074 | + * @throws ApiException If fail to serialize the request body object |
| 1075 | + */ |
| 1076 | + public com.squareup.okhttp.Call updateAITranslationSpeakersCall(UpdateAITranslationSpeakersRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 1077 | + Object localVarPostBody = body; |
| 1078 | + |
| 1079 | + // create path and map variables |
| 1080 | + String localVarPath = "/UpdateAITranslationSpeakers/2025-01-01/vod/post/application_json/"; |
| 1081 | + |
| 1082 | + List<Pair> localVarQueryParams = new ArrayList<Pair>(); |
| 1083 | + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); |
| 1084 | + |
| 1085 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 1086 | + |
| 1087 | + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); |
| 1088 | + |
| 1089 | + final String[] localVarAccepts = { |
| 1090 | + "application/json" |
| 1091 | + }; |
| 1092 | + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); |
| 1093 | + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); |
| 1094 | + |
| 1095 | + final String[] localVarContentTypes = { |
| 1096 | + "text/plain" |
| 1097 | + }; |
| 1098 | + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); |
| 1099 | + localVarHeaderParams.put("Content-Type", localVarContentType); |
| 1100 | + |
| 1101 | + if(progressListener != null) { |
| 1102 | + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { |
| 1103 | + @Override |
| 1104 | + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { |
| 1105 | + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); |
| 1106 | + return originalResponse.newBuilder() |
| 1107 | + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) |
| 1108 | + .build(); |
| 1109 | + } |
| 1110 | + }); |
| 1111 | + } |
| 1112 | + |
| 1113 | + String[] localVarAuthNames = new String[] { "volcengineSign" }; |
| 1114 | + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); |
| 1115 | + } |
| 1116 | + |
| 1117 | + @SuppressWarnings("rawtypes") |
| 1118 | + private com.squareup.okhttp.Call updateAITranslationSpeakersValidateBeforeCall(UpdateAITranslationSpeakersRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 1119 | + // verify the required parameter 'body' is set |
| 1120 | + if (body == null) { |
| 1121 | + throw new ApiException("Missing the required parameter 'body' when calling updateAITranslationSpeakers(Async)"); |
| 1122 | + } |
| 1123 | + |
| 1124 | + com.squareup.okhttp.Call call = updateAITranslationSpeakersCall(body, progressListener, progressRequestListener); |
| 1125 | + return call; |
| 1126 | + |
| 1127 | + |
| 1128 | + |
| 1129 | + |
| 1130 | + |
| 1131 | + } |
| 1132 | + |
| 1133 | + /** |
| 1134 | + * |
| 1135 | + * |
| 1136 | + * @param body (required) |
| 1137 | + * @return UpdateAITranslationSpeakersResponse |
| 1138 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 1139 | + */ |
| 1140 | + public UpdateAITranslationSpeakersResponse updateAITranslationSpeakers(UpdateAITranslationSpeakersRequest body) throws ApiException { |
| 1141 | + ApiResponse<UpdateAITranslationSpeakersResponse> resp = updateAITranslationSpeakersWithHttpInfo(body); |
| 1142 | + return resp.getData(); |
| 1143 | + } |
| 1144 | + |
| 1145 | + /** |
| 1146 | + * |
| 1147 | + * |
| 1148 | + * @param body (required) |
| 1149 | + * @return ApiResponse<UpdateAITranslationSpeakersResponse> |
| 1150 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 1151 | + */ |
| 1152 | + public ApiResponse<UpdateAITranslationSpeakersResponse> updateAITranslationSpeakersWithHttpInfo( @NotNull UpdateAITranslationSpeakersRequest body) throws ApiException { |
| 1153 | + com.squareup.okhttp.Call call = updateAITranslationSpeakersValidateBeforeCall(body, null, null); |
| 1154 | + Type localVarReturnType = new TypeToken<UpdateAITranslationSpeakersResponse>(){}.getType(); |
| 1155 | + return apiClient.execute(call, localVarReturnType); |
| 1156 | + } |
| 1157 | + |
| 1158 | + /** |
| 1159 | + * (asynchronously) |
| 1160 | + * |
| 1161 | + * @param body (required) |
| 1162 | + * @param callback The callback to be executed when the API call finishes |
| 1163 | + * @return The request call |
| 1164 | + * @throws ApiException If fail to process the API call, e.g. serializing the request body object |
| 1165 | + */ |
| 1166 | + public com.squareup.okhttp.Call updateAITranslationSpeakersAsync(UpdateAITranslationSpeakersRequest body, final ApiCallback<UpdateAITranslationSpeakersResponse> callback) throws ApiException { |
| 1167 | + |
| 1168 | + ProgressResponseBody.ProgressListener progressListener = null; |
| 1169 | + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; |
| 1170 | + |
| 1171 | + if (callback != null) { |
| 1172 | + progressListener = new ProgressResponseBody.ProgressListener() { |
| 1173 | + @Override |
| 1174 | + public void update(long bytesRead, long contentLength, boolean done) { |
| 1175 | + callback.onDownloadProgress(bytesRead, contentLength, done); |
| 1176 | + } |
| 1177 | + }; |
| 1178 | + |
| 1179 | + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { |
| 1180 | + @Override |
| 1181 | + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { |
| 1182 | + callback.onUploadProgress(bytesWritten, contentLength, done); |
| 1183 | + } |
| 1184 | + }; |
| 1185 | + } |
| 1186 | + |
| 1187 | + com.squareup.okhttp.Call call = updateAITranslationSpeakersValidateBeforeCall(body, progressListener, progressRequestListener); |
| 1188 | + Type localVarReturnType = new TypeToken<UpdateAITranslationSpeakersResponse>(){}.getType(); |
| 1189 | + apiClient.executeAsync(call, localVarReturnType, callback); |
| 1190 | + return call; |
| 1191 | + } |
940 | 1192 | /** |
941 | 1193 | * Build call for updateAITranslationUtterances |
942 | 1194 | * @param body (required) |
|
0 commit comments