|
63 | 63 | import com.volcengine.vefaas.model.GetTimerResponse; |
64 | 64 | import com.volcengine.vefaas.model.KillSandboxRequest; |
65 | 65 | import com.volcengine.vefaas.model.KillSandboxResponse; |
| 66 | +import com.volcengine.vefaas.model.ListAsyncTasksRequest; |
| 67 | +import com.volcengine.vefaas.model.ListAsyncTasksResponse; |
66 | 68 | import com.volcengine.vefaas.model.ListFunctionElasticScaleStrategyRequest; |
67 | 69 | import com.volcengine.vefaas.model.ListFunctionElasticScaleStrategyResponse; |
68 | 70 | import com.volcengine.vefaas.model.ListFunctionInstancesRequest; |
@@ -2357,6 +2359,130 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don |
2357 | 2359 | apiClient.executeAsync(call, localVarReturnType, callback); |
2358 | 2360 | return call; |
2359 | 2361 | } |
| 2362 | + /** |
| 2363 | + * Build call for listAsyncTasks |
| 2364 | + * @param body (required) |
| 2365 | + * @param progressListener Progress listener |
| 2366 | + * @param progressRequestListener Progress request listener |
| 2367 | + * @return Call to execute |
| 2368 | + * @throws ApiException If fail to serialize the request body object |
| 2369 | + */ |
| 2370 | + public com.squareup.okhttp.Call listAsyncTasksCall(ListAsyncTasksRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 2371 | + Object localVarPostBody = body; |
| 2372 | + |
| 2373 | + // create path and map variables |
| 2374 | + String localVarPath = "/ListAsyncTasks/2024-06-06/vefaas/post/application_json/"; |
| 2375 | + |
| 2376 | + List<Pair> localVarQueryParams = new ArrayList<Pair>(); |
| 2377 | + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); |
| 2378 | + |
| 2379 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 2380 | + |
| 2381 | + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); |
| 2382 | + |
| 2383 | + final String[] localVarAccepts = { |
| 2384 | + "application/json" |
| 2385 | + }; |
| 2386 | + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); |
| 2387 | + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); |
| 2388 | + |
| 2389 | + final String[] localVarContentTypes = { |
| 2390 | + "text/plain" |
| 2391 | + }; |
| 2392 | + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); |
| 2393 | + localVarHeaderParams.put("Content-Type", localVarContentType); |
| 2394 | + |
| 2395 | + if(progressListener != null) { |
| 2396 | + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { |
| 2397 | + @Override |
| 2398 | + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { |
| 2399 | + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); |
| 2400 | + return originalResponse.newBuilder() |
| 2401 | + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) |
| 2402 | + .build(); |
| 2403 | + } |
| 2404 | + }); |
| 2405 | + } |
| 2406 | + |
| 2407 | + String[] localVarAuthNames = new String[] { "volcengineSign" }; |
| 2408 | + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); |
| 2409 | + } |
| 2410 | + |
| 2411 | + @SuppressWarnings("rawtypes") |
| 2412 | + private com.squareup.okhttp.Call listAsyncTasksValidateBeforeCall(ListAsyncTasksRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 2413 | + // verify the required parameter 'body' is set |
| 2414 | + if (body == null) { |
| 2415 | + throw new ApiException("Missing the required parameter 'body' when calling listAsyncTasks(Async)"); |
| 2416 | + } |
| 2417 | + |
| 2418 | + com.squareup.okhttp.Call call = listAsyncTasksCall(body, progressListener, progressRequestListener); |
| 2419 | + return call; |
| 2420 | + |
| 2421 | + |
| 2422 | + |
| 2423 | + |
| 2424 | + |
| 2425 | + } |
| 2426 | + |
| 2427 | + /** |
| 2428 | + * |
| 2429 | + * |
| 2430 | + * @param body (required) |
| 2431 | + * @return ListAsyncTasksResponse |
| 2432 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 2433 | + */ |
| 2434 | + public ListAsyncTasksResponse listAsyncTasks(ListAsyncTasksRequest body) throws ApiException { |
| 2435 | + ApiResponse<ListAsyncTasksResponse> resp = listAsyncTasksWithHttpInfo(body); |
| 2436 | + return resp.getData(); |
| 2437 | + } |
| 2438 | + |
| 2439 | + /** |
| 2440 | + * |
| 2441 | + * |
| 2442 | + * @param body (required) |
| 2443 | + * @return ApiResponse<ListAsyncTasksResponse> |
| 2444 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 2445 | + */ |
| 2446 | + public ApiResponse<ListAsyncTasksResponse> listAsyncTasksWithHttpInfo( @NotNull ListAsyncTasksRequest body) throws ApiException { |
| 2447 | + com.squareup.okhttp.Call call = listAsyncTasksValidateBeforeCall(body, null, null); |
| 2448 | + Type localVarReturnType = new TypeToken<ListAsyncTasksResponse>(){}.getType(); |
| 2449 | + return apiClient.execute(call, localVarReturnType); |
| 2450 | + } |
| 2451 | + |
| 2452 | + /** |
| 2453 | + * (asynchronously) |
| 2454 | + * |
| 2455 | + * @param body (required) |
| 2456 | + * @param callback The callback to be executed when the API call finishes |
| 2457 | + * @return The request call |
| 2458 | + * @throws ApiException If fail to process the API call, e.g. serializing the request body object |
| 2459 | + */ |
| 2460 | + public com.squareup.okhttp.Call listAsyncTasksAsync(ListAsyncTasksRequest body, final ApiCallback<ListAsyncTasksResponse> callback) throws ApiException { |
| 2461 | + |
| 2462 | + ProgressResponseBody.ProgressListener progressListener = null; |
| 2463 | + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; |
| 2464 | + |
| 2465 | + if (callback != null) { |
| 2466 | + progressListener = new ProgressResponseBody.ProgressListener() { |
| 2467 | + @Override |
| 2468 | + public void update(long bytesRead, long contentLength, boolean done) { |
| 2469 | + callback.onDownloadProgress(bytesRead, contentLength, done); |
| 2470 | + } |
| 2471 | + }; |
| 2472 | + |
| 2473 | + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { |
| 2474 | + @Override |
| 2475 | + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { |
| 2476 | + callback.onUploadProgress(bytesWritten, contentLength, done); |
| 2477 | + } |
| 2478 | + }; |
| 2479 | + } |
| 2480 | + |
| 2481 | + com.squareup.okhttp.Call call = listAsyncTasksValidateBeforeCall(body, progressListener, progressRequestListener); |
| 2482 | + Type localVarReturnType = new TypeToken<ListAsyncTasksResponse>(){}.getType(); |
| 2483 | + apiClient.executeAsync(call, localVarReturnType, callback); |
| 2484 | + return call; |
| 2485 | + } |
2360 | 2486 | /** |
2361 | 2487 | * Build call for listFunctionElasticScaleStrategy |
2362 | 2488 | * @param body (required) |
|
0 commit comments