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

software.amazon.awssdk.services.ec2.model.ModifyIpamPoolRequest 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.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.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.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;

/**
 */
@Generated("software.amazon.awssdk:codegen")
public final class ModifyIpamPoolRequest extends Ec2Request implements
        ToCopyableBuilder {
    private static final SdkField DRY_RUN_FIELD = SdkField
            . builder(MarshallingType.BOOLEAN)
            .memberName("DryRun")
            .getter(getter(ModifyIpamPoolRequest::dryRun))
            .setter(setter(Builder::dryRun))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DryRun")
                    .unmarshallLocationName("DryRun").build()).build();

    private static final SdkField IPAM_POOL_ID_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .memberName("IpamPoolId")
            .getter(getter(ModifyIpamPoolRequest::ipamPoolId))
            .setter(setter(Builder::ipamPoolId))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IpamPoolId")
                    .unmarshallLocationName("IpamPoolId").build()).build();

    private static final SdkField DESCRIPTION_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .memberName("Description")
            .getter(getter(ModifyIpamPoolRequest::description))
            .setter(setter(Builder::description))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description")
                    .unmarshallLocationName("Description").build()).build();

    private static final SdkField AUTO_IMPORT_FIELD = SdkField
            . builder(MarshallingType.BOOLEAN)
            .memberName("AutoImport")
            .getter(getter(ModifyIpamPoolRequest::autoImport))
            .setter(setter(Builder::autoImport))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AutoImport")
                    .unmarshallLocationName("AutoImport").build()).build();

    private static final SdkField ALLOCATION_MIN_NETMASK_LENGTH_FIELD = SdkField
            . builder(MarshallingType.INTEGER)
            .memberName("AllocationMinNetmaskLength")
            .getter(getter(ModifyIpamPoolRequest::allocationMinNetmaskLength))
            .setter(setter(Builder::allocationMinNetmaskLength))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AllocationMinNetmaskLength")
                    .unmarshallLocationName("AllocationMinNetmaskLength").build()).build();

    private static final SdkField ALLOCATION_MAX_NETMASK_LENGTH_FIELD = SdkField
            . builder(MarshallingType.INTEGER)
            .memberName("AllocationMaxNetmaskLength")
            .getter(getter(ModifyIpamPoolRequest::allocationMaxNetmaskLength))
            .setter(setter(Builder::allocationMaxNetmaskLength))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AllocationMaxNetmaskLength")
                    .unmarshallLocationName("AllocationMaxNetmaskLength").build()).build();

    private static final SdkField ALLOCATION_DEFAULT_NETMASK_LENGTH_FIELD = SdkField
            . builder(MarshallingType.INTEGER)
            .memberName("AllocationDefaultNetmaskLength")
            .getter(getter(ModifyIpamPoolRequest::allocationDefaultNetmaskLength))
            .setter(setter(Builder::allocationDefaultNetmaskLength))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AllocationDefaultNetmaskLength")
                    .unmarshallLocationName("AllocationDefaultNetmaskLength").build()).build();

    private static final SdkField CLEAR_ALLOCATION_DEFAULT_NETMASK_LENGTH_FIELD = SdkField
            . builder(MarshallingType.BOOLEAN)
            .memberName("ClearAllocationDefaultNetmaskLength")
            .getter(getter(ModifyIpamPoolRequest::clearAllocationDefaultNetmaskLength))
            .setter(setter(Builder::clearAllocationDefaultNetmaskLength))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                    .locationName("ClearAllocationDefaultNetmaskLength")
                    .unmarshallLocationName("ClearAllocationDefaultNetmaskLength").build()).build();

    private static final SdkField> ADD_ALLOCATION_RESOURCE_TAGS_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("AddAllocationResourceTags")
            .getter(getter(ModifyIpamPoolRequest::addAllocationResourceTags))
            .setter(setter(Builder::addAllocationResourceTags))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AddAllocationResourceTag")
                    .unmarshallLocationName("AddAllocationResourceTag").build(),
                    ListTrait
                            .builder()
                            .memberLocationName("item")
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.SDK_POJO)
                                            .constructor(RequestIpamResourceTag::builder)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("Item").unmarshallLocationName("item").build()).build())
                            .build()).build();

    private static final SdkField> REMOVE_ALLOCATION_RESOURCE_TAGS_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("RemoveAllocationResourceTags")
            .getter(getter(ModifyIpamPoolRequest::removeAllocationResourceTags))
            .setter(setter(Builder::removeAllocationResourceTags))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RemoveAllocationResourceTag")
                    .unmarshallLocationName("RemoveAllocationResourceTag").build(),
                    ListTrait
                            .builder()
                            .memberLocationName("item")
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.SDK_POJO)
                                            .constructor(RequestIpamResourceTag::builder)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("Item").unmarshallLocationName("item").build()).build())
                            .build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(DRY_RUN_FIELD,
            IPAM_POOL_ID_FIELD, DESCRIPTION_FIELD, AUTO_IMPORT_FIELD, ALLOCATION_MIN_NETMASK_LENGTH_FIELD,
            ALLOCATION_MAX_NETMASK_LENGTH_FIELD, ALLOCATION_DEFAULT_NETMASK_LENGTH_FIELD,
            CLEAR_ALLOCATION_DEFAULT_NETMASK_LENGTH_FIELD, ADD_ALLOCATION_RESOURCE_TAGS_FIELD,
            REMOVE_ALLOCATION_RESOURCE_TAGS_FIELD));

    private static final Map> SDK_NAME_TO_FIELD = Collections
            .unmodifiableMap(new HashMap>() {
                {
                    put("DryRun", DRY_RUN_FIELD);
                    put("IpamPoolId", IPAM_POOL_ID_FIELD);
                    put("Description", DESCRIPTION_FIELD);
                    put("AutoImport", AUTO_IMPORT_FIELD);
                    put("AllocationMinNetmaskLength", ALLOCATION_MIN_NETMASK_LENGTH_FIELD);
                    put("AllocationMaxNetmaskLength", ALLOCATION_MAX_NETMASK_LENGTH_FIELD);
                    put("AllocationDefaultNetmaskLength", ALLOCATION_DEFAULT_NETMASK_LENGTH_FIELD);
                    put("ClearAllocationDefaultNetmaskLength", CLEAR_ALLOCATION_DEFAULT_NETMASK_LENGTH_FIELD);
                    put("AddAllocationResourceTag", ADD_ALLOCATION_RESOURCE_TAGS_FIELD);
                    put("RemoveAllocationResourceTag", REMOVE_ALLOCATION_RESOURCE_TAGS_FIELD);
                }
            });

    private final Boolean dryRun;

    private final String ipamPoolId;

    private final String description;

    private final Boolean autoImport;

    private final Integer allocationMinNetmaskLength;

    private final Integer allocationMaxNetmaskLength;

    private final Integer allocationDefaultNetmaskLength;

    private final Boolean clearAllocationDefaultNetmaskLength;

    private final List addAllocationResourceTags;

    private final List removeAllocationResourceTags;

    private ModifyIpamPoolRequest(BuilderImpl builder) {
        super(builder);
        this.dryRun = builder.dryRun;
        this.ipamPoolId = builder.ipamPoolId;
        this.description = builder.description;
        this.autoImport = builder.autoImport;
        this.allocationMinNetmaskLength = builder.allocationMinNetmaskLength;
        this.allocationMaxNetmaskLength = builder.allocationMaxNetmaskLength;
        this.allocationDefaultNetmaskLength = builder.allocationDefaultNetmaskLength;
        this.clearAllocationDefaultNetmaskLength = builder.clearAllocationDefaultNetmaskLength;
        this.addAllocationResourceTags = builder.addAllocationResourceTags;
        this.removeAllocationResourceTags = builder.removeAllocationResourceTags;
    }

    /**
     * 

* A check for 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 A check for 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; } /** *

* The ID of the IPAM pool you want to modify. *

* * @return The ID of the IPAM pool you want to modify. */ public final String ipamPoolId() { return ipamPoolId; } /** *

* The description of the IPAM pool you want to modify. *

* * @return The description of the IPAM pool you want to modify. */ public final String description() { return description; } /** *

* If true, IPAM will continuously look for resources within the CIDR range of this pool and automatically import * them as allocations into your IPAM. The CIDRs that will be allocated for these resources must not already be * allocated to other resources in order for the import to succeed. IPAM will import a CIDR regardless of its * compliance with the pool's allocation rules, so a resource might be imported and subsequently marked as * noncompliant. If IPAM discovers multiple CIDRs that overlap, IPAM will import the largest CIDR only. If IPAM * discovers multiple CIDRs with matching CIDRs, IPAM will randomly import one of them only. *

*

* A locale must be set on the pool for this feature to work. *

* * @return If true, IPAM will continuously look for resources within the CIDR range of this pool and automatically * import them as allocations into your IPAM. The CIDRs that will be allocated for these resources must not * already be allocated to other resources in order for the import to succeed. IPAM will import a CIDR * regardless of its compliance with the pool's allocation rules, so a resource might be imported and * subsequently marked as noncompliant. If IPAM discovers multiple CIDRs that overlap, IPAM will import the * largest CIDR only. If IPAM discovers multiple CIDRs with matching CIDRs, IPAM will randomly import one of * them only.

*

* A locale must be set on the pool for this feature to work. */ public final Boolean autoImport() { return autoImport; } /** *

* The minimum netmask length required for CIDR allocations in this IPAM pool to be compliant. Possible netmask * lengths for IPv4 addresses are 0 - 32. Possible netmask lengths for IPv6 addresses are 0 - 128. The minimum * netmask length must be less than the maximum netmask length. *

* * @return The minimum netmask length required for CIDR allocations in this IPAM pool to be compliant. Possible * netmask lengths for IPv4 addresses are 0 - 32. Possible netmask lengths for IPv6 addresses are 0 - 128. * The minimum netmask length must be less than the maximum netmask length. */ public final Integer allocationMinNetmaskLength() { return allocationMinNetmaskLength; } /** *

* The maximum netmask length possible for CIDR allocations in this IPAM pool to be compliant. Possible netmask * lengths for IPv4 addresses are 0 - 32. Possible netmask lengths for IPv6 addresses are 0 - 128.The maximum * netmask length must be greater than the minimum netmask length. *

* * @return The maximum netmask length possible for CIDR allocations in this IPAM pool to be compliant. Possible * netmask lengths for IPv4 addresses are 0 - 32. Possible netmask lengths for IPv6 addresses are 0 - * 128.The maximum netmask length must be greater than the minimum netmask length. */ public final Integer allocationMaxNetmaskLength() { return allocationMaxNetmaskLength; } /** *

* The default netmask length for allocations added to this pool. If, for example, the CIDR assigned to this pool is * 10.0.0.0/8 and you enter 16 here, new allocations will default to 10.0.0.0/16. *

* * @return The default netmask length for allocations added to this pool. If, for example, the CIDR assigned to this * pool is 10.0.0.0/8 and you enter 16 here, new allocations will default to 10.0.0.0/16. */ public final Integer allocationDefaultNetmaskLength() { return allocationDefaultNetmaskLength; } /** *

* Clear the default netmask length allocation rule for this pool. *

* * @return Clear the default netmask length allocation rule for this pool. */ public final Boolean clearAllocationDefaultNetmaskLength() { return clearAllocationDefaultNetmaskLength; } /** * For responses, this returns true if the service returned a value for the AddAllocationResourceTags 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 hasAddAllocationResourceTags() { return addAllocationResourceTags != null && !(addAllocationResourceTags instanceof SdkAutoConstructList); } /** *

* Add tag allocation rules to a pool. For more information about allocation rules, see Create a top-level pool in the * Amazon VPC IPAM User Guide. *

*

* 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 #hasAddAllocationResourceTags} method. *

* * @return Add tag allocation rules to a pool. For more information about allocation rules, see Create a top-level pool in * the Amazon VPC IPAM User Guide. */ public final List addAllocationResourceTags() { return addAllocationResourceTags; } /** * For responses, this returns true if the service returned a value for the RemoveAllocationResourceTags 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 hasRemoveAllocationResourceTags() { return removeAllocationResourceTags != null && !(removeAllocationResourceTags instanceof SdkAutoConstructList); } /** *

* Remove tag allocation rules from a pool. *

*

* 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 #hasRemoveAllocationResourceTags} method. *

* * @return Remove tag allocation rules from a pool. */ public final List removeAllocationResourceTags() { return removeAllocationResourceTags; } @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(dryRun()); hashCode = 31 * hashCode + Objects.hashCode(ipamPoolId()); hashCode = 31 * hashCode + Objects.hashCode(description()); hashCode = 31 * hashCode + Objects.hashCode(autoImport()); hashCode = 31 * hashCode + Objects.hashCode(allocationMinNetmaskLength()); hashCode = 31 * hashCode + Objects.hashCode(allocationMaxNetmaskLength()); hashCode = 31 * hashCode + Objects.hashCode(allocationDefaultNetmaskLength()); hashCode = 31 * hashCode + Objects.hashCode(clearAllocationDefaultNetmaskLength()); hashCode = 31 * hashCode + Objects.hashCode(hasAddAllocationResourceTags() ? addAllocationResourceTags() : null); hashCode = 31 * hashCode + Objects.hashCode(hasRemoveAllocationResourceTags() ? removeAllocationResourceTags() : null); 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 ModifyIpamPoolRequest)) { return false; } ModifyIpamPoolRequest other = (ModifyIpamPoolRequest) obj; return Objects.equals(dryRun(), other.dryRun()) && Objects.equals(ipamPoolId(), other.ipamPoolId()) && Objects.equals(description(), other.description()) && Objects.equals(autoImport(), other.autoImport()) && Objects.equals(allocationMinNetmaskLength(), other.allocationMinNetmaskLength()) && Objects.equals(allocationMaxNetmaskLength(), other.allocationMaxNetmaskLength()) && Objects.equals(allocationDefaultNetmaskLength(), other.allocationDefaultNetmaskLength()) && Objects.equals(clearAllocationDefaultNetmaskLength(), other.clearAllocationDefaultNetmaskLength()) && hasAddAllocationResourceTags() == other.hasAddAllocationResourceTags() && Objects.equals(addAllocationResourceTags(), other.addAllocationResourceTags()) && hasRemoveAllocationResourceTags() == other.hasRemoveAllocationResourceTags() && Objects.equals(removeAllocationResourceTags(), other.removeAllocationResourceTags()); } /** * 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("ModifyIpamPoolRequest").add("DryRun", dryRun()).add("IpamPoolId", ipamPoolId()) .add("Description", description()).add("AutoImport", autoImport()) .add("AllocationMinNetmaskLength", allocationMinNetmaskLength()) .add("AllocationMaxNetmaskLength", allocationMaxNetmaskLength()) .add("AllocationDefaultNetmaskLength", allocationDefaultNetmaskLength()) .add("ClearAllocationDefaultNetmaskLength", clearAllocationDefaultNetmaskLength()) .add("AddAllocationResourceTags", hasAddAllocationResourceTags() ? addAllocationResourceTags() : null) .add("RemoveAllocationResourceTags", hasRemoveAllocationResourceTags() ? removeAllocationResourceTags() : null) .build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "DryRun": return Optional.ofNullable(clazz.cast(dryRun())); case "IpamPoolId": return Optional.ofNullable(clazz.cast(ipamPoolId())); case "Description": return Optional.ofNullable(clazz.cast(description())); case "AutoImport": return Optional.ofNullable(clazz.cast(autoImport())); case "AllocationMinNetmaskLength": return Optional.ofNullable(clazz.cast(allocationMinNetmaskLength())); case "AllocationMaxNetmaskLength": return Optional.ofNullable(clazz.cast(allocationMaxNetmaskLength())); case "AllocationDefaultNetmaskLength": return Optional.ofNullable(clazz.cast(allocationDefaultNetmaskLength())); case "ClearAllocationDefaultNetmaskLength": return Optional.ofNullable(clazz.cast(clearAllocationDefaultNetmaskLength())); case "AddAllocationResourceTags": return Optional.ofNullable(clazz.cast(addAllocationResourceTags())); case "RemoveAllocationResourceTags": return Optional.ofNullable(clazz.cast(removeAllocationResourceTags())); 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((ModifyIpamPoolRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends Ec2Request.Builder, SdkPojo, CopyableBuilder { /** *

* A check for 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 * A check for 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); /** *

* The ID of the IPAM pool you want to modify. *

* * @param ipamPoolId * The ID of the IPAM pool you want to modify. * @return Returns a reference to this object so that method calls can be chained together. */ Builder ipamPoolId(String ipamPoolId); /** *

* The description of the IPAM pool you want to modify. *

* * @param description * The description of the IPAM pool you want to modify. * @return Returns a reference to this object so that method calls can be chained together. */ Builder description(String description); /** *

* If true, IPAM will continuously look for resources within the CIDR range of this pool and automatically * import them as allocations into your IPAM. The CIDRs that will be allocated for these resources must not * already be allocated to other resources in order for the import to succeed. IPAM will import a CIDR * regardless of its compliance with the pool's allocation rules, so a resource might be imported and * subsequently marked as noncompliant. If IPAM discovers multiple CIDRs that overlap, IPAM will import the * largest CIDR only. If IPAM discovers multiple CIDRs with matching CIDRs, IPAM will randomly import one of * them only. *

*

* A locale must be set on the pool for this feature to work. *

* * @param autoImport * If true, IPAM will continuously look for resources within the CIDR range of this pool and * automatically import them as allocations into your IPAM. The CIDRs that will be allocated for these * resources must not already be allocated to other resources in order for the import to succeed. IPAM * will import a CIDR regardless of its compliance with the pool's allocation rules, so a resource might * be imported and subsequently marked as noncompliant. If IPAM discovers multiple CIDRs that overlap, * IPAM will import the largest CIDR only. If IPAM discovers multiple CIDRs with matching CIDRs, IPAM * will randomly import one of them only.

*

* A locale must be set on the pool for this feature to work. * @return Returns a reference to this object so that method calls can be chained together. */ Builder autoImport(Boolean autoImport); /** *

* The minimum netmask length required for CIDR allocations in this IPAM pool to be compliant. Possible netmask * lengths for IPv4 addresses are 0 - 32. Possible netmask lengths for IPv6 addresses are 0 - 128. The minimum * netmask length must be less than the maximum netmask length. *

* * @param allocationMinNetmaskLength * The minimum netmask length required for CIDR allocations in this IPAM pool to be compliant. Possible * netmask lengths for IPv4 addresses are 0 - 32. Possible netmask lengths for IPv6 addresses are 0 - * 128. The minimum netmask length must be less than the maximum netmask length. * @return Returns a reference to this object so that method calls can be chained together. */ Builder allocationMinNetmaskLength(Integer allocationMinNetmaskLength); /** *

* The maximum netmask length possible for CIDR allocations in this IPAM pool to be compliant. Possible netmask * lengths for IPv4 addresses are 0 - 32. Possible netmask lengths for IPv6 addresses are 0 - 128.The maximum * netmask length must be greater than the minimum netmask length. *

* * @param allocationMaxNetmaskLength * The maximum netmask length possible for CIDR allocations in this IPAM pool to be compliant. Possible * netmask lengths for IPv4 addresses are 0 - 32. Possible netmask lengths for IPv6 addresses are 0 - * 128.The maximum netmask length must be greater than the minimum netmask length. * @return Returns a reference to this object so that method calls can be chained together. */ Builder allocationMaxNetmaskLength(Integer allocationMaxNetmaskLength); /** *

* The default netmask length for allocations added to this pool. If, for example, the CIDR assigned to this * pool is 10.0.0.0/8 and you enter 16 here, new allocations will default to 10.0.0.0/16. *

* * @param allocationDefaultNetmaskLength * The default netmask length for allocations added to this pool. If, for example, the CIDR assigned to * this pool is 10.0.0.0/8 and you enter 16 here, new allocations will default to 10.0.0.0/16. * @return Returns a reference to this object so that method calls can be chained together. */ Builder allocationDefaultNetmaskLength(Integer allocationDefaultNetmaskLength); /** *

* Clear the default netmask length allocation rule for this pool. *

* * @param clearAllocationDefaultNetmaskLength * Clear the default netmask length allocation rule for this pool. * @return Returns a reference to this object so that method calls can be chained together. */ Builder clearAllocationDefaultNetmaskLength(Boolean clearAllocationDefaultNetmaskLength); /** *

* Add tag allocation rules to a pool. For more information about allocation rules, see Create a top-level pool in the * Amazon VPC IPAM User Guide. *

* * @param addAllocationResourceTags * Add tag allocation rules to a pool. For more information about allocation rules, see Create a top-level pool in * the Amazon VPC IPAM User Guide. * @return Returns a reference to this object so that method calls can be chained together. */ Builder addAllocationResourceTags(Collection addAllocationResourceTags); /** *

* Add tag allocation rules to a pool. For more information about allocation rules, see Create a top-level pool in the * Amazon VPC IPAM User Guide. *

* * @param addAllocationResourceTags * Add tag allocation rules to a pool. For more information about allocation rules, see Create a top-level pool in * the Amazon VPC IPAM User Guide. * @return Returns a reference to this object so that method calls can be chained together. */ Builder addAllocationResourceTags(RequestIpamResourceTag... addAllocationResourceTags); /** *

* Add tag allocation rules to a pool. For more information about allocation rules, see Create a top-level pool in the * Amazon VPC IPAM User Guide. *

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

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

* Remove tag allocation rules from a pool. *

* * @param removeAllocationResourceTags * Remove tag allocation rules from a pool. * @return Returns a reference to this object so that method calls can be chained together. */ Builder removeAllocationResourceTags(Collection removeAllocationResourceTags); /** *

* Remove tag allocation rules from a pool. *

* * @param removeAllocationResourceTags * Remove tag allocation rules from a pool. * @return Returns a reference to this object so that method calls can be chained together. */ Builder removeAllocationResourceTags(RequestIpamResourceTag... removeAllocationResourceTags); /** *

* Remove tag allocation rules from a pool. *

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

* When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.ec2.model.RequestIpamResourceTag.Builder#build()} is called * immediately and its result is passed to {@link #removeAllocationResourceTags(List)}. * * @param removeAllocationResourceTags * a consumer that will call methods on * {@link software.amazon.awssdk.services.ec2.model.RequestIpamResourceTag.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #removeAllocationResourceTags(java.util.Collection) */ Builder removeAllocationResourceTags(Consumer... removeAllocationResourceTags); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends Ec2Request.BuilderImpl implements Builder { private Boolean dryRun; private String ipamPoolId; private String description; private Boolean autoImport; private Integer allocationMinNetmaskLength; private Integer allocationMaxNetmaskLength; private Integer allocationDefaultNetmaskLength; private Boolean clearAllocationDefaultNetmaskLength; private List addAllocationResourceTags = DefaultSdkAutoConstructList.getInstance(); private List removeAllocationResourceTags = DefaultSdkAutoConstructList.getInstance(); private BuilderImpl() { } private BuilderImpl(ModifyIpamPoolRequest model) { super(model); dryRun(model.dryRun); ipamPoolId(model.ipamPoolId); description(model.description); autoImport(model.autoImport); allocationMinNetmaskLength(model.allocationMinNetmaskLength); allocationMaxNetmaskLength(model.allocationMaxNetmaskLength); allocationDefaultNetmaskLength(model.allocationDefaultNetmaskLength); clearAllocationDefaultNetmaskLength(model.clearAllocationDefaultNetmaskLength); addAllocationResourceTags(model.addAllocationResourceTags); removeAllocationResourceTags(model.removeAllocationResourceTags); } 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 String getIpamPoolId() { return ipamPoolId; } public final void setIpamPoolId(String ipamPoolId) { this.ipamPoolId = ipamPoolId; } @Override public final Builder ipamPoolId(String ipamPoolId) { this.ipamPoolId = ipamPoolId; return this; } public final String getDescription() { return description; } public final void setDescription(String description) { this.description = description; } @Override public final Builder description(String description) { this.description = description; return this; } public final Boolean getAutoImport() { return autoImport; } public final void setAutoImport(Boolean autoImport) { this.autoImport = autoImport; } @Override public final Builder autoImport(Boolean autoImport) { this.autoImport = autoImport; return this; } public final Integer getAllocationMinNetmaskLength() { return allocationMinNetmaskLength; } public final void setAllocationMinNetmaskLength(Integer allocationMinNetmaskLength) { this.allocationMinNetmaskLength = allocationMinNetmaskLength; } @Override public final Builder allocationMinNetmaskLength(Integer allocationMinNetmaskLength) { this.allocationMinNetmaskLength = allocationMinNetmaskLength; return this; } public final Integer getAllocationMaxNetmaskLength() { return allocationMaxNetmaskLength; } public final void setAllocationMaxNetmaskLength(Integer allocationMaxNetmaskLength) { this.allocationMaxNetmaskLength = allocationMaxNetmaskLength; } @Override public final Builder allocationMaxNetmaskLength(Integer allocationMaxNetmaskLength) { this.allocationMaxNetmaskLength = allocationMaxNetmaskLength; return this; } public final Integer getAllocationDefaultNetmaskLength() { return allocationDefaultNetmaskLength; } public final void setAllocationDefaultNetmaskLength(Integer allocationDefaultNetmaskLength) { this.allocationDefaultNetmaskLength = allocationDefaultNetmaskLength; } @Override public final Builder allocationDefaultNetmaskLength(Integer allocationDefaultNetmaskLength) { this.allocationDefaultNetmaskLength = allocationDefaultNetmaskLength; return this; } public final Boolean getClearAllocationDefaultNetmaskLength() { return clearAllocationDefaultNetmaskLength; } public final void setClearAllocationDefaultNetmaskLength(Boolean clearAllocationDefaultNetmaskLength) { this.clearAllocationDefaultNetmaskLength = clearAllocationDefaultNetmaskLength; } @Override public final Builder clearAllocationDefaultNetmaskLength(Boolean clearAllocationDefaultNetmaskLength) { this.clearAllocationDefaultNetmaskLength = clearAllocationDefaultNetmaskLength; return this; } public final List getAddAllocationResourceTags() { List result = RequestIpamResourceTagListCopier .copyToBuilder(this.addAllocationResourceTags); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setAddAllocationResourceTags(Collection addAllocationResourceTags) { this.addAllocationResourceTags = RequestIpamResourceTagListCopier.copyFromBuilder(addAllocationResourceTags); } @Override public final Builder addAllocationResourceTags(Collection addAllocationResourceTags) { this.addAllocationResourceTags = RequestIpamResourceTagListCopier.copy(addAllocationResourceTags); return this; } @Override @SafeVarargs public final Builder addAllocationResourceTags(RequestIpamResourceTag... addAllocationResourceTags) { addAllocationResourceTags(Arrays.asList(addAllocationResourceTags)); return this; } @Override @SafeVarargs public final Builder addAllocationResourceTags(Consumer... addAllocationResourceTags) { addAllocationResourceTags(Stream.of(addAllocationResourceTags) .map(c -> RequestIpamResourceTag.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } public final List getRemoveAllocationResourceTags() { List result = RequestIpamResourceTagListCopier .copyToBuilder(this.removeAllocationResourceTags); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setRemoveAllocationResourceTags( Collection removeAllocationResourceTags) { this.removeAllocationResourceTags = RequestIpamResourceTagListCopier.copyFromBuilder(removeAllocationResourceTags); } @Override public final Builder removeAllocationResourceTags(Collection removeAllocationResourceTags) { this.removeAllocationResourceTags = RequestIpamResourceTagListCopier.copy(removeAllocationResourceTags); return this; } @Override @SafeVarargs public final Builder removeAllocationResourceTags(RequestIpamResourceTag... removeAllocationResourceTags) { removeAllocationResourceTags(Arrays.asList(removeAllocationResourceTags)); return this; } @Override @SafeVarargs public final Builder removeAllocationResourceTags( Consumer... removeAllocationResourceTags) { removeAllocationResourceTags(Stream.of(removeAllocationResourceTags) .map(c -> RequestIpamResourceTag.builder().applyMutation(c).build()).collect(Collectors.toList())); 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 ModifyIpamPoolRequest build() { return new ModifyIpamPoolRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy