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

software.amazon.awssdk.services.ec2.model.NatGatewayAddress 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.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.Function;
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.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Describes the IP addresses and network interface associated with a NAT gateway. *

*/ @Generated("software.amazon.awssdk:codegen") public final class NatGatewayAddress implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField ALLOCATION_ID_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("AllocationId") .getter(getter(NatGatewayAddress::allocationId)) .setter(setter(Builder::allocationId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AllocationId") .unmarshallLocationName("allocationId").build()).build(); private static final SdkField NETWORK_INTERFACE_ID_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("NetworkInterfaceId") .getter(getter(NatGatewayAddress::networkInterfaceId)) .setter(setter(Builder::networkInterfaceId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NetworkInterfaceId") .unmarshallLocationName("networkInterfaceId").build()).build(); private static final SdkField PRIVATE_IP_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("PrivateIp") .getter(getter(NatGatewayAddress::privateIp)) .setter(setter(Builder::privateIp)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PrivateIp") .unmarshallLocationName("privateIp").build()).build(); private static final SdkField PUBLIC_IP_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("PublicIp") .getter(getter(NatGatewayAddress::publicIp)) .setter(setter(Builder::publicIp)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PublicIp") .unmarshallLocationName("publicIp").build()).build(); private static final SdkField ASSOCIATION_ID_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("AssociationId") .getter(getter(NatGatewayAddress::associationId)) .setter(setter(Builder::associationId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AssociationId") .unmarshallLocationName("associationId").build()).build(); private static final SdkField IS_PRIMARY_FIELD = SdkField . builder(MarshallingType.BOOLEAN) .memberName("IsPrimary") .getter(getter(NatGatewayAddress::isPrimary)) .setter(setter(Builder::isPrimary)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IsPrimary") .unmarshallLocationName("isPrimary").build()).build(); private static final SdkField FAILURE_MESSAGE_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("FailureMessage") .getter(getter(NatGatewayAddress::failureMessage)) .setter(setter(Builder::failureMessage)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FailureMessage") .unmarshallLocationName("failureMessage").build()).build(); private static final SdkField STATUS_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("Status") .getter(getter(NatGatewayAddress::statusAsString)) .setter(setter(Builder::status)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Status") .unmarshallLocationName("status").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ALLOCATION_ID_FIELD, NETWORK_INTERFACE_ID_FIELD, PRIVATE_IP_FIELD, PUBLIC_IP_FIELD, ASSOCIATION_ID_FIELD, IS_PRIMARY_FIELD, FAILURE_MESSAGE_FIELD, STATUS_FIELD)); private static final Map> SDK_NAME_TO_FIELD = Collections .unmodifiableMap(new HashMap>() { { put("AllocationId", ALLOCATION_ID_FIELD); put("NetworkInterfaceId", NETWORK_INTERFACE_ID_FIELD); put("PrivateIp", PRIVATE_IP_FIELD); put("PublicIp", PUBLIC_IP_FIELD); put("AssociationId", ASSOCIATION_ID_FIELD); put("IsPrimary", IS_PRIMARY_FIELD); put("FailureMessage", FAILURE_MESSAGE_FIELD); put("Status", STATUS_FIELD); } }); private static final long serialVersionUID = 1L; private final String allocationId; private final String networkInterfaceId; private final String privateIp; private final String publicIp; private final String associationId; private final Boolean isPrimary; private final String failureMessage; private final String status; private NatGatewayAddress(BuilderImpl builder) { this.allocationId = builder.allocationId; this.networkInterfaceId = builder.networkInterfaceId; this.privateIp = builder.privateIp; this.publicIp = builder.publicIp; this.associationId = builder.associationId; this.isPrimary = builder.isPrimary; this.failureMessage = builder.failureMessage; this.status = builder.status; } /** *

* [Public NAT gateway only] The allocation ID of the Elastic IP address that's associated with the NAT gateway. *

* * @return [Public NAT gateway only] The allocation ID of the Elastic IP address that's associated with the NAT * gateway. */ public final String allocationId() { return allocationId; } /** *

* The ID of the network interface associated with the NAT gateway. *

* * @return The ID of the network interface associated with the NAT gateway. */ public final String networkInterfaceId() { return networkInterfaceId; } /** *

* The private IP address associated with the NAT gateway. *

* * @return The private IP address associated with the NAT gateway. */ public final String privateIp() { return privateIp; } /** *

* [Public NAT gateway only] The Elastic IP address associated with the NAT gateway. *

* * @return [Public NAT gateway only] The Elastic IP address associated with the NAT gateway. */ public final String publicIp() { return publicIp; } /** *

* [Public NAT gateway only] The association ID of the Elastic IP address that's associated with the NAT gateway. *

* * @return [Public NAT gateway only] The association ID of the Elastic IP address that's associated with the NAT * gateway. */ public final String associationId() { return associationId; } /** *

* Defines if the IP address is the primary address. *

* * @return Defines if the IP address is the primary address. */ public final Boolean isPrimary() { return isPrimary; } /** *

* The address failure message. *

* * @return The address failure message. */ public final String failureMessage() { return failureMessage; } /** *

* The address status. *

*

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

* * @return The address status. * @see NatGatewayAddressStatus */ public final NatGatewayAddressStatus status() { return NatGatewayAddressStatus.fromValue(status); } /** *

* The address status. *

*

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

* * @return The address status. * @see NatGatewayAddressStatus */ public final String statusAsString() { return status; } @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(allocationId()); hashCode = 31 * hashCode + Objects.hashCode(networkInterfaceId()); hashCode = 31 * hashCode + Objects.hashCode(privateIp()); hashCode = 31 * hashCode + Objects.hashCode(publicIp()); hashCode = 31 * hashCode + Objects.hashCode(associationId()); hashCode = 31 * hashCode + Objects.hashCode(isPrimary()); hashCode = 31 * hashCode + Objects.hashCode(failureMessage()); hashCode = 31 * hashCode + Objects.hashCode(statusAsString()); 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 NatGatewayAddress)) { return false; } NatGatewayAddress other = (NatGatewayAddress) obj; return Objects.equals(allocationId(), other.allocationId()) && Objects.equals(networkInterfaceId(), other.networkInterfaceId()) && Objects.equals(privateIp(), other.privateIp()) && Objects.equals(publicIp(), other.publicIp()) && Objects.equals(associationId(), other.associationId()) && Objects.equals(isPrimary(), other.isPrimary()) && Objects.equals(failureMessage(), other.failureMessage()) && Objects.equals(statusAsString(), other.statusAsString()); } /** * 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("NatGatewayAddress").add("AllocationId", allocationId()) .add("NetworkInterfaceId", networkInterfaceId()).add("PrivateIp", privateIp()).add("PublicIp", publicIp()) .add("AssociationId", associationId()).add("IsPrimary", isPrimary()).add("FailureMessage", failureMessage()) .add("Status", statusAsString()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "AllocationId": return Optional.ofNullable(clazz.cast(allocationId())); case "NetworkInterfaceId": return Optional.ofNullable(clazz.cast(networkInterfaceId())); case "PrivateIp": return Optional.ofNullable(clazz.cast(privateIp())); case "PublicIp": return Optional.ofNullable(clazz.cast(publicIp())); case "AssociationId": return Optional.ofNullable(clazz.cast(associationId())); case "IsPrimary": return Optional.ofNullable(clazz.cast(isPrimary())); case "FailureMessage": return Optional.ofNullable(clazz.cast(failureMessage())); case "Status": return Optional.ofNullable(clazz.cast(statusAsString())); 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((NatGatewayAddress) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* [Public NAT gateway only] The allocation ID of the Elastic IP address that's associated with the NAT gateway. *

* * @param allocationId * [Public NAT gateway only] The allocation ID of the Elastic IP address that's associated with the NAT * gateway. * @return Returns a reference to this object so that method calls can be chained together. */ Builder allocationId(String allocationId); /** *

* The ID of the network interface associated with the NAT gateway. *

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

* The private IP address associated with the NAT gateway. *

* * @param privateIp * The private IP address associated with the NAT gateway. * @return Returns a reference to this object so that method calls can be chained together. */ Builder privateIp(String privateIp); /** *

* [Public NAT gateway only] The Elastic IP address associated with the NAT gateway. *

* * @param publicIp * [Public NAT gateway only] The Elastic IP address associated with the NAT gateway. * @return Returns a reference to this object so that method calls can be chained together. */ Builder publicIp(String publicIp); /** *

* [Public NAT gateway only] The association ID of the Elastic IP address that's associated with the NAT * gateway. *

* * @param associationId * [Public NAT gateway only] The association ID of the Elastic IP address that's associated with the NAT * gateway. * @return Returns a reference to this object so that method calls can be chained together. */ Builder associationId(String associationId); /** *

* Defines if the IP address is the primary address. *

* * @param isPrimary * Defines if the IP address is the primary address. * @return Returns a reference to this object so that method calls can be chained together. */ Builder isPrimary(Boolean isPrimary); /** *

* The address failure message. *

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

* The address status. *

* * @param status * The address status. * @see NatGatewayAddressStatus * @return Returns a reference to this object so that method calls can be chained together. * @see NatGatewayAddressStatus */ Builder status(String status); /** *

* The address status. *

* * @param status * The address status. * @see NatGatewayAddressStatus * @return Returns a reference to this object so that method calls can be chained together. * @see NatGatewayAddressStatus */ Builder status(NatGatewayAddressStatus status); } static final class BuilderImpl implements Builder { private String allocationId; private String networkInterfaceId; private String privateIp; private String publicIp; private String associationId; private Boolean isPrimary; private String failureMessage; private String status; private BuilderImpl() { } private BuilderImpl(NatGatewayAddress model) { allocationId(model.allocationId); networkInterfaceId(model.networkInterfaceId); privateIp(model.privateIp); publicIp(model.publicIp); associationId(model.associationId); isPrimary(model.isPrimary); failureMessage(model.failureMessage); status(model.status); } public final String getAllocationId() { return allocationId; } public final void setAllocationId(String allocationId) { this.allocationId = allocationId; } @Override public final Builder allocationId(String allocationId) { this.allocationId = allocationId; return this; } public final String getNetworkInterfaceId() { return networkInterfaceId; } public final void setNetworkInterfaceId(String networkInterfaceId) { this.networkInterfaceId = networkInterfaceId; } @Override public final Builder networkInterfaceId(String networkInterfaceId) { this.networkInterfaceId = networkInterfaceId; return this; } public final String getPrivateIp() { return privateIp; } public final void setPrivateIp(String privateIp) { this.privateIp = privateIp; } @Override public final Builder privateIp(String privateIp) { this.privateIp = privateIp; return this; } public final String getPublicIp() { return publicIp; } public final void setPublicIp(String publicIp) { this.publicIp = publicIp; } @Override public final Builder publicIp(String publicIp) { this.publicIp = publicIp; return this; } public final String getAssociationId() { return associationId; } public final void setAssociationId(String associationId) { this.associationId = associationId; } @Override public final Builder associationId(String associationId) { this.associationId = associationId; return this; } public final Boolean getIsPrimary() { return isPrimary; } public final void setIsPrimary(Boolean isPrimary) { this.isPrimary = isPrimary; } @Override public final Builder isPrimary(Boolean isPrimary) { this.isPrimary = isPrimary; 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 String getStatus() { return status; } public final void setStatus(String status) { this.status = status; } @Override public final Builder status(String status) { this.status = status; return this; } @Override public final Builder status(NatGatewayAddressStatus status) { this.status(status == null ? null : status.toString()); return this; } @Override public NatGatewayAddress build() { return new NatGatewayAddress(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy