Skip to content

Commit 2cf7b63

Browse files
author
BitsAdmin
committed
Merge branch 'flink-Java-2025-01-01-online-1089-2025_04_03_15_25_57' into 'integration_2025-04-10_853973186050'
feat: [development task] flink-1089-Java (1145188) See merge request iaasng/volcengine-java-sdk!430
2 parents c47b535 + 7483ec8 commit 2cf7b63

File tree

3 files changed

+430
-0
lines changed

3 files changed

+430
-0
lines changed

volcengine-java-sdk-flink20250101/src/main/java/com/volcengine/flink20250101/Flink20250101Api.java

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
import com.volcengine.flink20250101.model.GetApplicationInstanceResponse;
3434
import com.volcengine.flink20250101.model.ListApplicationInstanceRequest;
3535
import com.volcengine.flink20250101.model.ListApplicationInstanceResponse;
36+
import com.volcengine.flink20250101.model.RestartGWSApplicationRequest;
37+
import com.volcengine.flink20250101.model.RestartGWSApplicationResponse;
3638
import com.volcengine.flink20250101.model.StartApplicationInstanceRequest;
3739
import com.volcengine.flink20250101.model.StartApplicationInstanceResponse;
3840

@@ -433,6 +435,130 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don
433435
apiClient.executeAsync(call, localVarReturnType, callback);
434436
return call;
435437
}
438+
/**
439+
* Build call for restartGWSApplication
440+
* @param body (required)
441+
* @param progressListener Progress listener
442+
* @param progressRequestListener Progress request listener
443+
* @return Call to execute
444+
* @throws ApiException If fail to serialize the request body object
445+
*/
446+
public com.squareup.okhttp.Call restartGWSApplicationCall(RestartGWSApplicationRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
447+
Object localVarPostBody = body;
448+
449+
// create path and map variables
450+
String localVarPath = "/RestartGWSApplication/2025-01-01/flink/post/application_json/";
451+
452+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
453+
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
454+
455+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
456+
457+
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
458+
459+
final String[] localVarAccepts = {
460+
"application/json"
461+
};
462+
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
463+
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
464+
465+
final String[] localVarContentTypes = {
466+
"text/plain"
467+
};
468+
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
469+
localVarHeaderParams.put("Content-Type", localVarContentType);
470+
471+
if(progressListener != null) {
472+
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
473+
@Override
474+
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
475+
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
476+
return originalResponse.newBuilder()
477+
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
478+
.build();
479+
}
480+
});
481+
}
482+
483+
String[] localVarAuthNames = new String[] { "volcengineSign" };
484+
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
485+
}
486+
487+
@SuppressWarnings("rawtypes")
488+
private com.squareup.okhttp.Call restartGWSApplicationValidateBeforeCall(RestartGWSApplicationRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
489+
// verify the required parameter 'body' is set
490+
if (body == null) {
491+
throw new ApiException("Missing the required parameter 'body' when calling restartGWSApplication(Async)");
492+
}
493+
494+
com.squareup.okhttp.Call call = restartGWSApplicationCall(body, progressListener, progressRequestListener);
495+
return call;
496+
497+
498+
499+
500+
501+
}
502+
503+
/**
504+
*
505+
*
506+
* @param body (required)
507+
* @return RestartGWSApplicationResponse
508+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
509+
*/
510+
public RestartGWSApplicationResponse restartGWSApplication(RestartGWSApplicationRequest body) throws ApiException {
511+
ApiResponse<RestartGWSApplicationResponse> resp = restartGWSApplicationWithHttpInfo(body);
512+
return resp.getData();
513+
}
514+
515+
/**
516+
*
517+
*
518+
* @param body (required)
519+
* @return ApiResponse&lt;RestartGWSApplicationResponse&gt;
520+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
521+
*/
522+
public ApiResponse<RestartGWSApplicationResponse> restartGWSApplicationWithHttpInfo( @NotNull RestartGWSApplicationRequest body) throws ApiException {
523+
com.squareup.okhttp.Call call = restartGWSApplicationValidateBeforeCall(body, null, null);
524+
Type localVarReturnType = new TypeToken<RestartGWSApplicationResponse>(){}.getType();
525+
return apiClient.execute(call, localVarReturnType);
526+
}
527+
528+
/**
529+
* (asynchronously)
530+
*
531+
* @param body (required)
532+
* @param callback The callback to be executed when the API call finishes
533+
* @return The request call
534+
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
535+
*/
536+
public com.squareup.okhttp.Call restartGWSApplicationAsync(RestartGWSApplicationRequest body, final ApiCallback<RestartGWSApplicationResponse> callback) throws ApiException {
537+
538+
ProgressResponseBody.ProgressListener progressListener = null;
539+
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
540+
541+
if (callback != null) {
542+
progressListener = new ProgressResponseBody.ProgressListener() {
543+
@Override
544+
public void update(long bytesRead, long contentLength, boolean done) {
545+
callback.onDownloadProgress(bytesRead, contentLength, done);
546+
}
547+
};
548+
549+
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
550+
@Override
551+
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
552+
callback.onUploadProgress(bytesWritten, contentLength, done);
553+
}
554+
};
555+
}
556+
557+
com.squareup.okhttp.Call call = restartGWSApplicationValidateBeforeCall(body, progressListener, progressRequestListener);
558+
Type localVarReturnType = new TypeToken<RestartGWSApplicationResponse>(){}.getType();
559+
apiClient.executeAsync(call, localVarReturnType, callback);
560+
return call;
561+
}
436562
/**
437563
* Build call for startApplicationInstance
438564
* @param body (required)
Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
/*
2+
* flink20250101
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.flink20250101.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+
* RestartGWSApplicationRequest
28+
*/
29+
30+
31+
32+
public class RestartGWSApplicationRequest {
33+
@SerializedName("Id")
34+
private String id = null;
35+
36+
@SerializedName("SavepointId")
37+
private String savepointId = null;
38+
39+
/**
40+
* Gets or Sets type
41+
*/
42+
@JsonAdapter(TypeEnum.Adapter.class)
43+
public enum TypeEnum {
44+
@SerializedName("FROM_NEW")
45+
FROM_NEW("FROM_NEW"),
46+
@SerializedName("FROM_LATEST")
47+
FROM_LATEST("FROM_LATEST"),
48+
@SerializedName("FROM_SAVEPOINT")
49+
FROM_SAVEPOINT("FROM_SAVEPOINT");
50+
51+
private String value;
52+
53+
TypeEnum(String value) {
54+
this.value = value;
55+
}
56+
public String getValue() {
57+
return value;
58+
}
59+
60+
@Override
61+
public String toString() {
62+
return String.valueOf(value);
63+
}
64+
public static TypeEnum fromValue(String input) {
65+
for (TypeEnum b : TypeEnum.values()) {
66+
if (b.value.equals(input)) {
67+
return b;
68+
}
69+
}
70+
return null;
71+
}
72+
public static class Adapter extends TypeAdapter<TypeEnum> {
73+
@Override
74+
public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException {
75+
jsonWriter.value(String.valueOf(enumeration.getValue()));
76+
}
77+
78+
@Override
79+
public TypeEnum read(final JsonReader jsonReader) throws IOException {
80+
Object value = jsonReader.nextString();
81+
return TypeEnum.fromValue((String)(value));
82+
}
83+
}
84+
} @SerializedName("Type")
85+
private TypeEnum type = null;
86+
87+
public RestartGWSApplicationRequest id(String id) {
88+
this.id = id;
89+
return this;
90+
}
91+
92+
/**
93+
* Get id
94+
* @return id
95+
**/
96+
@NotNull
97+
@Schema(required = true, description = "")
98+
public String getId() {
99+
return id;
100+
}
101+
102+
public void setId(String id) {
103+
this.id = id;
104+
}
105+
106+
public RestartGWSApplicationRequest savepointId(String savepointId) {
107+
this.savepointId = savepointId;
108+
return this;
109+
}
110+
111+
/**
112+
* Get savepointId
113+
* @return savepointId
114+
**/
115+
@Schema(description = "")
116+
public String getSavepointId() {
117+
return savepointId;
118+
}
119+
120+
public void setSavepointId(String savepointId) {
121+
this.savepointId = savepointId;
122+
}
123+
124+
public RestartGWSApplicationRequest type(TypeEnum type) {
125+
this.type = type;
126+
return this;
127+
}
128+
129+
/**
130+
* Get type
131+
* @return type
132+
**/
133+
@NotNull
134+
@Schema(required = true, description = "")
135+
public TypeEnum getType() {
136+
return type;
137+
}
138+
139+
public void setType(TypeEnum type) {
140+
this.type = type;
141+
}
142+
143+
144+
@Override
145+
public boolean equals(java.lang.Object o) {
146+
if (this == o) {
147+
return true;
148+
}
149+
if (o == null || getClass() != o.getClass()) {
150+
return false;
151+
}
152+
RestartGWSApplicationRequest restartGWSApplicationRequest = (RestartGWSApplicationRequest) o;
153+
return Objects.equals(this.id, restartGWSApplicationRequest.id) &&
154+
Objects.equals(this.savepointId, restartGWSApplicationRequest.savepointId) &&
155+
Objects.equals(this.type, restartGWSApplicationRequest.type);
156+
}
157+
158+
@Override
159+
public int hashCode() {
160+
return Objects.hash(id, savepointId, type);
161+
}
162+
163+
164+
@Override
165+
public String toString() {
166+
StringBuilder sb = new StringBuilder();
167+
sb.append("class RestartGWSApplicationRequest {\n");
168+
169+
sb.append(" id: ").append(toIndentedString(id)).append("\n");
170+
sb.append(" savepointId: ").append(toIndentedString(savepointId)).append("\n");
171+
sb.append(" type: ").append(toIndentedString(type)).append("\n");
172+
sb.append("}");
173+
return sb.toString();
174+
}
175+
176+
/**
177+
* Convert the given object to string with each line indented by 4 spaces
178+
* (except the first line).
179+
*/
180+
private String toIndentedString(java.lang.Object o) {
181+
if (o == null) {
182+
return "null";
183+
}
184+
return o.toString().replace("\n", "\n ");
185+
}
186+
187+
}

0 commit comments

Comments
 (0)