Skip to content

Commit 328ae14

Browse files
author
BitsAdmin
committed
Merge branch 'vpn-Java-2020-04-01-online-1282-2025_06_12_10_01_02' into 'integration_2025-06-19_956533420802'
feat: [development task] vpn-1282-Java (1359914) See merge request iaasng/volcengine-java-sdk!540
2 parents 527a5a9 + cc06ecb commit 328ae14

File tree

38 files changed

+3810
-32
lines changed

38 files changed

+3810
-32
lines changed

volcengine-java-sdk-vpn/src/main/java/com/volcengine/vpn/VpnApi.java

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@
8989
import com.volcengine.vpn.model.ModifyVpnConnectionAttributesResponse;
9090
import com.volcengine.vpn.model.ModifyVpnConnectionHealthCheckerRequest;
9191
import com.volcengine.vpn.model.ModifyVpnConnectionHealthCheckerResponse;
92+
import com.volcengine.vpn.model.ModifyVpnConnectionTunnelAttributesRequest;
93+
import com.volcengine.vpn.model.ModifyVpnConnectionTunnelAttributesResponse;
9294
import com.volcengine.vpn.model.ModifyVpnGatewayAttributesRequest;
9395
import com.volcengine.vpn.model.ModifyVpnGatewayAttributesResponse;
9496
import com.volcengine.vpn.model.RenewVpnGatewayRequest;
@@ -3967,6 +3969,130 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don
39673969
apiClient.executeAsync(call, localVarReturnType, callback);
39683970
return call;
39693971
}
3972+
/**
3973+
* Build call for modifyVpnConnectionTunnelAttributes
3974+
* @param body (required)
3975+
* @param progressListener Progress listener
3976+
* @param progressRequestListener Progress request listener
3977+
* @return Call to execute
3978+
* @throws ApiException If fail to serialize the request body object
3979+
*/
3980+
public com.squareup.okhttp.Call modifyVpnConnectionTunnelAttributesCall(ModifyVpnConnectionTunnelAttributesRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
3981+
Object localVarPostBody = body;
3982+
3983+
// create path and map variables
3984+
String localVarPath = "/ModifyVpnConnectionTunnelAttributes/2020-04-01/vpn/get/text_plain/";
3985+
3986+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
3987+
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
3988+
3989+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
3990+
3991+
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
3992+
3993+
final String[] localVarAccepts = {
3994+
"application/json"
3995+
};
3996+
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
3997+
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
3998+
3999+
final String[] localVarContentTypes = {
4000+
"text/plain"
4001+
};
4002+
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
4003+
localVarHeaderParams.put("Content-Type", localVarContentType);
4004+
4005+
if(progressListener != null) {
4006+
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
4007+
@Override
4008+
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
4009+
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
4010+
return originalResponse.newBuilder()
4011+
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
4012+
.build();
4013+
}
4014+
});
4015+
}
4016+
4017+
String[] localVarAuthNames = new String[] { "volcengineSign" };
4018+
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
4019+
}
4020+
4021+
@SuppressWarnings("rawtypes")
4022+
private com.squareup.okhttp.Call modifyVpnConnectionTunnelAttributesValidateBeforeCall(ModifyVpnConnectionTunnelAttributesRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
4023+
// verify the required parameter 'body' is set
4024+
if (body == null) {
4025+
throw new ApiException("Missing the required parameter 'body' when calling modifyVpnConnectionTunnelAttributes(Async)");
4026+
}
4027+
4028+
com.squareup.okhttp.Call call = modifyVpnConnectionTunnelAttributesCall(body, progressListener, progressRequestListener);
4029+
return call;
4030+
4031+
4032+
4033+
4034+
4035+
}
4036+
4037+
/**
4038+
*
4039+
*
4040+
* @param body (required)
4041+
* @return ModifyVpnConnectionTunnelAttributesResponse
4042+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
4043+
*/
4044+
public ModifyVpnConnectionTunnelAttributesResponse modifyVpnConnectionTunnelAttributes(ModifyVpnConnectionTunnelAttributesRequest body) throws ApiException {
4045+
ApiResponse<ModifyVpnConnectionTunnelAttributesResponse> resp = modifyVpnConnectionTunnelAttributesWithHttpInfo(body);
4046+
return resp.getData();
4047+
}
4048+
4049+
/**
4050+
*
4051+
*
4052+
* @param body (required)
4053+
* @return ApiResponse&lt;ModifyVpnConnectionTunnelAttributesResponse&gt;
4054+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
4055+
*/
4056+
public ApiResponse<ModifyVpnConnectionTunnelAttributesResponse> modifyVpnConnectionTunnelAttributesWithHttpInfo( @NotNull ModifyVpnConnectionTunnelAttributesRequest body) throws ApiException {
4057+
com.squareup.okhttp.Call call = modifyVpnConnectionTunnelAttributesValidateBeforeCall(body, null, null);
4058+
Type localVarReturnType = new TypeToken<ModifyVpnConnectionTunnelAttributesResponse>(){}.getType();
4059+
return apiClient.execute(call, localVarReturnType);
4060+
}
4061+
4062+
/**
4063+
* (asynchronously)
4064+
*
4065+
* @param body (required)
4066+
* @param callback The callback to be executed when the API call finishes
4067+
* @return The request call
4068+
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
4069+
*/
4070+
public com.squareup.okhttp.Call modifyVpnConnectionTunnelAttributesAsync(ModifyVpnConnectionTunnelAttributesRequest body, final ApiCallback<ModifyVpnConnectionTunnelAttributesResponse> callback) throws ApiException {
4071+
4072+
ProgressResponseBody.ProgressListener progressListener = null;
4073+
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
4074+
4075+
if (callback != null) {
4076+
progressListener = new ProgressResponseBody.ProgressListener() {
4077+
@Override
4078+
public void update(long bytesRead, long contentLength, boolean done) {
4079+
callback.onDownloadProgress(bytesRead, contentLength, done);
4080+
}
4081+
};
4082+
4083+
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
4084+
@Override
4085+
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
4086+
callback.onUploadProgress(bytesWritten, contentLength, done);
4087+
}
4088+
};
4089+
}
4090+
4091+
com.squareup.okhttp.Call call = modifyVpnConnectionTunnelAttributesValidateBeforeCall(body, progressListener, progressRequestListener);
4092+
Type localVarReturnType = new TypeToken<ModifyVpnConnectionTunnelAttributesResponse>(){}.getType();
4093+
apiClient.executeAsync(call, localVarReturnType, callback);
4094+
return call;
4095+
}
39704096
/**
39714097
* Build call for modifyVpnGatewayAttributes
39724098
* @param body (required)

volcengine-java-sdk-vpn/src/main/java/com/volcengine/vpn/model/BgpConfigForCreateVpnConnectionInput.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ public BgpConfigForCreateVpnConnectionInput enableBgp(Boolean enableBgp) {
4848
* Get enableBgp
4949
* @return enableBgp
5050
**/
51-
@NotNull
52-
@Schema(required = true, description = "")
51+
@Schema(description = "")
5352
public Boolean isEnableBgp() {
5453
return enableBgp;
5554
}

