|
37 | 37 | import com.volcengine.ark.model.DeleteEndpointResponse; |
38 | 38 | import com.volcengine.ark.model.GetApiKeyRequest; |
39 | 39 | import com.volcengine.ark.model.GetApiKeyResponse; |
| 40 | +import com.volcengine.ark.model.GetEndpointCertificateRequest; |
| 41 | +import com.volcengine.ark.model.GetEndpointCertificateResponse; |
40 | 42 | import com.volcengine.ark.model.GetEndpointRequest; |
41 | 43 | import com.volcengine.ark.model.GetEndpointResponse; |
42 | 44 | import com.volcengine.ark.model.GetModelCustomizationJobRequest; |
@@ -817,6 +819,130 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don |
817 | 819 | apiClient.executeAsync(call, localVarReturnType, callback); |
818 | 820 | return call; |
819 | 821 | } |
| 822 | + /** |
| 823 | + * Build call for getEndpointCertificate |
| 824 | + * @param body (required) |
| 825 | + * @param progressListener Progress listener |
| 826 | + * @param progressRequestListener Progress request listener |
| 827 | + * @return Call to execute |
| 828 | + * @throws ApiException If fail to serialize the request body object |
| 829 | + */ |
| 830 | + public com.squareup.okhttp.Call getEndpointCertificateCall(GetEndpointCertificateRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 831 | + Object localVarPostBody = body; |
| 832 | + |
| 833 | + // create path and map variables |
| 834 | + String localVarPath = "/GetEndpointCertificate/2024-01-01/ark/post/application_json/"; |
| 835 | + |
| 836 | + List<Pair> localVarQueryParams = new ArrayList<Pair>(); |
| 837 | + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); |
| 838 | + |
| 839 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 840 | + |
| 841 | + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); |
| 842 | + |
| 843 | + final String[] localVarAccepts = { |
| 844 | + "application/json" |
| 845 | + }; |
| 846 | + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); |
| 847 | + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); |
| 848 | + |
| 849 | + final String[] localVarContentTypes = { |
| 850 | + "text/plain" |
| 851 | + }; |
| 852 | + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); |
| 853 | + localVarHeaderParams.put("Content-Type", localVarContentType); |
| 854 | + |
| 855 | + if(progressListener != null) { |
| 856 | + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { |
| 857 | + @Override |
| 858 | + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { |
| 859 | + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); |
| 860 | + return originalResponse.newBuilder() |
| 861 | + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) |
| 862 | + .build(); |
| 863 | + } |
| 864 | + }); |
| 865 | + } |
| 866 | + |
| 867 | + String[] localVarAuthNames = new String[] { "volcengineSign" }; |
| 868 | + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); |
| 869 | + } |
| 870 | + |
| 871 | + @SuppressWarnings("rawtypes") |
| 872 | + private com.squareup.okhttp.Call getEndpointCertificateValidateBeforeCall(GetEndpointCertificateRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 873 | + // verify the required parameter 'body' is set |
| 874 | + if (body == null) { |
| 875 | + throw new ApiException("Missing the required parameter 'body' when calling getEndpointCertificate(Async)"); |
| 876 | + } |
| 877 | + |
| 878 | + com.squareup.okhttp.Call call = getEndpointCertificateCall(body, progressListener, progressRequestListener); |
| 879 | + return call; |
| 880 | + |
| 881 | + |
| 882 | + |
| 883 | + |
| 884 | + |
| 885 | + } |
| 886 | + |
| 887 | + /** |
| 888 | + * |
| 889 | + * |
| 890 | + * @param body (required) |
| 891 | + * @return GetEndpointCertificateResponse |
| 892 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 893 | + */ |
| 894 | + public GetEndpointCertificateResponse getEndpointCertificate(GetEndpointCertificateRequest body) throws ApiException { |
| 895 | + ApiResponse<GetEndpointCertificateResponse> resp = getEndpointCertificateWithHttpInfo(body); |
| 896 | + return resp.getData(); |
| 897 | + } |
| 898 | + |
| 899 | + /** |
| 900 | + * |
| 901 | + * |
| 902 | + * @param body (required) |
| 903 | + * @return ApiResponse<GetEndpointCertificateResponse> |
| 904 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 905 | + */ |
| 906 | + public ApiResponse<GetEndpointCertificateResponse> getEndpointCertificateWithHttpInfo( @NotNull GetEndpointCertificateRequest body) throws ApiException { |
| 907 | + com.squareup.okhttp.Call call = getEndpointCertificateValidateBeforeCall(body, null, null); |
| 908 | + Type localVarReturnType = new TypeToken<GetEndpointCertificateResponse>(){}.getType(); |
| 909 | + return apiClient.execute(call, localVarReturnType); |
| 910 | + } |
| 911 | + |
| 912 | + /** |
| 913 | + * (asynchronously) |
| 914 | + * |
| 915 | + * @param body (required) |
| 916 | + * @param callback The callback to be executed when the API call finishes |
| 917 | + * @return The request call |
| 918 | + * @throws ApiException If fail to process the API call, e.g. serializing the request body object |
| 919 | + */ |
| 920 | + public com.squareup.okhttp.Call getEndpointCertificateAsync(GetEndpointCertificateRequest body, final ApiCallback<GetEndpointCertificateResponse> callback) throws ApiException { |
| 921 | + |
| 922 | + ProgressResponseBody.ProgressListener progressListener = null; |
| 923 | + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; |
| 924 | + |
| 925 | + if (callback != null) { |
| 926 | + progressListener = new ProgressResponseBody.ProgressListener() { |
| 927 | + @Override |
| 928 | + public void update(long bytesRead, long contentLength, boolean done) { |
| 929 | + callback.onDownloadProgress(bytesRead, contentLength, done); |
| 930 | + } |
| 931 | + }; |
| 932 | + |
| 933 | + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { |
| 934 | + @Override |
| 935 | + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { |
| 936 | + callback.onUploadProgress(bytesWritten, contentLength, done); |
| 937 | + } |
| 938 | + }; |
| 939 | + } |
| 940 | + |
| 941 | + com.squareup.okhttp.Call call = getEndpointCertificateValidateBeforeCall(body, progressListener, progressRequestListener); |
| 942 | + Type localVarReturnType = new TypeToken<GetEndpointCertificateResponse>(){}.getType(); |
| 943 | + apiClient.executeAsync(call, localVarReturnType, callback); |
| 944 | + return call; |
| 945 | + } |
820 | 946 | /** |
821 | 947 | * Build call for getModelCustomizationJob |
822 | 948 | * @param body (required) |
|
0 commit comments