Skip to content

Commit 2d0db9f

Browse files
author
BitsAdmin
committed
Merge branch 'vefaas-Java-2024-06-06-online-1381-2025_07_22_11_23_00' into 'integration_2025-07-24_1019324691714'
feat: [development task] vefaas-1381-Java (1482731) See merge request iaasng/volcengine-java-sdk!581
2 parents 21569d7 + 77297fe commit 2d0db9f

16 files changed

+1670
-12
lines changed

volcengine-java-sdk-vefaas/src/main/java/com/volcengine/vefaas/VefaasApi.java

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@
6363
import com.volcengine.vefaas.model.GetTimerResponse;
6464
import com.volcengine.vefaas.model.KillSandboxRequest;
6565
import com.volcengine.vefaas.model.KillSandboxResponse;
66+
import com.volcengine.vefaas.model.ListAsyncTasksRequest;
67+
import com.volcengine.vefaas.model.ListAsyncTasksResponse;
6668
import com.volcengine.vefaas.model.ListFunctionElasticScaleStrategyRequest;
6769
import com.volcengine.vefaas.model.ListFunctionElasticScaleStrategyResponse;
6870
import com.volcengine.vefaas.model.ListFunctionInstancesRequest;
@@ -2357,6 +2359,130 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don
23572359
apiClient.executeAsync(call, localVarReturnType, callback);
23582360
return call;
23592361
}
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&lt;ListAsyncTasksResponse&gt;
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+
}
23602486
/**
23612487
* Build call for listFunctionElasticScaleStrategy
23622488
* @param body (required)

volcengine-java-sdk-vefaas/src/main/java/com/volcengine/vefaas/model/CreateFunctionRequest.java

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,15 @@
3939

4040

4141
public class CreateFunctionRequest {
42+
@SerializedName("Cell")
43+
private String cell = null;
44+
4245
@SerializedName("Command")
4346
private String command = null;
4447

48+
@SerializedName("CpuMilli")
49+
private Integer cpuMilli = null;
50+
4551
@SerializedName("CpuStrategy")
4652
private String cpuStrategy = null;
4753

@@ -102,6 +108,24 @@ public class CreateFunctionRequest {
102108
@SerializedName("VpcConfig")
103109
private VpcConfigForCreateFunctionInput vpcConfig = null;
104110

111+
public CreateFunctionRequest cell(String cell) {
112+
this.cell = cell;
113+
return this;
114+
}
115+
116+
/**
117+
* Get cell
118+
* @return cell
119+
**/
120+
@Schema(description = "")
121+
public String getCell() {
122+
return cell;
123+
}
124+
125+
public void setCell(String cell) {
126+
this.cell = cell;
127+
}
128+
105129
public CreateFunctionRequest command(String command) {
106130
this.command = command;
107131
return this;
@@ -120,6 +144,24 @@ public void setCommand(String command) {
120144
this.command = command;
121145
}
122146

147+
public CreateFunctionRequest cpuMilli(Integer cpuMilli) {
148+
this.cpuMilli = cpuMilli;
149+
return this;
150+
}
151+
152+
/**
153+
* Get cpuMilli
154+
* @return cpuMilli
155+
**/
156+
@Schema(description = "")
157+
public Integer getCpuMilli() {
158+
return cpuMilli;
159+
}
160+
161+
public void setCpuMilli(Integer cpuMilli) {
162+
this.cpuMilli = cpuMilli;
163+
}
164+
123165
public CreateFunctionRequest cpuStrategy(String cpuStrategy) {
124166
this.cpuStrategy = cpuStrategy;
125167
return this;
@@ -515,7 +557,9 @@ public boolean equals(java.lang.Object o) {
515557
return false;
516558
}
517559
CreateFunctionRequest createFunctionRequest = (CreateFunctionRequest) o;
518-
return Objects.equals(this.command, createFunctionRequest.command) &&
560+
return Objects.equals(this.cell, createFunctionRequest.cell) &&
561+
Objects.equals(this.command, createFunctionRequest.command) &&
562+
Objects.equals(this.cpuMilli, createFunctionRequest.cpuMilli) &&
519563
Objects.equals(this.cpuStrategy, createFunctionRequest.cpuStrategy) &&
520564
Objects.equals(this.description, createFunctionRequest.description) &&
521565
Objects.equals(this.envs, createFunctionRequest.envs) &&
@@ -540,7 +584,7 @@ public boolean equals(java.lang.Object o) {
540584

541585
@Override
542586
public int hashCode() {
543-
return Objects.hash(command, cpuStrategy, description, envs, exclusiveMode, initializerSec, instanceType, maxConcurrency, memoryMB, name, nasStorage, projectName, requestTimeout, runtime, source, sourceAccessConfig, sourceType, tags, tlsConfig, tosMountConfig, vpcConfig);
587+
return Objects.hash(cell, command, cpuMilli, cpuStrategy, description, envs, exclusiveMode, initializerSec, instanceType, maxConcurrency, memoryMB, name, nasStorage, projectName, requestTimeout, runtime, source, sourceAccessConfig, sourceType, tags, tlsConfig, tosMountConfig, vpcConfig);
544588
}
545589

546590

@@ -549,7 +593,9 @@ public String toString() {
549593
StringBuilder sb = new StringBuilder();
550594
sb.append("class CreateFunctionRequest {\n");
551595

596+
sb.append(" cell: ").append(toIndentedString(cell)).append("\n");
552597
sb.append(" command: ").append(toIndentedString(command)).append("\n");
598+
sb.append(" cpuMilli: ").append(toIndentedString(cpuMilli)).append("\n");
553599
sb.append(" cpuStrategy: ").append(toIndentedString(cpuStrategy)).append("\n");
554600
sb.append(" description: ").append(toIndentedString(description)).append("\n");
555601
sb.append(" envs: ").append(toIndentedString(envs)).append("\n");

0 commit comments

Comments
 (0)