Skip to content

Commit eb7fa30

Browse files
author
BitsAdmin
committed
Merge 'redis-Java-2020-12-07-online-1969-2025_12_22_20_42_23' into 'integration_2025-12-25_1097408644354'
feat: [development task] Redis-1969-Java (1971860) See merge request: !815
2 parents 19e0c6d + 96eba4e commit eb7fa30

File tree

6 files changed

+356
-29
lines changed

6 files changed

+356
-29
lines changed

volcengine-java-sdk-redis/src/main/java/com/volcengine/redis/RedisApi.java

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@
139139
import com.volcengine.redis.model.FlushDBInstanceResponse;
140140
import com.volcengine.redis.model.IncreaseDBInstanceNodeNumberRequest;
141141
import com.volcengine.redis.model.IncreaseDBInstanceNodeNumberResponse;
142+
import com.volcengine.redis.model.InterruptKeyScanJobRequest;
143+
import com.volcengine.redis.model.InterruptKeyScanJobResponse;
142144
import com.volcengine.redis.model.ListDBAccountRequest;
143145
import com.volcengine.redis.model.ListDBAccountResponse;
144146
import com.volcengine.redis.model.ModifyAllowListRequest;
@@ -7177,6 +7179,130 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don
71777179
apiClient.executeAsync(call, localVarReturnType, callback);
71787180
return call;
71797181
}
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&lt;InterruptKeyScanJobResponse&gt;
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+
}
71807306
/**
71817307
* Build call for listDBAccount
71827308
* @param body (required)

volcengine-java-sdk-redis/src/main/java/com/volcengine/redis/model/InstanceForDescribeDBInstancesOutput.java

Lines changed: 68 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,52 @@
3434

3535

3636
public class InstanceForDescribeDBInstancesOutput {
37+
/**
38+
* Gets or Sets blueGreenRole
39+
*/
40+
@JsonAdapter(BlueGreenRoleEnum.Adapter.class)
41+
public enum BlueGreenRoleEnum {
42+
@SerializedName("Blue")
43+
BLUE("Blue"),
44+
@SerializedName("Green")
45+
GREEN("Green");
46+
47+
private String value;
48+
49+
BlueGreenRoleEnum(String value) {
50+
this.value = value;
51+
}
52+
public String getValue() {
53+
return value;
54+
}
55+
56+
@Override
57+
public String toString() {
58+
return String.valueOf(value);
59+
}
60+
public static BlueGreenRoleEnum fromValue(String input) {
61+
for (BlueGreenRoleEnum b : BlueGreenRoleEnum.values()) {
62+
if (b.value.equals(input)) {
63+
return b;
64+
}
65+
}
66+
return null;
67+
}
68+
public static class Adapter extends TypeAdapter<BlueGreenRoleEnum> {
69+
@Override
70+
public void write(final JsonWriter jsonWriter, final BlueGreenRoleEnum enumeration) throws IOException {
71+
jsonWriter.value(String.valueOf(enumeration.getValue()));
72+
}
73+
74+
@Override
75+
public BlueGreenRoleEnum read(final JsonReader jsonReader) throws IOException {
76+
Object value = jsonReader.nextString();
77+
return BlueGreenRoleEnum.fromValue((String)(value));
78+
}
79+
}
80+
} @SerializedName("BlueGreenRole")
81+
private BlueGreenRoleEnum blueGreenRole = null;
82+
3783
@SerializedName("Capacity")
3884
private CapacityForDescribeDBInstancesOutput capacity = null;
3985

