Skip to content

Commit 86865ff

Browse files
author
BitsAdmin
committed
Merge 'vefaas-Java-2024-06-06-online-2453-2026_03_31_21_23_56' into 'integration_2026-04-02_1133415429890'
feat: [development task] vefaas-2453-Java (2246440) See merge request: !946
2 parents 9cd07f6 + 233bcfd commit 86865ff

5 files changed

Lines changed: 687 additions & 0 deletions

File tree

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

Lines changed: 252 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,16 @@
107107
import com.volcengine.vefaas.model.ListSandboxesResponse;
108108
import com.volcengine.vefaas.model.ListTriggersRequest;
109109
import com.volcengine.vefaas.model.ListTriggersResponse;
110+
import com.volcengine.vefaas.model.PauseSandboxRequest;
111+
import com.volcengine.vefaas.model.PauseSandboxResponse;
110112
import com.volcengine.vefaas.model.PrecacheSandboxImagesRequest;
111113
import com.volcengine.vefaas.model.PrecacheSandboxImagesResponse;
112114
import com.volcengine.vefaas.model.QueryUserCrVpcTunnelRequest;
113115
import com.volcengine.vefaas.model.QueryUserCrVpcTunnelResponse;
114116
import com.volcengine.vefaas.model.ReleaseRequest;
115117
import com.volcengine.vefaas.model.ReleaseResponse;
118+
import com.volcengine.vefaas.model.ResumeSandboxRequest;
119+
import com.volcengine.vefaas.model.ResumeSandboxResponse;
116120
import com.volcengine.vefaas.model.SetSandboxTimeoutRequest;
117121
import com.volcengine.vefaas.model.SetSandboxTimeoutResponse;
118122
import com.volcengine.vefaas.model.TerminateAsyncTaskRequest;
@@ -5119,6 +5123,130 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don
51195123
apiClient.executeAsync(call, localVarReturnType, callback);
51205124
return call;
51215125
}
5126+
/**
5127+
* Build call for pauseSandbox
5128+
* @param body (required)
5129+
* @param progressListener Progress listener
5130+
* @param progressRequestListener Progress request listener
5131+
* @return Call to execute
5132+
* @throws ApiException If fail to serialize the request body object
5133+
*/
5134+
public com.squareup.okhttp.Call pauseSandboxCall(PauseSandboxRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
5135+
Object localVarPostBody = body;
5136+
5137+
// create path and map variables
5138+
String localVarPath = "/PauseSandbox/2024-06-06/vefaas/post/application_json/";
5139+
5140+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
5141+
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
5142+
5143+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
5144+
5145+
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
5146+
5147+
final String[] localVarAccepts = {
5148+
"application/json"
5149+
};
5150+
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
5151+
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
5152+
5153+
final String[] localVarContentTypes = {
5154+
"text/plain"
5155+
};
5156+
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
5157+
localVarHeaderParams.put("Content-Type", localVarContentType);
5158+
5159+
if(progressListener != null) {
5160+
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
5161+
@Override
5162+
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
5163+
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
5164+
return originalResponse.newBuilder()
5165+
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
5166+
.build();
5167+
}
5168+
});
5169+
}
5170+
5171+
String[] localVarAuthNames = new String[] { "volcengineSign" };
5172+
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
5173+
}
5174+
5175+
@SuppressWarnings("rawtypes")
5176+
private com.squareup.okhttp.Call pauseSandboxValidateBeforeCall(PauseSandboxRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
5177+
// verify the required parameter 'body' is set
5178+
if (body == null) {
5179+
throw new ApiException("Missing the required parameter 'body' when calling pauseSandbox(Async)");
5180+
}
5181+
5182+
com.squareup.okhttp.Call call = pauseSandboxCall(body, progressListener, progressRequestListener);
5183+
return call;
5184+
5185+
5186+
5187+
5188+
5189+
}
5190+
5191+
/**
5192+
*
5193+
*
5194+
* @param body (required)
5195+
* @return PauseSandboxResponse
5196+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
5197+
*/
5198+
public PauseSandboxResponse pauseSandbox(PauseSandboxRequest body) throws ApiException {
5199+
ApiResponse<PauseSandboxResponse> resp = pauseSandboxWithHttpInfo(body);
5200+
return resp.getData();
5201+
}
5202+
5203+
/**
5204+
*
5205+
*
5206+
* @param body (required)
5207+
* @return ApiResponse&lt;PauseSandboxResponse&gt;
5208+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
5209+
*/
5210+
public ApiResponse<PauseSandboxResponse> pauseSandboxWithHttpInfo( @NotNull PauseSandboxRequest body) throws ApiException {
5211+
com.squareup.okhttp.Call call = pauseSandboxValidateBeforeCall(body, null, null);
5212+
Type localVarReturnType = new TypeToken<PauseSandboxResponse>(){}.getType();
5213+
return apiClient.execute(call, localVarReturnType);
5214+
}
5215+
5216+
/**
5217+
* (asynchronously)
5218+
*
5219+
* @param body (required)
5220+
* @param callback The callback to be executed when the API call finishes
5221+
* @return The request call
5222+
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
5223+
*/
5224+
public com.squareup.okhttp.Call pauseSandboxAsync(PauseSandboxRequest body, final ApiCallback<PauseSandboxResponse> callback) throws ApiException {
5225+
5226+
ProgressResponseBody.ProgressListener progressListener = null;
5227+
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
5228+
5229+
if (callback != null) {
5230+
progressListener = new ProgressResponseBody.ProgressListener() {
5231+
@Override
5232+
public void update(long bytesRead, long contentLength, boolean done) {
5233+
callback.onDownloadProgress(bytesRead, contentLength, done);
5234+
}
5235+
};
5236+
5237+
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
5238+
@Override
5239+
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
5240+
callback.onUploadProgress(bytesWritten, contentLength, done);
5241+
}
5242+
};
5243+
}
5244+
5245+
com.squareup.okhttp.Call call = pauseSandboxValidateBeforeCall(body, progressListener, progressRequestListener);
5246+
Type localVarReturnType = new TypeToken<PauseSandboxResponse>(){}.getType();
5247+
apiClient.executeAsync(call, localVarReturnType, callback);
5248+
return call;
5249+
}
51225250
/**
51235251
* Build call for precacheSandboxImages
51245252
* @param body (required)
@@ -5491,6 +5619,130 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don
54915619
apiClient.executeAsync(call, localVarReturnType, callback);
54925620
return call;
54935621
}
5622+
/**
5623+
* Build call for resumeSandbox
5624+
* @param body (required)
5625+
* @param progressListener Progress listener
5626+
* @param progressRequestListener Progress request listener
5627+
* @return Call to execute
5628+
* @throws ApiException If fail to serialize the request body object
5629+
*/
5630+
public com.squareup.okhttp.Call resumeSandboxCall(ResumeSandboxRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
5631+
Object localVarPostBody = body;
5632+
5633+
// create path and map variables
5634+
String localVarPath = "/ResumeSandbox/2024-06-06/vefaas/post/application_json/";
5635+
5636+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
5637+
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
5638+
5639+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
5640+
5641+
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
5642+
5643+
final String[] localVarAccepts = {
5644+
"application/json"
5645+
};
5646+
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
5647+
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
5648+
5649+
final String[] localVarContentTypes = {
5650+
"text/plain"
5651+
};
5652+
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
5653+
localVarHeaderParams.put("Content-Type", localVarContentType);
5654+
5655+
if(progressListener != null) {
5656+
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
5657+
@Override
5658+
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
5659+
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
5660+
return originalResponse.newBuilder()
5661+
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
5662+
.build();
5663+
}
5664+
});
5665+
}
5666+
5667+
String[] localVarAuthNames = new String[] { "volcengineSign" };
5668+
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
5669+
}
5670+
5671+
@SuppressWarnings("rawtypes")
5672+
private com.squareup.okhttp.Call resumeSandboxValidateBeforeCall(ResumeSandboxRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
5673+
// verify the required parameter 'body' is set
5674+
if (body == null) {
5675+
throw new ApiException("Missing the required parameter 'body' when calling resumeSandbox(Async)");
5676+
}
5677+
5678+
com.squareup.okhttp.Call call = resumeSandboxCall(body, progressListener, progressRequestListener);
5679+
return call;
5680+
5681+
5682+
5683+
5684+
5685+
}
5686+
5687+
/**
5688+
*
5689+
*
5690+
* @param body (required)
5691+
* @return ResumeSandboxResponse
5692+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
5693+
*/
5694+
public ResumeSandboxResponse resumeSandbox(ResumeSandboxRequest body) throws ApiException {
5695+
ApiResponse<ResumeSandboxResponse> resp = resumeSandboxWithHttpInfo(body);
5696+
return resp.getData();
5697+
}
5698+
5699+
/**
5700+
*
5701+
*
5702+
* @param body (required)
5703+
* @return ApiResponse&lt;ResumeSandboxResponse&gt;
5704+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
5705+
*/
5706+
public ApiResponse<ResumeSandboxResponse> resumeSandboxWithHttpInfo( @NotNull ResumeSandboxRequest body) throws ApiException {
5707+
com.squareup.okhttp.Call call = resumeSandboxValidateBeforeCall(body, null, null);
5708+
Type localVarReturnType = new TypeToken<ResumeSandboxResponse>(){}.getType();
5709+
return apiClient.execute(call, localVarReturnType);
5710+
}
5711+
5712+
/**
5713+
* (asynchronously)
5714+
*
5715+
* @param body (required)
5716+
* @param callback The callback to be executed when the API call finishes
5717+
* @return The request call
5718+
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
5719+
*/
5720+
public com.squareup.okhttp.Call resumeSandboxAsync(ResumeSandboxRequest body, final ApiCallback<ResumeSandboxResponse> callback) throws ApiException {
5721+
5722+
ProgressResponseBody.ProgressListener progressListener = null;
5723+
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
5724+
5725+
if (callback != null) {
5726+
progressListener = new ProgressResponseBody.ProgressListener() {
5727+
@Override
5728+
public void update(long bytesRead, long contentLength, boolean done) {
5729+
callback.onDownloadProgress(bytesRead, contentLength, done);
5730+
}
5731+
};
5732+
5733+
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
5734+
@Override
5735+
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
5736+
callback.onUploadProgress(bytesWritten, contentLength, done);
5737+
}
5738+
};
5739+
}
5740+
5741+
com.squareup.okhttp.Call call = resumeSandboxValidateBeforeCall(body, progressListener, progressRequestListener);
5742+
Type localVarReturnType = new TypeToken<ResumeSandboxResponse>(){}.getType();
5743+
apiClient.executeAsync(call, localVarReturnType, callback);
5744+
return call;
5745+
}
54945746
/**
54955747
* Build call for setSandboxTimeout
54965748
* @param body (required)
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
/*
2+
* vefaas
3+
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
4+
*
5+
* OpenAPI spec version: common-version
6+
*
7+
*
8+
* NOTE: This class is auto generated by the swagger code generator program.
9+
* https://github.com/swagger-api/swagger-codegen.git
10+
* Do not edit the class manually.
11+
*/
12+
13+
package com.volcengine.vefaas.model;
14+
15+
import java.util.Objects;
16+
import java.util.Arrays;
17+
import com.google.gson.TypeAdapter;
18+
import com.google.gson.annotations.JsonAdapter;
19+
import com.google.gson.annotations.SerializedName;
20+
import com.google.gson.stream.JsonReader;
21+
import com.google.gson.stream.JsonWriter;
22+
import io.swagger.v3.oas.annotations.media.Schema;
23+
import java.io.IOException;
24+
import javax.validation.constraints.*;
25+
import javax.validation.Valid;
26+
/**
27+
* PauseSandboxRequest
28+
*/
29+
30+
31+
32+
public class PauseSandboxRequest {
33+
@SerializedName("FunctionId")
34+
private String functionId = null;
35+
36+
@SerializedName("SandboxId")
37+
private String sandboxId = null;
38+
39+
public PauseSandboxRequest functionId(String functionId) {
40+
this.functionId = functionId;
41+
return this;
42+
}
43+
44+
/**
45+
* Get functionId
46+
* @return functionId
47+
**/
48+
@NotNull
49+
@Schema(required = true, description = "")
50+
public String getFunctionId() {
51+
return functionId;
52+
}
53+
54+
public void setFunctionId(String functionId) {
55+
this.functionId = functionId;
56+
}
57+
58+
public PauseSandboxRequest sandboxId(String sandboxId) {
59+
this.sandboxId = sandboxId;
60+
return this;
61+
}
62+
63+
/**
64+
* Get sandboxId
65+
* @return sandboxId
66+
**/
67+
@NotNull
68+
@Schema(required = true, description = "")
69+
public String getSandboxId() {
70+
return sandboxId;
71+
}
72+
73+
public void setSandboxId(String sandboxId) {
74+
this.sandboxId = sandboxId;
75+
}
76+
77+
78+
@Override
79+
public boolean equals(java.lang.Object o) {
80+
if (this == o) {
81+
return true;
82+
}
83+
if (o == null || getClass() != o.getClass()) {
84+
return false;
85+
}
86+
PauseSandboxRequest pauseSandboxRequest = (PauseSandboxRequest) o;
87+
return Objects.equals(this.functionId, pauseSandboxRequest.functionId) &&
88+
Objects.equals(this.sandboxId, pauseSandboxRequest.sandboxId);
89+
}
90+
91+
@Override
92+
public int hashCode() {
93+
return Objects.hash(functionId, sandboxId);
94+
}
95+
96+
97+
@Override
98+
public String toString() {
99+
StringBuilder sb = new StringBuilder();
100+
sb.append("class PauseSandboxRequest {\n");
101+
102+
sb.append(" functionId: ").append(toIndentedString(functionId)).append("\n");
103+
sb.append(" sandboxId: ").append(toIndentedString(sandboxId)).append("\n");
104+
sb.append("}");
105+
return sb.toString();
106+
}
107+
108+
/**
109+
* Convert the given object to string with each line indented by 4 spaces
110+
* (except the first line).
111+
*/
112+
private String toIndentedString(java.lang.Object o) {
113+
if (o == null) {
114+
return "null";
115+
}
116+
return o.toString().replace("\n", "\n ");
117+
}
118+
119+
}

0 commit comments

Comments
 (0)