volcengine-java-sdk-vpn/src/main/java/com/volcengine/vpn/model/CreateVpnConnectionRequest.java

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import com.volcengine.vpn.model.BgpConfigForCreateVpnConnectionInput;
2323
import com.volcengine.vpn.model.IkeConfigForCreateVpnConnectionInput;
2424
import com.volcengine.vpn.model.IpsecConfigForCreateVpnConnectionInput;
25+
import com.volcengine.vpn.model.TunnelOptionForCreateVpnConnectionInput;
2526
import io.swagger.v3.oas.annotations.media.Schema;
2627
import java.io.IOException;
2728
import java.util.ArrayList;
@@ -80,6 +81,9 @@ public class CreateVpnConnectionRequest {
8081
@SerializedName("Spec")
8182
private String spec = null;
8283

84+
@SerializedName("TunnelOptions")
85+
private List<TunnelOptionForCreateVpnConnectionInput> tunnelOptions = null;
86+
8387
@SerializedName("VpnConnectionName")
8488
private String vpnConnectionName = null;
8589

@@ -150,8 +154,7 @@ public CreateVpnConnectionRequest customerGatewayId(String customerGatewayId) {
150154
* Get customerGatewayId
151155
* @return customerGatewayId
152156
**/
153-
@NotNull
154-
@Schema(required = true, description = "")
157+
@Schema(description = "")
155158
public String getCustomerGatewayId() {
156159
return customerGatewayId;
157160
}
@@ -376,6 +379,33 @@ public void setSpec(String spec) {
376379
this.spec = spec;
377380
}
378381

382+
public CreateVpnConnectionRequest tunnelOptions(List<TunnelOptionForCreateVpnConnectionInput> tunnelOptions) {
383+
this.tunnelOptions = tunnelOptions;
384+
return this;
385+
}
386+
387+
public CreateVpnConnectionRequest addTunnelOptionsItem(TunnelOptionForCreateVpnConnectionInput tunnelOptionsItem) {
388+
if (this.tunnelOptions == null) {
389+
this.tunnelOptions = new ArrayList<TunnelOptionForCreateVpnConnectionInput>();
390+
}
391+
this.tunnelOptions.add(tunnelOptionsItem);
392+
return this;
393+
}
394+
395+
/**
396+
* Get tunnelOptions
397+
* @return tunnelOptions
398+
**/
399+
@Valid
400+
@Schema(description = "")
401+
public List<TunnelOptionForCreateVpnConnectionInput> getTunnelOptions() {
402+
return tunnelOptions;
403+
}
404+
405+
public void setTunnelOptions(List<TunnelOptionForCreateVpnConnectionInput> tunnelOptions) {
406+
this.tunnelOptions = tunnelOptions;
407+
}
408+
379409
public CreateVpnConnectionRequest vpnConnectionName(String vpnConnectionName) {
380410
this.vpnConnectionName = vpnConnectionName;
381411
return this;
@@ -403,8 +433,7 @@ public CreateVpnConnectionRequest vpnGatewayId(String vpnGatewayId) {
403433
* Get vpnGatewayId
404434
* @return vpnGatewayId
405435
**/
406-
@NotNull
407-
@Schema(required = true, description = "")
436+
@Schema(description = "")
408437
public String getVpnGatewayId() {
409438
return vpnGatewayId;
410439
}
@@ -438,13 +467,14 @@ public boolean equals(java.lang.Object o) {
438467
Objects.equals(this.projectName, createVpnConnectionRequest.projectName) &&
439468
Objects.equals(this.remoteSubnet, createVpnConnectionRequest.remoteSubnet) &&
440469
Objects.equals(this.spec, createVpnConnectionRequest.spec) &&
470+
Objects.equals(this.tunnelOptions, createVpnConnectionRequest.tunnelOptions) &&
441471
Objects.equals(this.vpnConnectionName, createVpnConnectionRequest.vpnConnectionName) &&
442472
Objects.equals(this.vpnGatewayId, createVpnConnectionRequest.vpnGatewayId);
443473
}
444474

445475
@Override
446476
public int hashCode() {
447-
return Objects.hash(attachType, bgpConfig, clientToken, customerGatewayId, description, dpdAction, ikeConfig, ipsecConfig, localSubnet, logEnabled, natTraversal, negotiateInstantly, projectName, remoteSubnet, spec, vpnConnectionName, vpnGatewayId);
477+
return Objects.hash(attachType, bgpConfig, clientToken, customerGatewayId, description, dpdAction, ikeConfig, ipsecConfig, localSubnet, logEnabled, natTraversal, negotiateInstantly, projectName, remoteSubnet, spec, tunnelOptions, vpnConnectionName, vpnGatewayId);
448478
}
449479

450480

@@ -468,6 +498,7 @@ public String toString() {
468498
sb.append(" projectName: ").append(toIndentedString(projectName)).append("\n");
469499
sb.append(" remoteSubnet: ").append(toIndentedString(remoteSubnet)).append("\n");
470500
sb.append(" spec: ").append(toIndentedString(spec)).append("\n");
501+
sb.append(" tunnelOptions: ").append(toIndentedString(tunnelOptions)).append("\n");
471502
sb.append(" vpnConnectionName: ").append(toIndentedString(vpnConnectionName)).append("\n");
472503
sb.append(" vpnGatewayId: ").append(toIndentedString(vpnGatewayId)).append("\n");
473504
sb.append("}");

volcengine-java-sdk-vpn/src/main/java/com/volcengine/vpn/model/CreateVpnGatewayRequest.java

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ public class CreateVpnGatewayRequest {
4848
@SerializedName("Description")
4949
private String description = null;
5050

51+
@SerializedName("DualTunnelEnabled")
52+
private Boolean dualTunnelEnabled = null;
53+
5154
@SerializedName("IpsecEnabled")
5255
private Boolean ipsecEnabled = null;
5356

@@ -60,6 +63,9 @@ public class CreateVpnGatewayRequest {
6063
@SerializedName("ProjectName")
6164
private String projectName = null;
6265

66+
@SerializedName("SecondarySubnetId")
67+
private String secondarySubnetId = null;
68+
6369
@SerializedName("SslEnabled")
6470
private Boolean sslEnabled = null;
6571

@@ -169,6 +175,24 @@ public void setDescription(String description) {
169175
this.description = description;
170176
}
171177

178+
public CreateVpnGatewayRequest dualTunnelEnabled(Boolean dualTunnelEnabled) {
179+
this.dualTunnelEnabled = dualTunnelEnabled;
180+
return this;
181+
}
182+
183+
/**
184+
* Get dualTunnelEnabled
185+
* @return dualTunnelEnabled
186+
**/
187+
@Schema(description = "")
188+
public Boolean isDualTunnelEnabled() {
189+
return dualTunnelEnabled;
190+
}
191+
192+
public void setDualTunnelEnabled(Boolean dualTunnelEnabled) {
193+
this.dualTunnelEnabled = dualTunnelEnabled;
194+
}
195+
172196
public CreateVpnGatewayRequest ipsecEnabled(Boolean ipsecEnabled) {
173197
this.ipsecEnabled = ipsecEnabled;
174198
return this;
@@ -241,6 +265,24 @@ public void setProjectName(String projectName) {
241265
this.projectName = projectName;
242266
}
243267

268+
public CreateVpnGatewayRequest secondarySubnetId(String secondarySubnetId) {
269+
this.secondarySubnetId = secondarySubnetId;
270+
return this;
271+
}
272+
273+
/**
274+
* Get secondarySubnetId
275+
* @return secondarySubnetId
276+
**/
277+
@Schema(description = "")
278+
public String getSecondarySubnetId() {
279+
return secondarySubnetId;
280+
}
281+
282+
public void setSecondarySubnetId(String secondarySubnetId) {
283+
this.secondarySubnetId = secondarySubnetId;
284+
}
285+
244286
public CreateVpnGatewayRequest sslEnabled(Boolean sslEnabled) {
245287
this.sslEnabled = sslEnabled;
246288
return this;
@@ -375,10 +417,12 @@ public boolean equals(java.lang.Object o) {
375417
Objects.equals(this.billingType, createVpnGatewayRequest.billingType) &&
376418
Objects.equals(this.clientToken, createVpnGatewayRequest.clientToken) &&
377419
Objects.equals(this.description, createVpnGatewayRequest.description) &&
420+
Objects.equals(this.dualTunnelEnabled, createVpnGatewayRequest.dualTunnelEnabled) &&
378421
Objects.equals(this.ipsecEnabled, createVpnGatewayRequest.ipsecEnabled) &&
379422
Objects.equals(this.period, createVpnGatewayRequest.period) &&
380423
Objects.equals(this.periodUnit, createVpnGatewayRequest.periodUnit) &&
381424
Objects.equals(this.projectName, createVpnGatewayRequest.projectName) &&
425+
Objects.equals(this.secondarySubnetId, createVpnGatewayRequest.secondarySubnetId) &&
382426
Objects.equals(this.sslEnabled, createVpnGatewayRequest.sslEnabled) &&
383427
Objects.equals(this.sslMaxConnections, createVpnGatewayRequest.sslMaxConnections) &&
384428
Objects.equals(this.subnetId, createVpnGatewayRequest.subnetId) &&
@@ -389,7 +433,7 @@ public boolean equals(java.lang.Object o) {
389433

390434
@Override
391435
public int hashCode() {
392-
return Objects.hash(asn, bandwidth, billingType, clientToken, description, ipsecEnabled, period, periodUnit, projectName, sslEnabled, sslMaxConnections, subnetId, tags, vpcId, vpnGatewayName);
436+
return Objects.hash(asn, bandwidth, billingType, clientToken, description, dualTunnelEnabled, ipsecEnabled, period, periodUnit, projectName, secondarySubnetId, sslEnabled, sslMaxConnections, subnetId, tags, vpcId, vpnGatewayName);
393437
}
394438

395439

@@ -403,10 +447,12 @@ public String toString() {
403447
sb.append(" billingType: ").append(toIndentedString(billingType)).append("\n");
404448
sb.append(" clientToken: ").append(toIndentedString(clientToken)).append("\n");
405449
sb.append(" description: ").append(toIndentedString(description)).append("\n");
450+
sb.append(" dualTunnelEnabled: ").append(toIndentedString(dualTunnelEnabled)).append("\n");
406451
sb.append(" ipsecEnabled: ").append(toIndentedString(ipsecEnabled)).append("\n");
407452
sb.append(" period: ").append(toIndentedString(period)).append("\n");
408453
sb.append(" periodUnit: ").append(toIndentedString(periodUnit)).append("\n");
409454
sb.append(" projectName: ").append(toIndentedString(projectName)).append("\n");
455+
sb.append(" secondarySubnetId: ").append(toIndentedString(secondarySubnetId)).append("\n");
410456
sb.append(" sslEnabled: ").append(toIndentedString(sslEnabled)).append("\n");
411457
sb.append(" sslMaxConnections: ").append(toIndentedString(sslMaxConnections)).append("\n");
412458
sb.append(" subnetId: ").append(toIndentedString(subnetId)).append("\n");

0 commit comments

Comments
 (0)