|
139 | 139 | import com.volcengine.redis.model.FlushDBInstanceResponse; |
140 | 140 | import com.volcengine.redis.model.IncreaseDBInstanceNodeNumberRequest; |
141 | 141 | import com.volcengine.redis.model.IncreaseDBInstanceNodeNumberResponse; |
| 142 | +import com.volcengine.redis.model.InterruptKeyScanJobRequest; |
| 143 | +import com.volcengine.redis.model.InterruptKeyScanJobResponse; |
142 | 144 | import com.volcengine.redis.model.ListDBAccountRequest; |
143 | 145 | import com.volcengine.redis.model.ListDBAccountResponse; |
144 | 146 | import com.volcengine.redis.model.ModifyAllowListRequest; |
@@ -7177,6 +7179,130 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don |
7177 | 7179 | apiClient.executeAsync(call, localVarReturnType, callback); |
7178 | 7180 | return call; |
7179 | 7181 | } |
| 7182 | + /** |
| 7183 | + * Build call for interruptKeyScanJob |
| 7184 | + * @param body (required) |
| 7185 | + * @param progressListener Progress listener |
| 7186 | + * @param progressRequestListener Progress request listener |
| 7187 | + * @return Call to execute |
| 7188 | + * @throws ApiException If fail to serialize the request body object |
| 7189 | + */ |
| 7190 | + public com.squareup.okhttp.Call interruptKeyScanJobCall(InterruptKeyScanJobRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 7191 | + Object localVarPostBody = body; |
| 7192 | + |
| 7193 | + // create path and map variables |
| 7194 | + String localVarPath = "/InterruptKeyScanJob/2020-12-07/redis/post/application_json/"; |
| 7195 | + |
| 7196 | + List<Pair> localVarQueryParams = new ArrayList<Pair>(); |
| 7197 | + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); |
| 7198 | + |
| 7199 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 7200 | + |
| 7201 | + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); |
| 7202 | + |
| 7203 | + final String[] localVarAccepts = { |
| 7204 | + "application/json" |
| 7205 | + }; |
| 7206 | + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); |
| 7207 | + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); |
| 7208 | + |
| 7209 | + final String[] localVarContentTypes = { |
| 7210 | + "text/plain" |
| 7211 | + }; |
| 7212 | + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); |
| 7213 | + localVarHeaderParams.put("Content-Type", localVarContentType); |
| 7214 | + |
| 7215 | + if(progressListener != null) { |
| 7216 | + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { |
| 7217 | + @Override |
| 7218 | + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { |
| 7219 | + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); |
| 7220 | + return originalResponse.newBuilder() |
| 7221 | + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) |
| 7222 | + .build(); |
| 7223 | + } |
| 7224 | + }); |
| 7225 | + } |
| 7226 | + |
| 7227 | + String[] localVarAuthNames = new String[] { "volcengineSign" }; |
| 7228 | + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); |
| 7229 | + } |
| 7230 | + |
| 7231 | + @SuppressWarnings("rawtypes") |
| 7232 | + private com.squareup.okhttp.Call interruptKeyScanJobValidateBeforeCall(InterruptKeyScanJobRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 7233 | + // verify the required parameter 'body' is set |
| 7234 | + if (body == null) { |
| 7235 | + throw new ApiException("Missing the required parameter 'body' when calling interruptKeyScanJob(Async)"); |
| 7236 | + } |
| 7237 | + |
| 7238 | + com.squareup.okhttp.Call call = interruptKeyScanJobCall(body, progressListener, progressRequestListener); |
| 7239 | + return call; |
| 7240 | + |
| 7241 | + |
| 7242 | + |
| 7243 | + |
| 7244 | + |
| 7245 | + } |
| 7246 | + |
| 7247 | + /** |
| 7248 | + * |
| 7249 | + * |
| 7250 | + * @param body (required) |
| 7251 | + * @return InterruptKeyScanJobResponse |
| 7252 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 7253 | + */ |
| 7254 | + public InterruptKeyScanJobResponse interruptKeyScanJob(InterruptKeyScanJobRequest body) throws ApiException { |
| 7255 | + ApiResponse<InterruptKeyScanJobResponse> resp = interruptKeyScanJobWithHttpInfo(body); |
| 7256 | + return resp.getData(); |
| 7257 | + } |
| 7258 | + |
| 7259 | + /** |
| 7260 | + * |
| 7261 | + * |
| 7262 | + * @param body (required) |
| 7263 | + * @return ApiResponse<InterruptKeyScanJobResponse> |
| 7264 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 7265 | + */ |
| 7266 | + public ApiResponse<InterruptKeyScanJobResponse> interruptKeyScanJobWithHttpInfo( @NotNull InterruptKeyScanJobRequest body) throws ApiException { |
| 7267 | + com.squareup.okhttp.Call call = interruptKeyScanJobValidateBeforeCall(body, null, null); |
| 7268 | + Type localVarReturnType = new TypeToken<InterruptKeyScanJobResponse>(){}.getType(); |
| 7269 | + return apiClient.execute(call, localVarReturnType); |
| 7270 | + } |
| 7271 | + |
| 7272 | + /** |
| 7273 | + * (asynchronously) |
| 7274 | + * |
| 7275 | + * @param body (required) |
| 7276 | + * @param callback The callback to be executed when the API call finishes |
| 7277 | + * @return The request call |
| 7278 | + * @throws ApiException If fail to process the API call, e.g. serializing the request body object |
| 7279 | + */ |
| 7280 | + public com.squareup.okhttp.Call interruptKeyScanJobAsync(InterruptKeyScanJobRequest body, final ApiCallback<InterruptKeyScanJobResponse> callback) throws ApiException { |
| 7281 | + |
| 7282 | + ProgressResponseBody.ProgressListener progressListener = null; |
| 7283 | + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; |
| 7284 | + |
| 7285 | + if (callback != null) { |
| 7286 | + progressListener = new ProgressResponseBody.ProgressListener() { |
| 7287 | + @Override |
| 7288 | + public void update(long bytesRead, long contentLength, boolean done) { |
| 7289 | + callback.onDownloadProgress(bytesRead, contentLength, done); |
| 7290 | + } |
| 7291 | + }; |
| 7292 | + |
| 7293 | + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { |
| 7294 | + @Override |
| 7295 | + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { |
| 7296 | + callback.onUploadProgress(bytesWritten, contentLength, done); |
| 7297 | + } |
| 7298 | + }; |
| 7299 | + } |
| 7300 | + |
| 7301 | + com.squareup.okhttp.Call call = interruptKeyScanJobValidateBeforeCall(body, progressListener, progressRequestListener); |
| 7302 | + Type localVarReturnType = new TypeToken<InterruptKeyScanJobResponse>(){}.getType(); |
| 7303 | + apiClient.executeAsync(call, localVarReturnType, callback); |
| 7304 | + return call; |
| 7305 | + } |
7180 | 7306 | /** |
7181 | 7307 | * Build call for listDBAccount |
7182 | 7308 | * @param body (required) |
|
0 commit comments