software.amazon.awssdk.services.ec2.model.ModifyVpnTunnelOptionsRequest Maven / Gradle / Ivy
Show all versions of ec2 Show documentation
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package software.amazon.awssdk.services.ec2.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class ModifyVpnTunnelOptionsRequest extends Ec2Request implements
ToCopyableBuilder {
private static final SdkField VPN_CONNECTION_ID_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("VpnConnectionId")
.getter(getter(ModifyVpnTunnelOptionsRequest::vpnConnectionId))
.setter(setter(Builder::vpnConnectionId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("VpnConnectionId")
.unmarshallLocationName("VpnConnectionId").build()).build();
private static final SdkField VPN_TUNNEL_OUTSIDE_IP_ADDRESS_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("VpnTunnelOutsideIpAddress")
.getter(getter(ModifyVpnTunnelOptionsRequest::vpnTunnelOutsideIpAddress))
.setter(setter(Builder::vpnTunnelOutsideIpAddress))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("VpnTunnelOutsideIpAddress")
.unmarshallLocationName("VpnTunnelOutsideIpAddress").build()).build();
private static final SdkField TUNNEL_OPTIONS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.memberName("TunnelOptions")
.getter(getter(ModifyVpnTunnelOptionsRequest::tunnelOptions))
.setter(setter(Builder::tunnelOptions))
.constructor(ModifyVpnTunnelOptionsSpecification::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TunnelOptions")
.unmarshallLocationName("TunnelOptions").build()).build();
private static final SdkField DRY_RUN_FIELD = SdkField
. builder(MarshallingType.BOOLEAN)
.memberName("DryRun")
.getter(getter(ModifyVpnTunnelOptionsRequest::dryRun))
.setter(setter(Builder::dryRun))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DryRun")
.unmarshallLocationName("DryRun").build()).build();
private static final SdkField SKIP_TUNNEL_REPLACEMENT_FIELD = SdkField
. builder(MarshallingType.BOOLEAN)
.memberName("SkipTunnelReplacement")
.getter(getter(ModifyVpnTunnelOptionsRequest::skipTunnelReplacement))
.setter(setter(Builder::skipTunnelReplacement))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SkipTunnelReplacement")
.unmarshallLocationName("SkipTunnelReplacement").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(VPN_CONNECTION_ID_FIELD,
VPN_TUNNEL_OUTSIDE_IP_ADDRESS_FIELD, TUNNEL_OPTIONS_FIELD, DRY_RUN_FIELD, SKIP_TUNNEL_REPLACEMENT_FIELD));
private static final Map> SDK_NAME_TO_FIELD = Collections
.unmodifiableMap(new HashMap>() {
{
put("VpnConnectionId", VPN_CONNECTION_ID_FIELD);
put("VpnTunnelOutsideIpAddress", VPN_TUNNEL_OUTSIDE_IP_ADDRESS_FIELD);
put("TunnelOptions", TUNNEL_OPTIONS_FIELD);
put("DryRun", DRY_RUN_FIELD);
put("SkipTunnelReplacement", SKIP_TUNNEL_REPLACEMENT_FIELD);
}
});
private final String vpnConnectionId;
private final String vpnTunnelOutsideIpAddress;
private final ModifyVpnTunnelOptionsSpecification tunnelOptions;
private final Boolean dryRun;
private final Boolean skipTunnelReplacement;
private ModifyVpnTunnelOptionsRequest(BuilderImpl builder) {
super(builder);
this.vpnConnectionId = builder.vpnConnectionId;
this.vpnTunnelOutsideIpAddress = builder.vpnTunnelOutsideIpAddress;
this.tunnelOptions = builder.tunnelOptions;
this.dryRun = builder.dryRun;
this.skipTunnelReplacement = builder.skipTunnelReplacement;
}
/**
*
* The ID of the Amazon Web Services Site-to-Site VPN connection.
*
*
* @return The ID of the Amazon Web Services Site-to-Site VPN connection.
*/
public final String vpnConnectionId() {
return vpnConnectionId;
}
/**
*
* The external IP address of the VPN tunnel.
*
*
* @return The external IP address of the VPN tunnel.
*/
public final String vpnTunnelOutsideIpAddress() {
return vpnTunnelOutsideIpAddress;
}
/**
*
* The tunnel options to modify.
*
*
* @return The tunnel options to modify.
*/
public final ModifyVpnTunnelOptionsSpecification tunnelOptions() {
return tunnelOptions;
}
/**
*
* Checks whether you have the required permissions for the action, without actually making the request, and
* provides an error response. If you have the required permissions, the error response is
* DryRunOperation
. Otherwise, it is UnauthorizedOperation
.
*
*
* @return Checks whether you have the required permissions for the action, without actually making the request, and
* provides an error response. If you have the required permissions, the error response is
* DryRunOperation
. Otherwise, it is UnauthorizedOperation
.
*/
public final Boolean dryRun() {
return dryRun;
}
/**
*
* Choose whether or not to trigger immediate tunnel replacement. This is only applicable when turning on or off
* EnableTunnelLifecycleControl
.
*
*
* Valid values: True
| False
*
*
* @return Choose whether or not to trigger immediate tunnel replacement. This is only applicable when turning on or
* off EnableTunnelLifecycleControl
.
*
* Valid values: True
| False
*/
public final Boolean skipTunnelReplacement() {
return skipTunnelReplacement;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(vpnConnectionId());
hashCode = 31 * hashCode + Objects.hashCode(vpnTunnelOutsideIpAddress());
hashCode = 31 * hashCode + Objects.hashCode(tunnelOptions());
hashCode = 31 * hashCode + Objects.hashCode(dryRun());
hashCode = 31 * hashCode + Objects.hashCode(skipTunnelReplacement());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof ModifyVpnTunnelOptionsRequest)) {
return false;
}
ModifyVpnTunnelOptionsRequest other = (ModifyVpnTunnelOptionsRequest) obj;
return Objects.equals(vpnConnectionId(), other.vpnConnectionId())
&& Objects.equals(vpnTunnelOutsideIpAddress(), other.vpnTunnelOutsideIpAddress())
&& Objects.equals(tunnelOptions(), other.tunnelOptions()) && Objects.equals(dryRun(), other.dryRun())
&& Objects.equals(skipTunnelReplacement(), other.skipTunnelReplacement());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("ModifyVpnTunnelOptionsRequest").add("VpnConnectionId", vpnConnectionId())
.add("VpnTunnelOutsideIpAddress", vpnTunnelOutsideIpAddress())
.add("TunnelOptions", tunnelOptions() == null ? null : "*** Sensitive Data Redacted ***").add("DryRun", dryRun())
.add("SkipTunnelReplacement", skipTunnelReplacement()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "VpnConnectionId":
return Optional.ofNullable(clazz.cast(vpnConnectionId()));
case "VpnTunnelOutsideIpAddress":
return Optional.ofNullable(clazz.cast(vpnTunnelOutsideIpAddress()));
case "TunnelOptions":
return Optional.ofNullable(clazz.cast(tunnelOptions()));
case "DryRun":
return Optional.ofNullable(clazz.cast(dryRun()));
case "SkipTunnelReplacement":
return Optional.ofNullable(clazz.cast(skipTunnelReplacement()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
@Override
public final Map> sdkFieldNameToField() {
return SDK_NAME_TO_FIELD;
}
private static Function