All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.ec2.model.ModifyVpnTunnelOptionsRequest Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon EC2 module holds the client classes that are used for communicating with Amazon EC2 Service

The newest version!
/*
 * 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 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 getter(Function g) { return obj -> g.apply((ModifyVpnTunnelOptionsRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends Ec2Request.Builder, SdkPojo, CopyableBuilder { /** *

* The ID of the Amazon Web Services Site-to-Site VPN connection. *

* * @param vpnConnectionId * The ID of the Amazon Web Services Site-to-Site VPN connection. * @return Returns a reference to this object so that method calls can be chained together. */ Builder vpnConnectionId(String vpnConnectionId); /** *

* The external IP address of the VPN tunnel. *

* * @param vpnTunnelOutsideIpAddress * The external IP address of the VPN tunnel. * @return Returns a reference to this object so that method calls can be chained together. */ Builder vpnTunnelOutsideIpAddress(String vpnTunnelOutsideIpAddress); /** *

* The tunnel options to modify. *

* * @param tunnelOptions * The tunnel options to modify. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tunnelOptions(ModifyVpnTunnelOptionsSpecification tunnelOptions); /** *

* The tunnel options to modify. *

* This is a convenience method that creates an instance of the * {@link ModifyVpnTunnelOptionsSpecification.Builder} avoiding the need to create one manually via * {@link ModifyVpnTunnelOptionsSpecification#builder()}. * *

* When the {@link Consumer} completes, {@link ModifyVpnTunnelOptionsSpecification.Builder#build()} is called * immediately and its result is passed to {@link #tunnelOptions(ModifyVpnTunnelOptionsSpecification)}. * * @param tunnelOptions * a consumer that will call methods on {@link ModifyVpnTunnelOptionsSpecification.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #tunnelOptions(ModifyVpnTunnelOptionsSpecification) */ default Builder tunnelOptions(Consumer tunnelOptions) { return tunnelOptions(ModifyVpnTunnelOptionsSpecification.builder().applyMutation(tunnelOptions).build()); } /** *

* 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. *

* * @param dryRun * 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 Returns a reference to this object so that method calls can be chained together. */ Builder dryRun(Boolean dryRun); /** *

* Choose whether or not to trigger immediate tunnel replacement. This is only applicable when turning on or off * EnableTunnelLifecycleControl. *

*

* Valid values: True | False *

* * @param skipTunnelReplacement * Choose whether or not to trigger immediate tunnel replacement. This is only applicable when turning on * or off EnableTunnelLifecycleControl.

*

* Valid values: True | False * @return Returns a reference to this object so that method calls can be chained together. */ Builder skipTunnelReplacement(Boolean skipTunnelReplacement); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends Ec2Request.BuilderImpl implements Builder { private String vpnConnectionId; private String vpnTunnelOutsideIpAddress; private ModifyVpnTunnelOptionsSpecification tunnelOptions; private Boolean dryRun; private Boolean skipTunnelReplacement; private BuilderImpl() { } private BuilderImpl(ModifyVpnTunnelOptionsRequest model) { super(model); vpnConnectionId(model.vpnConnectionId); vpnTunnelOutsideIpAddress(model.vpnTunnelOutsideIpAddress); tunnelOptions(model.tunnelOptions); dryRun(model.dryRun); skipTunnelReplacement(model.skipTunnelReplacement); } public final String getVpnConnectionId() { return vpnConnectionId; } public final void setVpnConnectionId(String vpnConnectionId) { this.vpnConnectionId = vpnConnectionId; } @Override public final Builder vpnConnectionId(String vpnConnectionId) { this.vpnConnectionId = vpnConnectionId; return this; } public final String getVpnTunnelOutsideIpAddress() { return vpnTunnelOutsideIpAddress; } public final void setVpnTunnelOutsideIpAddress(String vpnTunnelOutsideIpAddress) { this.vpnTunnelOutsideIpAddress = vpnTunnelOutsideIpAddress; } @Override public final Builder vpnTunnelOutsideIpAddress(String vpnTunnelOutsideIpAddress) { this.vpnTunnelOutsideIpAddress = vpnTunnelOutsideIpAddress; return this; } public final ModifyVpnTunnelOptionsSpecification.Builder getTunnelOptions() { return tunnelOptions != null ? tunnelOptions.toBuilder() : null; } public final void setTunnelOptions(ModifyVpnTunnelOptionsSpecification.BuilderImpl tunnelOptions) { this.tunnelOptions = tunnelOptions != null ? tunnelOptions.build() : null; } @Override public final Builder tunnelOptions(ModifyVpnTunnelOptionsSpecification tunnelOptions) { this.tunnelOptions = tunnelOptions; return this; } public final Boolean getDryRun() { return dryRun; } public final void setDryRun(Boolean dryRun) { this.dryRun = dryRun; } @Override public final Builder dryRun(Boolean dryRun) { this.dryRun = dryRun; return this; } public final Boolean getSkipTunnelReplacement() { return skipTunnelReplacement; } public final void setSkipTunnelReplacement(Boolean skipTunnelReplacement) { this.skipTunnelReplacement = skipTunnelReplacement; } @Override public final Builder skipTunnelReplacement(Boolean skipTunnelReplacement) { this.skipTunnelReplacement = skipTunnelReplacement; return this; } @Override public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) { super.overrideConfiguration(overrideConfiguration); return this; } @Override public Builder overrideConfiguration(Consumer builderConsumer) { super.overrideConfiguration(builderConsumer); return this; } @Override public ModifyVpnTunnelOptionsRequest build() { return new ModifyVpnTunnelOptionsRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy