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

software.amazon.awssdk.services.ec2.model.NatGateway 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.io.Serializable;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collection;
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 java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Describes a NAT gateway. *

*/ @Generated("software.amazon.awssdk:codegen") public final class NatGateway implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField CREATE_TIME_FIELD = SdkField . builder(MarshallingType.INSTANT) .memberName("CreateTime") .getter(getter(NatGateway::createTime)) .setter(setter(Builder::createTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreateTime") .unmarshallLocationName("createTime").build()).build(); private static final SdkField DELETE_TIME_FIELD = SdkField . builder(MarshallingType.INSTANT) .memberName("DeleteTime") .getter(getter(NatGateway::deleteTime)) .setter(setter(Builder::deleteTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DeleteTime") .unmarshallLocationName("deleteTime").build()).build(); private static final SdkField FAILURE_CODE_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("FailureCode") .getter(getter(NatGateway::failureCode)) .setter(setter(Builder::failureCode)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FailureCode") .unmarshallLocationName("failureCode").build()).build(); private static final SdkField FAILURE_MESSAGE_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("FailureMessage") .getter(getter(NatGateway::failureMessage)) .setter(setter(Builder::failureMessage)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FailureMessage") .unmarshallLocationName("failureMessage").build()).build(); private static final SdkField> NAT_GATEWAY_ADDRESSES_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("NatGatewayAddresses") .getter(getter(NatGateway::natGatewayAddresses)) .setter(setter(Builder::natGatewayAddresses)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NatGatewayAddressSet") .unmarshallLocationName("natGatewayAddressSet").build(), ListTrait .builder() .memberLocationName("item") .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(NatGatewayAddress::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("Item").unmarshallLocationName("item").build()).build()) .build()).build(); private static final SdkField NAT_GATEWAY_ID_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("NatGatewayId") .getter(getter(NatGateway::natGatewayId)) .setter(setter(Builder::natGatewayId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NatGatewayId") .unmarshallLocationName("natGatewayId").build()).build(); private static final SdkField PROVISIONED_BANDWIDTH_FIELD = SdkField . builder(MarshallingType.SDK_POJO) .memberName("ProvisionedBandwidth") .getter(getter(NatGateway::provisionedBandwidth)) .setter(setter(Builder::provisionedBandwidth)) .constructor(ProvisionedBandwidth::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ProvisionedBandwidth") .unmarshallLocationName("provisionedBandwidth").build()).build(); private static final SdkField STATE_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("State") .getter(getter(NatGateway::stateAsString)) .setter(setter(Builder::state)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("State") .unmarshallLocationName("state").build()).build(); private static final SdkField SUBNET_ID_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("SubnetId") .getter(getter(NatGateway::subnetId)) .setter(setter(Builder::subnetId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SubnetId") .unmarshallLocationName("subnetId").build()).build(); private static final SdkField VPC_ID_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("VpcId") .getter(getter(NatGateway::vpcId)) .setter(setter(Builder::vpcId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("VpcId") .unmarshallLocationName("vpcId").build()).build(); private static final SdkField> TAGS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("Tags") .getter(getter(NatGateway::tags)) .setter(setter(Builder::tags)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TagSet") .unmarshallLocationName("tagSet").build(), ListTrait .builder() .memberLocationName("item") .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(Tag::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("Item").unmarshallLocationName("item").build()).build()) .build()).build(); private static final SdkField CONNECTIVITY_TYPE_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("ConnectivityType") .getter(getter(NatGateway::connectivityTypeAsString)) .setter(setter(Builder::connectivityType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ConnectivityType") .unmarshallLocationName("connectivityType").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CREATE_TIME_FIELD, DELETE_TIME_FIELD, FAILURE_CODE_FIELD, FAILURE_MESSAGE_FIELD, NAT_GATEWAY_ADDRESSES_FIELD, NAT_GATEWAY_ID_FIELD, PROVISIONED_BANDWIDTH_FIELD, STATE_FIELD, SUBNET_ID_FIELD, VPC_ID_FIELD, TAGS_FIELD, CONNECTIVITY_TYPE_FIELD)); private static final Map> SDK_NAME_TO_FIELD = Collections .unmodifiableMap(new HashMap>() { { put("CreateTime", CREATE_TIME_FIELD); put("DeleteTime", DELETE_TIME_FIELD); put("FailureCode", FAILURE_CODE_FIELD); put("FailureMessage", FAILURE_MESSAGE_FIELD); put("NatGatewayAddressSet", NAT_GATEWAY_ADDRESSES_FIELD); put("NatGatewayId", NAT_GATEWAY_ID_FIELD); put("ProvisionedBandwidth", PROVISIONED_BANDWIDTH_FIELD); put("State", STATE_FIELD); put("SubnetId", SUBNET_ID_FIELD); put("VpcId", VPC_ID_FIELD); put("TagSet", TAGS_FIELD); put("ConnectivityType", CONNECTIVITY_TYPE_FIELD); } }); private static final long serialVersionUID = 1L; private final Instant createTime; private final Instant deleteTime; private final String failureCode; private final String failureMessage; private final List natGatewayAddresses; private final String natGatewayId; private final ProvisionedBandwidth provisionedBandwidth; private final String state; private final String subnetId; private final String vpcId; private final List tags; private final String connectivityType; private NatGateway(BuilderImpl builder) { this.createTime = builder.createTime; this.deleteTime = builder.deleteTime; this.failureCode = builder.failureCode; this.failureMessage = builder.failureMessage; this.natGatewayAddresses = builder.natGatewayAddresses; this.natGatewayId = builder.natGatewayId; this.provisionedBandwidth = builder.provisionedBandwidth; this.state = builder.state; this.subnetId = builder.subnetId; this.vpcId = builder.vpcId; this.tags = builder.tags; this.connectivityType = builder.connectivityType; } /** *

* The date and time the NAT gateway was created. *

* * @return The date and time the NAT gateway was created. */ public final Instant createTime() { return createTime; } /** *

* The date and time the NAT gateway was deleted, if applicable. *

* * @return The date and time the NAT gateway was deleted, if applicable. */ public final Instant deleteTime() { return deleteTime; } /** *

* If the NAT gateway could not be created, specifies the error code for the failure. ( * InsufficientFreeAddressesInSubnet | Gateway.NotAttached | * InvalidAllocationID.NotFound | Resource.AlreadyAssociated | InternalError * | InvalidSubnetID.NotFound) *

* * @return If the NAT gateway could not be created, specifies the error code for the failure. ( * InsufficientFreeAddressesInSubnet | Gateway.NotAttached | * InvalidAllocationID.NotFound | Resource.AlreadyAssociated | * InternalError | InvalidSubnetID.NotFound) */ public final String failureCode() { return failureCode; } /** *

* If the NAT gateway could not be created, specifies the error message for the failure, that corresponds to the * error code. *

*
    *
  • *

    * For InsufficientFreeAddressesInSubnet: "Subnet has insufficient free addresses to create this NAT gateway" *

    *
  • *
  • *

    * For Gateway.NotAttached: "Network vpc-xxxxxxxx has no Internet gateway attached" *

    *
  • *
  • *

    * For InvalidAllocationID.NotFound: * "Elastic IP address eipalloc-xxxxxxxx could not be associated with this NAT gateway" *

    *
  • *
  • *

    * For Resource.AlreadyAssociated: "Elastic IP address eipalloc-xxxxxxxx is already associated" *

    *
  • *
  • *

    * For InternalError: * "Network interface eni-xxxxxxxx, created and used internally by this NAT gateway is in an invalid state. Please try again." *

    *
  • *
  • *

    * For InvalidSubnetID.NotFound: "The specified subnet subnet-xxxxxxxx does not exist or could not be found." *

    *
  • *
* * @return If the NAT gateway could not be created, specifies the error message for the failure, that corresponds to * the error code.

*
    *
  • *

    * For InsufficientFreeAddressesInSubnet: * "Subnet has insufficient free addresses to create this NAT gateway" *

    *
  • *
  • *

    * For Gateway.NotAttached: "Network vpc-xxxxxxxx has no Internet gateway attached" *

    *
  • *
  • *

    * For InvalidAllocationID.NotFound: * "Elastic IP address eipalloc-xxxxxxxx could not be associated with this NAT gateway" *

    *
  • *
  • *

    * For Resource.AlreadyAssociated: "Elastic IP address eipalloc-xxxxxxxx is already associated" *

    *
  • *
  • *

    * For InternalError: * "Network interface eni-xxxxxxxx, created and used internally by this NAT gateway is in an invalid state. Please try again." *

    *
  • *
  • *

    * For InvalidSubnetID.NotFound: * "The specified subnet subnet-xxxxxxxx does not exist or could not be found." *

    *
  • */ public final String failureMessage() { return failureMessage; } /** * For responses, this returns true if the service returned a value for the NatGatewayAddresses property. This DOES * NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). * This is useful because the SDK will never return a null collection or map, but you may need to differentiate * between the service returning nothing (or null) and the service returning an empty collection or map. For * requests, this returns true if a value for the property was specified in the request builder, and false if a * value was not specified. */ public final boolean hasNatGatewayAddresses() { return natGatewayAddresses != null && !(natGatewayAddresses instanceof SdkAutoConstructList); } /** *

    * Information about the IP addresses and network interface associated with the NAT gateway. *

    *

    * Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

    *

    * This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasNatGatewayAddresses} method. *

    * * @return Information about the IP addresses and network interface associated with the NAT gateway. */ public final List natGatewayAddresses() { return natGatewayAddresses; } /** *

    * The ID of the NAT gateway. *

    * * @return The ID of the NAT gateway. */ public final String natGatewayId() { return natGatewayId; } /** *

    * Reserved. If you need to sustain traffic greater than the documented * limits, contact Amazon Web Services Support. *

    * * @return Reserved. If you need to sustain traffic greater than the documented limits, contact Amazon Web Services Support. */ public final ProvisionedBandwidth provisionedBandwidth() { return provisionedBandwidth; } /** *

    * The state of the NAT gateway. *

    *
      *
    • *

      * pending: The NAT gateway is being created and is not ready to process traffic. *

      *
    • *
    • *

      * failed: The NAT gateway could not be created. Check the failureCode and * failureMessage fields for the reason. *

      *
    • *
    • *

      * available: The NAT gateway is able to process traffic. This status remains until you delete the NAT * gateway, and does not indicate the health of the NAT gateway. *

      *
    • *
    • *

      * deleting: The NAT gateway is in the process of being terminated and may still be processing traffic. *

      *
    • *
    • *

      * deleted: The NAT gateway has been terminated and is no longer processing traffic. *

      *
    • *
    *

    * If the service returns an enum value that is not available in the current SDK version, {@link #state} will return * {@link NatGatewayState#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #stateAsString}. *

    * * @return The state of the NAT gateway.

    *
      *
    • *

      * pending: The NAT gateway is being created and is not ready to process traffic. *

      *
    • *
    • *

      * failed: The NAT gateway could not be created. Check the failureCode and * failureMessage fields for the reason. *

      *
    • *
    • *

      * available: The NAT gateway is able to process traffic. This status remains until you delete * the NAT gateway, and does not indicate the health of the NAT gateway. *

      *
    • *
    • *

      * deleting: The NAT gateway is in the process of being terminated and may still be processing * traffic. *

      *
    • *
    • *

      * deleted: The NAT gateway has been terminated and is no longer processing traffic. *

      *
    • * @see NatGatewayState */ public final NatGatewayState state() { return NatGatewayState.fromValue(state); } /** *

      * The state of the NAT gateway. *

      *
        *
      • *

        * pending: The NAT gateway is being created and is not ready to process traffic. *

        *
      • *
      • *

        * failed: The NAT gateway could not be created. Check the failureCode and * failureMessage fields for the reason. *

        *
      • *
      • *

        * available: The NAT gateway is able to process traffic. This status remains until you delete the NAT * gateway, and does not indicate the health of the NAT gateway. *

        *
      • *
      • *

        * deleting: The NAT gateway is in the process of being terminated and may still be processing traffic. *

        *
      • *
      • *

        * deleted: The NAT gateway has been terminated and is no longer processing traffic. *

        *
      • *
      *

      * If the service returns an enum value that is not available in the current SDK version, {@link #state} will return * {@link NatGatewayState#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #stateAsString}. *

      * * @return The state of the NAT gateway.

      *
        *
      • *

        * pending: The NAT gateway is being created and is not ready to process traffic. *

        *
      • *
      • *

        * failed: The NAT gateway could not be created. Check the failureCode and * failureMessage fields for the reason. *

        *
      • *
      • *

        * available: The NAT gateway is able to process traffic. This status remains until you delete * the NAT gateway, and does not indicate the health of the NAT gateway. *

        *
      • *
      • *

        * deleting: The NAT gateway is in the process of being terminated and may still be processing * traffic. *

        *
      • *
      • *

        * deleted: The NAT gateway has been terminated and is no longer processing traffic. *

        *
      • * @see NatGatewayState */ public final String stateAsString() { return state; } /** *

        * The ID of the subnet in which the NAT gateway is located. *

        * * @return The ID of the subnet in which the NAT gateway is located. */ public final String subnetId() { return subnetId; } /** *

        * The ID of the VPC in which the NAT gateway is located. *

        * * @return The ID of the VPC in which the NAT gateway is located. */ public final String vpcId() { return vpcId; } /** * For responses, this returns true if the service returned a value for the Tags property. This DOES NOT check that * the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is useful * because the SDK will never return a null collection or map, but you may need to differentiate between the service * returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true * if a value for the property was specified in the request builder, and false if a value was not specified. */ public final boolean hasTags() { return tags != null && !(tags instanceof SdkAutoConstructList); } /** *

        * The tags for the NAT gateway. *

        *

        * Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

        *

        * This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasTags} method. *

        * * @return The tags for the NAT gateway. */ public final List tags() { return tags; } /** *

        * Indicates whether the NAT gateway supports public or private connectivity. *

        *

        * If the service returns an enum value that is not available in the current SDK version, {@link #connectivityType} * will return {@link ConnectivityType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #connectivityTypeAsString}. *

        * * @return Indicates whether the NAT gateway supports public or private connectivity. * @see ConnectivityType */ public final ConnectivityType connectivityType() { return ConnectivityType.fromValue(connectivityType); } /** *

        * Indicates whether the NAT gateway supports public or private connectivity. *

        *

        * If the service returns an enum value that is not available in the current SDK version, {@link #connectivityType} * will return {@link ConnectivityType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #connectivityTypeAsString}. *

        * * @return Indicates whether the NAT gateway supports public or private connectivity. * @see ConnectivityType */ public final String connectivityTypeAsString() { return connectivityType; } @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 + Objects.hashCode(createTime()); hashCode = 31 * hashCode + Objects.hashCode(deleteTime()); hashCode = 31 * hashCode + Objects.hashCode(failureCode()); hashCode = 31 * hashCode + Objects.hashCode(failureMessage()); hashCode = 31 * hashCode + Objects.hashCode(hasNatGatewayAddresses() ? natGatewayAddresses() : null); hashCode = 31 * hashCode + Objects.hashCode(natGatewayId()); hashCode = 31 * hashCode + Objects.hashCode(provisionedBandwidth()); hashCode = 31 * hashCode + Objects.hashCode(stateAsString()); hashCode = 31 * hashCode + Objects.hashCode(subnetId()); hashCode = 31 * hashCode + Objects.hashCode(vpcId()); hashCode = 31 * hashCode + Objects.hashCode(hasTags() ? tags() : null); hashCode = 31 * hashCode + Objects.hashCode(connectivityTypeAsString()); return hashCode; } @Override public final boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof NatGateway)) { return false; } NatGateway other = (NatGateway) obj; return Objects.equals(createTime(), other.createTime()) && Objects.equals(deleteTime(), other.deleteTime()) && Objects.equals(failureCode(), other.failureCode()) && Objects.equals(failureMessage(), other.failureMessage()) && hasNatGatewayAddresses() == other.hasNatGatewayAddresses() && Objects.equals(natGatewayAddresses(), other.natGatewayAddresses()) && Objects.equals(natGatewayId(), other.natGatewayId()) && Objects.equals(provisionedBandwidth(), other.provisionedBandwidth()) && Objects.equals(stateAsString(), other.stateAsString()) && Objects.equals(subnetId(), other.subnetId()) && Objects.equals(vpcId(), other.vpcId()) && hasTags() == other.hasTags() && Objects.equals(tags(), other.tags()) && Objects.equals(connectivityTypeAsString(), other.connectivityTypeAsString()); } /** * 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("NatGateway").add("CreateTime", createTime()).add("DeleteTime", deleteTime()) .add("FailureCode", failureCode()).add("FailureMessage", failureMessage()) .add("NatGatewayAddresses", hasNatGatewayAddresses() ? natGatewayAddresses() : null) .add("NatGatewayId", natGatewayId()).add("ProvisionedBandwidth", provisionedBandwidth()) .add("State", stateAsString()).add("SubnetId", subnetId()).add("VpcId", vpcId()) .add("Tags", hasTags() ? tags() : null).add("ConnectivityType", connectivityTypeAsString()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "CreateTime": return Optional.ofNullable(clazz.cast(createTime())); case "DeleteTime": return Optional.ofNullable(clazz.cast(deleteTime())); case "FailureCode": return Optional.ofNullable(clazz.cast(failureCode())); case "FailureMessage": return Optional.ofNullable(clazz.cast(failureMessage())); case "NatGatewayAddresses": return Optional.ofNullable(clazz.cast(natGatewayAddresses())); case "NatGatewayId": return Optional.ofNullable(clazz.cast(natGatewayId())); case "ProvisionedBandwidth": return Optional.ofNullable(clazz.cast(provisionedBandwidth())); case "State": return Optional.ofNullable(clazz.cast(stateAsString())); case "SubnetId": return Optional.ofNullable(clazz.cast(subnetId())); case "VpcId": return Optional.ofNullable(clazz.cast(vpcId())); case "Tags": return Optional.ofNullable(clazz.cast(tags())); case "ConnectivityType": return Optional.ofNullable(clazz.cast(connectivityTypeAsString())); 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((NatGateway) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

        * The date and time the NAT gateway was created. *

        * * @param createTime * The date and time the NAT gateway was created. * @return Returns a reference to this object so that method calls can be chained together. */ Builder createTime(Instant createTime); /** *

        * The date and time the NAT gateway was deleted, if applicable. *

        * * @param deleteTime * The date and time the NAT gateway was deleted, if applicable. * @return Returns a reference to this object so that method calls can be chained together. */ Builder deleteTime(Instant deleteTime); /** *

        * If the NAT gateway could not be created, specifies the error code for the failure. ( * InsufficientFreeAddressesInSubnet | Gateway.NotAttached | * InvalidAllocationID.NotFound | Resource.AlreadyAssociated | * InternalError | InvalidSubnetID.NotFound) *

        * * @param failureCode * If the NAT gateway could not be created, specifies the error code for the failure. ( * InsufficientFreeAddressesInSubnet | Gateway.NotAttached | * InvalidAllocationID.NotFound | Resource.AlreadyAssociated | * InternalError | InvalidSubnetID.NotFound) * @return Returns a reference to this object so that method calls can be chained together. */ Builder failureCode(String failureCode); /** *

        * If the NAT gateway could not be created, specifies the error message for the failure, that corresponds to the * error code. *

        *
          *
        • *

          * For InsufficientFreeAddressesInSubnet: "Subnet has insufficient free addresses to create this NAT gateway" *

          *
        • *
        • *

          * For Gateway.NotAttached: "Network vpc-xxxxxxxx has no Internet gateway attached" *

          *
        • *
        • *

          * For InvalidAllocationID.NotFound: * "Elastic IP address eipalloc-xxxxxxxx could not be associated with this NAT gateway" *

          *
        • *
        • *

          * For Resource.AlreadyAssociated: "Elastic IP address eipalloc-xxxxxxxx is already associated" *

          *
        • *
        • *

          * For InternalError: * "Network interface eni-xxxxxxxx, created and used internally by this NAT gateway is in an invalid state. Please try again." *

          *
        • *
        • *

          * For InvalidSubnetID.NotFound: "The specified subnet subnet-xxxxxxxx does not exist or could not be found." *

          *
        • *
        * * @param failureMessage * If the NAT gateway could not be created, specifies the error message for the failure, that corresponds * to the error code.

        *
          *
        • *

          * For InsufficientFreeAddressesInSubnet: * "Subnet has insufficient free addresses to create this NAT gateway" *

          *
        • *
        • *

          * For Gateway.NotAttached: "Network vpc-xxxxxxxx has no Internet gateway attached" *

          *
        • *
        • *

          * For InvalidAllocationID.NotFound: * "Elastic IP address eipalloc-xxxxxxxx could not be associated with this NAT gateway" *

          *
        • *
        • *

          * For Resource.AlreadyAssociated: "Elastic IP address eipalloc-xxxxxxxx is already associated" *

          *
        • *
        • *

          * For InternalError: * "Network interface eni-xxxxxxxx, created and used internally by this NAT gateway is in an invalid state. Please try again." *

          *
        • *
        • *

          * For InvalidSubnetID.NotFound: * "The specified subnet subnet-xxxxxxxx does not exist or could not be found." *

          *
        • * @return Returns a reference to this object so that method calls can be chained together. */ Builder failureMessage(String failureMessage); /** *

          * Information about the IP addresses and network interface associated with the NAT gateway. *

          * * @param natGatewayAddresses * Information about the IP addresses and network interface associated with the NAT gateway. * @return Returns a reference to this object so that method calls can be chained together. */ Builder natGatewayAddresses(Collection natGatewayAddresses); /** *

          * Information about the IP addresses and network interface associated with the NAT gateway. *

          * * @param natGatewayAddresses * Information about the IP addresses and network interface associated with the NAT gateway. * @return Returns a reference to this object so that method calls can be chained together. */ Builder natGatewayAddresses(NatGatewayAddress... natGatewayAddresses); /** *

          * Information about the IP addresses and network interface associated with the NAT gateway. *

          * This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.ec2.model.NatGatewayAddress.Builder} avoiding the need to create one * manually via {@link software.amazon.awssdk.services.ec2.model.NatGatewayAddress#builder()}. * *

          * When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.ec2.model.NatGatewayAddress.Builder#build()} is called immediately and * its result is passed to {@link #natGatewayAddresses(List)}. * * @param natGatewayAddresses * a consumer that will call methods on * {@link software.amazon.awssdk.services.ec2.model.NatGatewayAddress.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #natGatewayAddresses(java.util.Collection) */ Builder natGatewayAddresses(Consumer... natGatewayAddresses); /** *

          * The ID of the NAT gateway. *

          * * @param natGatewayId * The ID of the NAT gateway. * @return Returns a reference to this object so that method calls can be chained together. */ Builder natGatewayId(String natGatewayId); /** *

          * Reserved. If you need to sustain traffic greater than the documented * limits, contact Amazon Web Services Support. *

          * * @param provisionedBandwidth * Reserved. If you need to sustain traffic greater than the documented limits, contact Amazon Web Services Support. * @return Returns a reference to this object so that method calls can be chained together. */ Builder provisionedBandwidth(ProvisionedBandwidth provisionedBandwidth); /** *

          * Reserved. If you need to sustain traffic greater than the documented * limits, contact Amazon Web Services Support. *

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

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

          * The state of the NAT gateway. *

          *
            *
          • *

            * pending: The NAT gateway is being created and is not ready to process traffic. *

            *
          • *
          • *

            * failed: The NAT gateway could not be created. Check the failureCode and * failureMessage fields for the reason. *

            *
          • *
          • *

            * available: The NAT gateway is able to process traffic. This status remains until you delete the * NAT gateway, and does not indicate the health of the NAT gateway. *

            *
          • *
          • *

            * deleting: The NAT gateway is in the process of being terminated and may still be processing * traffic. *

            *
          • *
          • *

            * deleted: The NAT gateway has been terminated and is no longer processing traffic. *

            *
          • *
          * * @param state * The state of the NAT gateway.

          *
            *
          • *

            * pending: The NAT gateway is being created and is not ready to process traffic. *

            *
          • *
          • *

            * failed: The NAT gateway could not be created. Check the failureCode and * failureMessage fields for the reason. *

            *
          • *
          • *

            * available: The NAT gateway is able to process traffic. This status remains until you * delete the NAT gateway, and does not indicate the health of the NAT gateway. *

            *
          • *
          • *

            * deleting: The NAT gateway is in the process of being terminated and may still be * processing traffic. *

            *
          • *
          • *

            * deleted: The NAT gateway has been terminated and is no longer processing traffic. *

            *
          • * @see NatGatewayState * @return Returns a reference to this object so that method calls can be chained together. * @see NatGatewayState */ Builder state(String state); /** *

            * The state of the NAT gateway. *

            *
              *
            • *

              * pending: The NAT gateway is being created and is not ready to process traffic. *

              *
            • *
            • *

              * failed: The NAT gateway could not be created. Check the failureCode and * failureMessage fields for the reason. *

              *
            • *
            • *

              * available: The NAT gateway is able to process traffic. This status remains until you delete the * NAT gateway, and does not indicate the health of the NAT gateway. *

              *
            • *
            • *

              * deleting: The NAT gateway is in the process of being terminated and may still be processing * traffic. *

              *
            • *
            • *

              * deleted: The NAT gateway has been terminated and is no longer processing traffic. *

              *
            • *
            * * @param state * The state of the NAT gateway.

            *
              *
            • *

              * pending: The NAT gateway is being created and is not ready to process traffic. *

              *
            • *
            • *

              * failed: The NAT gateway could not be created. Check the failureCode and * failureMessage fields for the reason. *

              *
            • *
            • *

              * available: The NAT gateway is able to process traffic. This status remains until you * delete the NAT gateway, and does not indicate the health of the NAT gateway. *

              *
            • *
            • *

              * deleting: The NAT gateway is in the process of being terminated and may still be * processing traffic. *

              *
            • *
            • *

              * deleted: The NAT gateway has been terminated and is no longer processing traffic. *

              *
            • * @see NatGatewayState * @return Returns a reference to this object so that method calls can be chained together. * @see NatGatewayState */ Builder state(NatGatewayState state); /** *

              * The ID of the subnet in which the NAT gateway is located. *

              * * @param subnetId * The ID of the subnet in which the NAT gateway is located. * @return Returns a reference to this object so that method calls can be chained together. */ Builder subnetId(String subnetId); /** *

              * The ID of the VPC in which the NAT gateway is located. *

              * * @param vpcId * The ID of the VPC in which the NAT gateway is located. * @return Returns a reference to this object so that method calls can be chained together. */ Builder vpcId(String vpcId); /** *

              * The tags for the NAT gateway. *

              * * @param tags * The tags for the NAT gateway. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tags(Collection tags); /** *

              * The tags for the NAT gateway. *

              * * @param tags * The tags for the NAT gateway. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tags(Tag... tags); /** *

              * The tags for the NAT gateway. *

              * This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.ec2.model.Tag.Builder} avoiding the need to create one manually via * {@link software.amazon.awssdk.services.ec2.model.Tag#builder()}. * *

              * When the {@link Consumer} completes, {@link software.amazon.awssdk.services.ec2.model.Tag.Builder#build()} is * called immediately and its result is passed to {@link #tags(List)}. * * @param tags * a consumer that will call methods on {@link software.amazon.awssdk.services.ec2.model.Tag.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #tags(java.util.Collection) */ Builder tags(Consumer... tags); /** *

              * Indicates whether the NAT gateway supports public or private connectivity. *

              * * @param connectivityType * Indicates whether the NAT gateway supports public or private connectivity. * @see ConnectivityType * @return Returns a reference to this object so that method calls can be chained together. * @see ConnectivityType */ Builder connectivityType(String connectivityType); /** *

              * Indicates whether the NAT gateway supports public or private connectivity. *

              * * @param connectivityType * Indicates whether the NAT gateway supports public or private connectivity. * @see ConnectivityType * @return Returns a reference to this object so that method calls can be chained together. * @see ConnectivityType */ Builder connectivityType(ConnectivityType connectivityType); } static final class BuilderImpl implements Builder { private Instant createTime; private Instant deleteTime; private String failureCode; private String failureMessage; private List natGatewayAddresses = DefaultSdkAutoConstructList.getInstance(); private String natGatewayId; private ProvisionedBandwidth provisionedBandwidth; private String state; private String subnetId; private String vpcId; private List tags = DefaultSdkAutoConstructList.getInstance(); private String connectivityType; private BuilderImpl() { } private BuilderImpl(NatGateway model) { createTime(model.createTime); deleteTime(model.deleteTime); failureCode(model.failureCode); failureMessage(model.failureMessage); natGatewayAddresses(model.natGatewayAddresses); natGatewayId(model.natGatewayId); provisionedBandwidth(model.provisionedBandwidth); state(model.state); subnetId(model.subnetId); vpcId(model.vpcId); tags(model.tags); connectivityType(model.connectivityType); } public final Instant getCreateTime() { return createTime; } public final void setCreateTime(Instant createTime) { this.createTime = createTime; } @Override public final Builder createTime(Instant createTime) { this.createTime = createTime; return this; } public final Instant getDeleteTime() { return deleteTime; } public final void setDeleteTime(Instant deleteTime) { this.deleteTime = deleteTime; } @Override public final Builder deleteTime(Instant deleteTime) { this.deleteTime = deleteTime; return this; } public final String getFailureCode() { return failureCode; } public final void setFailureCode(String failureCode) { this.failureCode = failureCode; } @Override public final Builder failureCode(String failureCode) { this.failureCode = failureCode; return this; } public final String getFailureMessage() { return failureMessage; } public final void setFailureMessage(String failureMessage) { this.failureMessage = failureMessage; } @Override public final Builder failureMessage(String failureMessage) { this.failureMessage = failureMessage; return this; } public final List getNatGatewayAddresses() { List result = NatGatewayAddressListCopier.copyToBuilder(this.natGatewayAddresses); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setNatGatewayAddresses(Collection natGatewayAddresses) { this.natGatewayAddresses = NatGatewayAddressListCopier.copyFromBuilder(natGatewayAddresses); } @Override public final Builder natGatewayAddresses(Collection natGatewayAddresses) { this.natGatewayAddresses = NatGatewayAddressListCopier.copy(natGatewayAddresses); return this; } @Override @SafeVarargs public final Builder natGatewayAddresses(NatGatewayAddress... natGatewayAddresses) { natGatewayAddresses(Arrays.asList(natGatewayAddresses)); return this; } @Override @SafeVarargs public final Builder natGatewayAddresses(Consumer... natGatewayAddresses) { natGatewayAddresses(Stream.of(natGatewayAddresses).map(c -> NatGatewayAddress.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final String getNatGatewayId() { return natGatewayId; } public final void setNatGatewayId(String natGatewayId) { this.natGatewayId = natGatewayId; } @Override public final Builder natGatewayId(String natGatewayId) { this.natGatewayId = natGatewayId; return this; } public final ProvisionedBandwidth.Builder getProvisionedBandwidth() { return provisionedBandwidth != null ? provisionedBandwidth.toBuilder() : null; } public final void setProvisionedBandwidth(ProvisionedBandwidth.BuilderImpl provisionedBandwidth) { this.provisionedBandwidth = provisionedBandwidth != null ? provisionedBandwidth.build() : null; } @Override public final Builder provisionedBandwidth(ProvisionedBandwidth provisionedBandwidth) { this.provisionedBandwidth = provisionedBandwidth; return this; } public final String getState() { return state; } public final void setState(String state) { this.state = state; } @Override public final Builder state(String state) { this.state = state; return this; } @Override public final Builder state(NatGatewayState state) { this.state(state == null ? null : state.toString()); return this; } public final String getSubnetId() { return subnetId; } public final void setSubnetId(String subnetId) { this.subnetId = subnetId; } @Override public final Builder subnetId(String subnetId) { this.subnetId = subnetId; return this; } public final String getVpcId() { return vpcId; } public final void setVpcId(String vpcId) { this.vpcId = vpcId; } @Override public final Builder vpcId(String vpcId) { this.vpcId = vpcId; return this; } public final List getTags() { List result = TagListCopier.copyToBuilder(this.tags); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setTags(Collection tags) { this.tags = TagListCopier.copyFromBuilder(tags); } @Override public final Builder tags(Collection tags) { this.tags = TagListCopier.copy(tags); return this; } @Override @SafeVarargs public final Builder tags(Tag... tags) { tags(Arrays.asList(tags)); return this; } @Override @SafeVarargs public final Builder tags(Consumer... tags) { tags(Stream.of(tags).map(c -> Tag.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } public final String getConnectivityType() { return connectivityType; } public final void setConnectivityType(String connectivityType) { this.connectivityType = connectivityType; } @Override public final Builder connectivityType(String connectivityType) { this.connectivityType = connectivityType; return this; } @Override public final Builder connectivityType(ConnectivityType connectivityType) { this.connectivityType(connectivityType == null ? null : connectivityType.toString()); return this; } @Override public NatGateway build() { return new NatGateway(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy