|
89 | 89 | import com.volcengine.vpn.model.ModifyVpnConnectionAttributesResponse; |
90 | 90 | import com.volcengine.vpn.model.ModifyVpnConnectionHealthCheckerRequest; |
91 | 91 | import com.volcengine.vpn.model.ModifyVpnConnectionHealthCheckerResponse; |
| 92 | +import com.volcengine.vpn.model.ModifyVpnConnectionTunnelAttributesRequest; |
| 93 | +import com.volcengine.vpn.model.ModifyVpnConnectionTunnelAttributesResponse; |
92 | 94 | import com.volcengine.vpn.model.ModifyVpnGatewayAttributesRequest; |
93 | 95 | import com.volcengine.vpn.model.ModifyVpnGatewayAttributesResponse; |
94 | 96 | import com.volcengine.vpn.model.RenewVpnGatewayRequest; |
@@ -3967,6 +3969,130 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don |
3967 | 3969 | apiClient.executeAsync(call, localVarReturnType, callback); |
3968 | 3970 | return call; |
3969 | 3971 | } |
| 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<ModifyVpnConnectionTunnelAttributesResponse> |
| 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 | + } |
3970 | 4096 | /** |
3971 | 4097 | * Build call for modifyVpnGatewayAttributes |
3972 | 4098 | * @param body (required) |
|
0 commit comments