|
41 | 41 | import com.volcengine.speechsaasprod.model.ListAPIKeysResponse; |
42 | 42 | import com.volcengine.speechsaasprod.model.ListBigModelTTSTimbresRequest; |
43 | 43 | import com.volcengine.speechsaasprod.model.ListBigModelTTSTimbresResponse; |
| 44 | +import com.volcengine.speechsaasprod.model.ListSpeakersRequest; |
| 45 | +import com.volcengine.speechsaasprod.model.ListSpeakersResponse; |
44 | 46 | import com.volcengine.speechsaasprod.model.OrderResourcePacksRequest; |
45 | 47 | import com.volcengine.speechsaasprod.model.OrderResourcePacksResponse; |
46 | 48 | import com.volcengine.speechsaasprod.model.PauseServiceRequest; |
@@ -949,6 +951,130 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don |
949 | 951 | apiClient.executeAsync(call, localVarReturnType, callback); |
950 | 952 | return call; |
951 | 953 | } |
| 954 | + /** |
| 955 | + * Build call for listSpeakers |
| 956 | + * @param body (required) |
| 957 | + * @param progressListener Progress listener |
| 958 | + * @param progressRequestListener Progress request listener |
| 959 | + * @return Call to execute |
| 960 | + * @throws ApiException If fail to serialize the request body object |
| 961 | + */ |
| 962 | + public com.squareup.okhttp.Call listSpeakersCall(ListSpeakersRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 963 | + Object localVarPostBody = body; |
| 964 | + |
| 965 | + // create path and map variables |
| 966 | + String localVarPath = "/ListSpeakers/2025-05-20/speech_saas_prod/post/application_json/"; |
| 967 | + |
| 968 | + List<Pair> localVarQueryParams = new ArrayList<Pair>(); |
| 969 | + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); |
| 970 | + |
| 971 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 972 | + |
| 973 | + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); |
| 974 | + |
| 975 | + final String[] localVarAccepts = { |
| 976 | + "application/json" |
| 977 | + }; |
| 978 | + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); |
| 979 | + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); |
| 980 | + |
| 981 | + final String[] localVarContentTypes = { |
| 982 | + "text/plain" |
| 983 | + }; |
| 984 | + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); |
| 985 | + localVarHeaderParams.put("Content-Type", localVarContentType); |
| 986 | + |
| 987 | + if(progressListener != null) { |
| 988 | + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { |
| 989 | + @Override |
| 990 | + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { |
| 991 | + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); |
| 992 | + return originalResponse.newBuilder() |
| 993 | + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) |
| 994 | + .build(); |
| 995 | + } |
| 996 | + }); |
| 997 | + } |
| 998 | + |
| 999 | + String[] localVarAuthNames = new String[] { "volcengineSign" }; |
| 1000 | + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); |
| 1001 | + } |
| 1002 | + |
| 1003 | + @SuppressWarnings("rawtypes") |
| 1004 | + private com.squareup.okhttp.Call listSpeakersValidateBeforeCall(ListSpeakersRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 1005 | + // verify the required parameter 'body' is set |
| 1006 | + if (body == null) { |
| 1007 | + throw new ApiException("Missing the required parameter 'body' when calling listSpeakers(Async)"); |
| 1008 | + } |
| 1009 | + |
| 1010 | + com.squareup.okhttp.Call call = listSpeakersCall(body, progressListener, progressRequestListener); |
| 1011 | + return call; |
| 1012 | + |
| 1013 | + |
| 1014 | + |
| 1015 | + |
| 1016 | + |
| 1017 | + } |
| 1018 | + |
| 1019 | + /** |
| 1020 | + * |
| 1021 | + * |
| 1022 | + * @param body (required) |
| 1023 | + * @return ListSpeakersResponse |
| 1024 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 1025 | + */ |
| 1026 | + public ListSpeakersResponse listSpeakers(ListSpeakersRequest body) throws ApiException { |
| 1027 | + ApiResponse<ListSpeakersResponse> resp = listSpeakersWithHttpInfo(body); |
| 1028 | + return resp.getData(); |
| 1029 | + } |
| 1030 | + |
| 1031 | + /** |
| 1032 | + * |
| 1033 | + * |
| 1034 | + * @param body (required) |
| 1035 | + * @return ApiResponse<ListSpeakersResponse> |
| 1036 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 1037 | + */ |
| 1038 | + public ApiResponse<ListSpeakersResponse> listSpeakersWithHttpInfo( @NotNull ListSpeakersRequest body) throws ApiException { |
| 1039 | + com.squareup.okhttp.Call call = listSpeakersValidateBeforeCall(body, null, null); |
| 1040 | + Type localVarReturnType = new TypeToken<ListSpeakersResponse>(){}.getType(); |
| 1041 | + return apiClient.execute(call, localVarReturnType); |
| 1042 | + } |
| 1043 | + |
| 1044 | + /** |
| 1045 | + * (asynchronously) |
| 1046 | + * |
| 1047 | + * @param body (required) |
| 1048 | + * @param callback The callback to be executed when the API call finishes |
| 1049 | + * @return The request call |
| 1050 | + * @throws ApiException If fail to process the API call, e.g. serializing the request body object |
| 1051 | + */ |
| 1052 | + public com.squareup.okhttp.Call listSpeakersAsync(ListSpeakersRequest body, final ApiCallback<ListSpeakersResponse> callback) throws ApiException { |
| 1053 | + |
| 1054 | + ProgressResponseBody.ProgressListener progressListener = null; |
| 1055 | + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; |
| 1056 | + |
| 1057 | + if (callback != null) { |
| 1058 | + progressListener = new ProgressResponseBody.ProgressListener() { |
| 1059 | + @Override |
| 1060 | + public void update(long bytesRead, long contentLength, boolean done) { |
| 1061 | + callback.onDownloadProgress(bytesRead, contentLength, done); |
| 1062 | + } |
| 1063 | + }; |
| 1064 | + |
| 1065 | + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { |
| 1066 | + @Override |
| 1067 | + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { |
| 1068 | + callback.onUploadProgress(bytesWritten, contentLength, done); |
| 1069 | + } |
| 1070 | + }; |
| 1071 | + } |
| 1072 | + |
| 1073 | + com.squareup.okhttp.Call call = listSpeakersValidateBeforeCall(body, progressListener, progressRequestListener); |
| 1074 | + Type localVarReturnType = new TypeToken<ListSpeakersResponse>(){}.getType(); |
| 1075 | + apiClient.executeAsync(call, localVarReturnType, callback); |
| 1076 | + return call; |
| 1077 | + } |
952 | 1078 | /** |
953 | 1079 | * Build call for orderResourcePacks |
954 | 1080 | * @param body (required) |
|
0 commit comments