@@ -112,6 +158,24 @@ public class InstanceForDescribeDBInstancesOutput {
112158
@SerializedName("ZoneIds")
113159
private List<String> zoneIds = null;
114160

161+
public InstanceForDescribeDBInstancesOutput blueGreenRole(BlueGreenRoleEnum blueGreenRole) {
162+
this.blueGreenRole = blueGreenRole;
163+
return this;
164+
}
165+
166+
/**
167+
* Get blueGreenRole
168+
* @return blueGreenRole
169+
**/
170+
@Schema(description = "")
171+
public BlueGreenRoleEnum getBlueGreenRole() {
172+
return blueGreenRole;
173+
}
174+
175+
public void setBlueGreenRole(BlueGreenRoleEnum blueGreenRole) {
176+
this.blueGreenRole = blueGreenRole;
177+
}
178+
115179
public InstanceForDescribeDBInstancesOutput capacity(CapacityForDescribeDBInstancesOutput capacity) {
116180
this.capacity = capacity;
117181
return this;
@@ -608,7 +672,8 @@ public boolean equals(java.lang.Object o) {
608672
return false;
609673
}
610674
InstanceForDescribeDBInstancesOutput instanceForDescribeDBInstancesOutput = (InstanceForDescribeDBInstancesOutput) o;
611-
return Objects.equals(this.capacity, instanceForDescribeDBInstancesOutput.capacity) &&
675+
return Objects.equals(this.blueGreenRole, instanceForDescribeDBInstancesOutput.blueGreenRole) &&
676+
Objects.equals(this.capacity, instanceForDescribeDBInstancesOutput.capacity) &&
612677
Objects.equals(this.chargeType, instanceForDescribeDBInstancesOutput.chargeType) &&
613678
Objects.equals(this.createTime, instanceForDescribeDBInstancesOutput.createTime) &&
614679
Objects.equals(this.dataLayout, instanceForDescribeDBInstancesOutput.dataLayout) &&
@@ -638,7 +703,7 @@ public boolean equals(java.lang.Object o) {
638703

639704
@Override
640705
public int hashCode() {
641-
return Objects.hash(capacity, chargeType, createTime, dataLayout, deletionProtection, engineVersion, expiredTime, instanceClass, instanceId, instanceName, multiAZ, nodeNumber, privateAddress, privatePort, projectName, regionId, serviceType, shardCapacity, shardNumber, shardedCluster, status, tags, VIP, viPv6, vpcId, zoneIds);
706+
return Objects.hash(blueGreenRole, capacity, chargeType, createTime, dataLayout, deletionProtection, engineVersion, expiredTime, instanceClass, instanceId, instanceName, multiAZ, nodeNumber, privateAddress, privatePort, projectName, regionId, serviceType, shardCapacity, shardNumber, shardedCluster, status, tags, VIP, viPv6, vpcId, zoneIds);
642707
}
643708

644709

@@ -647,6 +712,7 @@ public String toString() {
647712
StringBuilder sb = new StringBuilder();
648713
sb.append("class InstanceForDescribeDBInstancesOutput {\n");
649714

715+
sb.append(" blueGreenRole: ").append(toIndentedString(blueGreenRole)).append("\n");
650716
sb.append(" capacity: ").append(toIndentedString(capacity)).append("\n");
651717
sb.append(" chargeType: ").append(toIndentedString(chargeType)).append("\n");
652718
sb.append(" createTime: ").append(toIndentedString(createTime)).append("\n");
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
/*
2+
* redis
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.redis.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+
* InterruptKeyScanJobRequest
28+
*/
29+
30+
31+
32+
public class InterruptKeyScanJobRequest {
33+
@SerializedName("JobId")
34+
private String jobId = null;
35+
36+
public InterruptKeyScanJobRequest jobId(String jobId) {
37+
this.jobId = jobId;
38+
return this;
39+
}
40+
41+
/**
42+
* Get jobId
43+
* @return jobId
44+
**/
45+
@NotNull
46+
@Schema(required = true, description = "")
47+
public String getJobId() {
48+
return jobId;
49+
}
50+
51+
public void setJobId(String jobId) {
52+
this.jobId = jobId;
53+
}
54+
55+
56+
@Override
57+
public boolean equals(java.lang.Object o) {
58+
if (this == o) {
59+
return true;
60+
}
61+
if (o == null || getClass() != o.getClass()) {
62+
return false;
63+
}
64+
InterruptKeyScanJobRequest interruptKeyScanJobRequest = (InterruptKeyScanJobRequest) o;
65+
return Objects.equals(this.jobId, interruptKeyScanJobRequest.jobId);
66+
}
67+
68+
@Override
69+
public int hashCode() {
70+
return Objects.hash(jobId);
71+
}
72+
73+
74+
@Override
75+
public String toString() {
76+
StringBuilder sb = new StringBuilder();
77+
sb.append("class InterruptKeyScanJobRequest {\n");
78+
79+
sb.append(" jobId: ").append(toIndentedString(jobId)).append("\n");
80+
sb.append("}");
81+
return sb.toString();
82+
}
83+
84+
/**
85+
* Convert the given object to string with each line indented by 4 spaces
86+
* (except the first line).
87+
*/
88+
private String toIndentedString(java.lang.Object o) {
89+
if (o == null) {
90+
return "null";
91+
}
92+
return o.toString().replace("\n", "\n ");
93+
}
94+
95+
}

0 commit comments

Comments
 (0)