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

software.amazon.awssdk.services.ec2.model.VpcIpv6CidrBlockAssociation 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.Consumer;
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 an IPv6 CIDR block associated with a VPC. *

*/ @Generated("software.amazon.awssdk:codegen") public final class VpcIpv6CidrBlockAssociation implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField ASSOCIATION_ID_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("AssociationId") .getter(getter(VpcIpv6CidrBlockAssociation::associationId)) .setter(setter(Builder::associationId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AssociationId") .unmarshallLocationName("associationId").build()).build(); private static final SdkField IPV6_CIDR_BLOCK_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("Ipv6CidrBlock") .getter(getter(VpcIpv6CidrBlockAssociation::ipv6CidrBlock)) .setter(setter(Builder::ipv6CidrBlock)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Ipv6CidrBlock") .unmarshallLocationName("ipv6CidrBlock").build()).build(); private static final SdkField IPV6_CIDR_BLOCK_STATE_FIELD = SdkField . builder(MarshallingType.SDK_POJO) .memberName("Ipv6CidrBlockState") .getter(getter(VpcIpv6CidrBlockAssociation::ipv6CidrBlockState)) .setter(setter(Builder::ipv6CidrBlockState)) .constructor(VpcCidrBlockState::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Ipv6CidrBlockState") .unmarshallLocationName("ipv6CidrBlockState").build()).build(); private static final SdkField NETWORK_BORDER_GROUP_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("NetworkBorderGroup") .getter(getter(VpcIpv6CidrBlockAssociation::networkBorderGroup)) .setter(setter(Builder::networkBorderGroup)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NetworkBorderGroup") .unmarshallLocationName("networkBorderGroup").build()).build(); private static final SdkField IPV6_POOL_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("Ipv6Pool") .getter(getter(VpcIpv6CidrBlockAssociation::ipv6Pool)) .setter(setter(Builder::ipv6Pool)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Ipv6Pool") .unmarshallLocationName("ipv6Pool").build()).build(); private static final SdkField IPV6_ADDRESS_ATTRIBUTE_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("Ipv6AddressAttribute") .getter(getter(VpcIpv6CidrBlockAssociation::ipv6AddressAttributeAsString)) .setter(setter(Builder::ipv6AddressAttribute)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Ipv6AddressAttribute") .unmarshallLocationName("ipv6AddressAttribute").build()).build(); private static final SdkField IP_SOURCE_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("IpSource") .getter(getter(VpcIpv6CidrBlockAssociation::ipSourceAsString)) .setter(setter(Builder::ipSource)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IpSource") .unmarshallLocationName("ipSource").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ASSOCIATION_ID_FIELD, IPV6_CIDR_BLOCK_FIELD, IPV6_CIDR_BLOCK_STATE_FIELD, NETWORK_BORDER_GROUP_FIELD, IPV6_POOL_FIELD, IPV6_ADDRESS_ATTRIBUTE_FIELD, IP_SOURCE_FIELD)); private static final Map> SDK_NAME_TO_FIELD = Collections .unmodifiableMap(new HashMap>() { { put("AssociationId", ASSOCIATION_ID_FIELD); put("Ipv6CidrBlock", IPV6_CIDR_BLOCK_FIELD); put("Ipv6CidrBlockState", IPV6_CIDR_BLOCK_STATE_FIELD); put("NetworkBorderGroup", NETWORK_BORDER_GROUP_FIELD); put("Ipv6Pool", IPV6_POOL_FIELD); put("Ipv6AddressAttribute", IPV6_ADDRESS_ATTRIBUTE_FIELD); put("IpSource", IP_SOURCE_FIELD); } }); private static final long serialVersionUID = 1L; private final String associationId; private final String ipv6CidrBlock; private final VpcCidrBlockState ipv6CidrBlockState; private final String networkBorderGroup; private final String ipv6Pool; private final String ipv6AddressAttribute; private final String ipSource; private VpcIpv6CidrBlockAssociation(BuilderImpl builder) { this.associationId = builder.associationId; this.ipv6CidrBlock = builder.ipv6CidrBlock; this.ipv6CidrBlockState = builder.ipv6CidrBlockState; this.networkBorderGroup = builder.networkBorderGroup; this.ipv6Pool = builder.ipv6Pool; this.ipv6AddressAttribute = builder.ipv6AddressAttribute; this.ipSource = builder.ipSource; } /** *

* The association ID for the IPv6 CIDR block. *

* * @return The association ID for the IPv6 CIDR block. */ public final String associationId() { return associationId; } /** *

* The IPv6 CIDR block. *

* * @return The IPv6 CIDR block. */ public final String ipv6CidrBlock() { return ipv6CidrBlock; } /** *

* Information about the state of the CIDR block. *

* * @return Information about the state of the CIDR block. */ public final VpcCidrBlockState ipv6CidrBlockState() { return ipv6CidrBlockState; } /** *

* The name of the unique set of Availability Zones, Local Zones, or Wavelength Zones from which Amazon Web Services * advertises IP addresses, for example, us-east-1-wl1-bos-wlz-1. *

* * @return The name of the unique set of Availability Zones, Local Zones, or Wavelength Zones from which Amazon Web * Services advertises IP addresses, for example, us-east-1-wl1-bos-wlz-1. */ public final String networkBorderGroup() { return networkBorderGroup; } /** *

* The ID of the IPv6 address pool from which the IPv6 CIDR block is allocated. *

* * @return The ID of the IPv6 address pool from which the IPv6 CIDR block is allocated. */ public final String ipv6Pool() { return ipv6Pool; } /** *

* Public IPv6 addresses are those advertised on the internet from Amazon Web Services. Private IP addresses are not * and cannot be advertised on the internet from Amazon Web Services. *

*

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

* * @return Public IPv6 addresses are those advertised on the internet from Amazon Web Services. Private IP addresses * are not and cannot be advertised on the internet from Amazon Web Services. * @see Ipv6AddressAttribute */ public final Ipv6AddressAttribute ipv6AddressAttribute() { return Ipv6AddressAttribute.fromValue(ipv6AddressAttribute); } /** *

* Public IPv6 addresses are those advertised on the internet from Amazon Web Services. Private IP addresses are not * and cannot be advertised on the internet from Amazon Web Services. *

*

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

* * @return Public IPv6 addresses are those advertised on the internet from Amazon Web Services. Private IP addresses * are not and cannot be advertised on the internet from Amazon Web Services. * @see Ipv6AddressAttribute */ public final String ipv6AddressAttributeAsString() { return ipv6AddressAttribute; } /** *

* The source that allocated the IP address space. byoip or amazon indicates public IP * address space allocated by Amazon or space that you have allocated with Bring your own IP (BYOIP). * none indicates private space. *

*

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

* * @return The source that allocated the IP address space. byoip or amazon indicates * public IP address space allocated by Amazon or space that you have allocated with Bring your own IP * (BYOIP). none indicates private space. * @see IpSource */ public final IpSource ipSource() { return IpSource.fromValue(ipSource); } /** *

* The source that allocated the IP address space. byoip or amazon indicates public IP * address space allocated by Amazon or space that you have allocated with Bring your own IP (BYOIP). * none indicates private space. *

*

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

* * @return The source that allocated the IP address space. byoip or amazon indicates * public IP address space allocated by Amazon or space that you have allocated with Bring your own IP * (BYOIP). none indicates private space. * @see IpSource */ public final String ipSourceAsString() { return ipSource; } @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(associationId()); hashCode = 31 * hashCode + Objects.hashCode(ipv6CidrBlock()); hashCode = 31 * hashCode + Objects.hashCode(ipv6CidrBlockState()); hashCode = 31 * hashCode + Objects.hashCode(networkBorderGroup()); hashCode = 31 * hashCode + Objects.hashCode(ipv6Pool()); hashCode = 31 * hashCode + Objects.hashCode(ipv6AddressAttributeAsString()); hashCode = 31 * hashCode + Objects.hashCode(ipSourceAsString()); 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 VpcIpv6CidrBlockAssociation)) { return false; } VpcIpv6CidrBlockAssociation other = (VpcIpv6CidrBlockAssociation) obj; return Objects.equals(associationId(), other.associationId()) && Objects.equals(ipv6CidrBlock(), other.ipv6CidrBlock()) && Objects.equals(ipv6CidrBlockState(), other.ipv6CidrBlockState()) && Objects.equals(networkBorderGroup(), other.networkBorderGroup()) && Objects.equals(ipv6Pool(), other.ipv6Pool()) && Objects.equals(ipv6AddressAttributeAsString(), other.ipv6AddressAttributeAsString()) && Objects.equals(ipSourceAsString(), other.ipSourceAsString()); } /** * 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("VpcIpv6CidrBlockAssociation").add("AssociationId", associationId()) .add("Ipv6CidrBlock", ipv6CidrBlock()).add("Ipv6CidrBlockState", ipv6CidrBlockState()) .add("NetworkBorderGroup", networkBorderGroup()).add("Ipv6Pool", ipv6Pool()) .add("Ipv6AddressAttribute", ipv6AddressAttributeAsString()).add("IpSource", ipSourceAsString()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "AssociationId": return Optional.ofNullable(clazz.cast(associationId())); case "Ipv6CidrBlock": return Optional.ofNullable(clazz.cast(ipv6CidrBlock())); case "Ipv6CidrBlockState": return Optional.ofNullable(clazz.cast(ipv6CidrBlockState())); case "NetworkBorderGroup": return Optional.ofNullable(clazz.cast(networkBorderGroup())); case "Ipv6Pool": return Optional.ofNullable(clazz.cast(ipv6Pool())); case "Ipv6AddressAttribute": return Optional.ofNullable(clazz.cast(ipv6AddressAttributeAsString())); case "IpSource": return Optional.ofNullable(clazz.cast(ipSourceAsString())); 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((VpcIpv6CidrBlockAssociation) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The association ID for the IPv6 CIDR block. *

* * @param associationId * The association ID for the IPv6 CIDR block. * @return Returns a reference to this object so that method calls can be chained together. */ Builder associationId(String associationId); /** *

* The IPv6 CIDR block. *

* * @param ipv6CidrBlock * The IPv6 CIDR block. * @return Returns a reference to this object so that method calls can be chained together. */ Builder ipv6CidrBlock(String ipv6CidrBlock); /** *

* Information about the state of the CIDR block. *

* * @param ipv6CidrBlockState * Information about the state of the CIDR block. * @return Returns a reference to this object so that method calls can be chained together. */ Builder ipv6CidrBlockState(VpcCidrBlockState ipv6CidrBlockState); /** *

* Information about the state of the CIDR block. *

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

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

* The name of the unique set of Availability Zones, Local Zones, or Wavelength Zones from which Amazon Web * Services advertises IP addresses, for example, us-east-1-wl1-bos-wlz-1. *

* * @param networkBorderGroup * The name of the unique set of Availability Zones, Local Zones, or Wavelength Zones from which Amazon * Web Services advertises IP addresses, for example, us-east-1-wl1-bos-wlz-1. * @return Returns a reference to this object so that method calls can be chained together. */ Builder networkBorderGroup(String networkBorderGroup); /** *

* The ID of the IPv6 address pool from which the IPv6 CIDR block is allocated. *

* * @param ipv6Pool * The ID of the IPv6 address pool from which the IPv6 CIDR block is allocated. * @return Returns a reference to this object so that method calls can be chained together. */ Builder ipv6Pool(String ipv6Pool); /** *

* Public IPv6 addresses are those advertised on the internet from Amazon Web Services. Private IP addresses are * not and cannot be advertised on the internet from Amazon Web Services. *

* * @param ipv6AddressAttribute * Public IPv6 addresses are those advertised on the internet from Amazon Web Services. Private IP * addresses are not and cannot be advertised on the internet from Amazon Web Services. * @see Ipv6AddressAttribute * @return Returns a reference to this object so that method calls can be chained together. * @see Ipv6AddressAttribute */ Builder ipv6AddressAttribute(String ipv6AddressAttribute); /** *

* Public IPv6 addresses are those advertised on the internet from Amazon Web Services. Private IP addresses are * not and cannot be advertised on the internet from Amazon Web Services. *

* * @param ipv6AddressAttribute * Public IPv6 addresses are those advertised on the internet from Amazon Web Services. Private IP * addresses are not and cannot be advertised on the internet from Amazon Web Services. * @see Ipv6AddressAttribute * @return Returns a reference to this object so that method calls can be chained together. * @see Ipv6AddressAttribute */ Builder ipv6AddressAttribute(Ipv6AddressAttribute ipv6AddressAttribute); /** *

* The source that allocated the IP address space. byoip or amazon indicates public IP * address space allocated by Amazon or space that you have allocated with Bring your own IP (BYOIP). * none indicates private space. *

* * @param ipSource * The source that allocated the IP address space. byoip or amazon indicates * public IP address space allocated by Amazon or space that you have allocated with Bring your own IP * (BYOIP). none indicates private space. * @see IpSource * @return Returns a reference to this object so that method calls can be chained together. * @see IpSource */ Builder ipSource(String ipSource); /** *

* The source that allocated the IP address space. byoip or amazon indicates public IP * address space allocated by Amazon or space that you have allocated with Bring your own IP (BYOIP). * none indicates private space. *

* * @param ipSource * The source that allocated the IP address space. byoip or amazon indicates * public IP address space allocated by Amazon or space that you have allocated with Bring your own IP * (BYOIP). none indicates private space. * @see IpSource * @return Returns a reference to this object so that method calls can be chained together. * @see IpSource */ Builder ipSource(IpSource ipSource); } static final class BuilderImpl implements Builder { private String associationId; private String ipv6CidrBlock; private VpcCidrBlockState ipv6CidrBlockState; private String networkBorderGroup; private String ipv6Pool; private String ipv6AddressAttribute; private String ipSource; private BuilderImpl() { } private BuilderImpl(VpcIpv6CidrBlockAssociation model) { associationId(model.associationId); ipv6CidrBlock(model.ipv6CidrBlock); ipv6CidrBlockState(model.ipv6CidrBlockState); networkBorderGroup(model.networkBorderGroup); ipv6Pool(model.ipv6Pool); ipv6AddressAttribute(model.ipv6AddressAttribute); ipSource(model.ipSource); } 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 String getIpv6CidrBlock() { return ipv6CidrBlock; } public final void setIpv6CidrBlock(String ipv6CidrBlock) { this.ipv6CidrBlock = ipv6CidrBlock; } @Override public final Builder ipv6CidrBlock(String ipv6CidrBlock) { this.ipv6CidrBlock = ipv6CidrBlock; return this; } public final VpcCidrBlockState.Builder getIpv6CidrBlockState() { return ipv6CidrBlockState != null ? ipv6CidrBlockState.toBuilder() : null; } public final void setIpv6CidrBlockState(VpcCidrBlockState.BuilderImpl ipv6CidrBlockState) { this.ipv6CidrBlockState = ipv6CidrBlockState != null ? ipv6CidrBlockState.build() : null; } @Override public final Builder ipv6CidrBlockState(VpcCidrBlockState ipv6CidrBlockState) { this.ipv6CidrBlockState = ipv6CidrBlockState; return this; } public final String getNetworkBorderGroup() { return networkBorderGroup; } public final void setNetworkBorderGroup(String networkBorderGroup) { this.networkBorderGroup = networkBorderGroup; } @Override public final Builder networkBorderGroup(String networkBorderGroup) { this.networkBorderGroup = networkBorderGroup; return this; } public final String getIpv6Pool() { return ipv6Pool; } public final void setIpv6Pool(String ipv6Pool) { this.ipv6Pool = ipv6Pool; } @Override public final Builder ipv6Pool(String ipv6Pool) { this.ipv6Pool = ipv6Pool; return this; } public final String getIpv6AddressAttribute() { return ipv6AddressAttribute; } public final void setIpv6AddressAttribute(String ipv6AddressAttribute) { this.ipv6AddressAttribute = ipv6AddressAttribute; } @Override public final Builder ipv6AddressAttribute(String ipv6AddressAttribute) { this.ipv6AddressAttribute = ipv6AddressAttribute; return this; } @Override public final Builder ipv6AddressAttribute(Ipv6AddressAttribute ipv6AddressAttribute) { this.ipv6AddressAttribute(ipv6AddressAttribute == null ? null : ipv6AddressAttribute.toString()); return this; } public final String getIpSource() { return ipSource; } public final void setIpSource(String ipSource) { this.ipSource = ipSource; } @Override public final Builder ipSource(String ipSource) { this.ipSource = ipSource; return this; } @Override public final Builder ipSource(IpSource ipSource) { this.ipSource(ipSource == null ? null : ipSource.toString()); return this; } @Override public VpcIpv6CidrBlockAssociation build() { return new VpcIpv6CidrBlockAssociation(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy