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

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

Go to download

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

The newest version!
/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
 * the License. A copy of the License is located at
 * 
 * http://aws.amazon.com/apache2.0
 * 
 * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
 * and limitations under the License.
 */

package software.amazon.awssdk.services.ec2.model;

import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

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

    private static final SdkField ASN_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .memberName("Asn")
            .getter(getter(AdvertiseByoipCidrRequest::asn))
            .setter(setter(Builder::asn))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Asn").unmarshallLocationName("Asn")
                    .build()).build();

    private static final SdkField DRY_RUN_FIELD = SdkField
            . builder(MarshallingType.BOOLEAN)
            .memberName("DryRun")
            .getter(getter(AdvertiseByoipCidrRequest::dryRun))
            .setter(setter(Builder::dryRun))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DryRun")
                    .unmarshallLocationName("DryRun").build()).build();

    private static final SdkField NETWORK_BORDER_GROUP_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .memberName("NetworkBorderGroup")
            .getter(getter(AdvertiseByoipCidrRequest::networkBorderGroup))
            .setter(setter(Builder::networkBorderGroup))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NetworkBorderGroup")
                    .unmarshallLocationName("NetworkBorderGroup").build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CIDR_FIELD, ASN_FIELD,
            DRY_RUN_FIELD, NETWORK_BORDER_GROUP_FIELD));

    private static final Map> SDK_NAME_TO_FIELD = Collections
            .unmodifiableMap(new HashMap>() {
                {
                    put("Cidr", CIDR_FIELD);
                    put("Asn", ASN_FIELD);
                    put("DryRun", DRY_RUN_FIELD);
                    put("NetworkBorderGroup", NETWORK_BORDER_GROUP_FIELD);
                }
            });

    private final String cidr;

    private final String asn;

    private final Boolean dryRun;

    private final String networkBorderGroup;

    private AdvertiseByoipCidrRequest(BuilderImpl builder) {
        super(builder);
        this.cidr = builder.cidr;
        this.asn = builder.asn;
        this.dryRun = builder.dryRun;
        this.networkBorderGroup = builder.networkBorderGroup;
    }

    /**
     * 

* The address range, in CIDR notation. This must be the exact range that you provisioned. You can't advertise only * a portion of the provisioned range. *

* * @return The address range, in CIDR notation. This must be the exact range that you provisioned. You can't * advertise only a portion of the provisioned range. */ public final String cidr() { return cidr; } /** *

* The public 2-byte or 4-byte ASN that you want to advertise. *

* * @return The public 2-byte or 4-byte ASN that you want to advertise. */ public final String asn() { return asn; } /** *

* Checks whether you have the required permissions for the action, without actually making the request, and * provides an error response. If you have the required permissions, the error response is * DryRunOperation. Otherwise, it is UnauthorizedOperation. *

* * @return Checks whether you have the required permissions for the action, without actually making the request, and * provides an error response. If you have the required permissions, the error response is * DryRunOperation. Otherwise, it is UnauthorizedOperation. */ public final Boolean dryRun() { return dryRun; } /** *

* If you have Local Zones * enabled, you can choose a network border group for Local Zones when you provision and advertise a BYOIPv4 CIDR. * Choose the network border group carefully as the EIP and the Amazon Web Services resource it is associated with * must reside in the same network border group. *

*

* You can provision BYOIP address ranges to and advertise them in the following Local Zone network border groups: *

*
    *
  • *

    * us-east-1-dfw-2 *

    *
  • *
  • *

    * us-west-2-lax-1 *

    *
  • *
  • *

    * us-west-2-phx-2 *

    *
  • *
* *

* You cannot provision or advertise BYOIPv6 address ranges in Local Zones at this time. *

*
* * @return If you have Local * Zones enabled, you can choose a network border group for Local Zones when you provision and advertise * a BYOIPv4 CIDR. Choose the network border group carefully as the EIP and the Amazon Web Services resource * it is associated with must reside in the same network border group.

*

* You can provision BYOIP address ranges to and advertise them in the following Local Zone network border * groups: *

*
    *
  • *

    * us-east-1-dfw-2 *

    *
  • *
  • *

    * us-west-2-lax-1 *

    *
  • *
  • *

    * us-west-2-phx-2 *

    *
  • *
* *

* You cannot provision or advertise BYOIPv6 address ranges in Local Zones at this time. *

*/ public final String networkBorderGroup() { return networkBorderGroup; } @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(cidr()); hashCode = 31 * hashCode + Objects.hashCode(asn()); hashCode = 31 * hashCode + Objects.hashCode(dryRun()); hashCode = 31 * hashCode + Objects.hashCode(networkBorderGroup()); 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 AdvertiseByoipCidrRequest)) { return false; } AdvertiseByoipCidrRequest other = (AdvertiseByoipCidrRequest) obj; return Objects.equals(cidr(), other.cidr()) && Objects.equals(asn(), other.asn()) && Objects.equals(dryRun(), other.dryRun()) && Objects.equals(networkBorderGroup(), other.networkBorderGroup()); } /** * 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("AdvertiseByoipCidrRequest").add("Cidr", cidr()).add("Asn", asn()).add("DryRun", dryRun()) .add("NetworkBorderGroup", networkBorderGroup()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "Cidr": return Optional.ofNullable(clazz.cast(cidr())); case "Asn": return Optional.ofNullable(clazz.cast(asn())); case "DryRun": return Optional.ofNullable(clazz.cast(dryRun())); case "NetworkBorderGroup": return Optional.ofNullable(clazz.cast(networkBorderGroup())); 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((AdvertiseByoipCidrRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends Ec2Request.Builder, SdkPojo, CopyableBuilder { /** *

* The address range, in CIDR notation. This must be the exact range that you provisioned. You can't advertise * only a portion of the provisioned range. *

* * @param cidr * The address range, in CIDR notation. This must be the exact range that you provisioned. You can't * advertise only a portion of the provisioned range. * @return Returns a reference to this object so that method calls can be chained together. */ Builder cidr(String cidr); /** *

* The public 2-byte or 4-byte ASN that you want to advertise. *

* * @param asn * The public 2-byte or 4-byte ASN that you want to advertise. * @return Returns a reference to this object so that method calls can be chained together. */ Builder asn(String asn); /** *

* Checks whether you have the required permissions for the action, without actually making the request, and * provides an error response. If you have the required permissions, the error response is * DryRunOperation. Otherwise, it is UnauthorizedOperation. *

* * @param dryRun * Checks whether you have the required permissions for the action, without actually making the request, * and provides an error response. If you have the required permissions, the error response is * DryRunOperation. Otherwise, it is UnauthorizedOperation. * @return Returns a reference to this object so that method calls can be chained together. */ Builder dryRun(Boolean dryRun); /** *

* If you have Local * Zones enabled, you can choose a network border group for Local Zones when you provision and advertise a * BYOIPv4 CIDR. Choose the network border group carefully as the EIP and the Amazon Web Services resource it is * associated with must reside in the same network border group. *

*

* You can provision BYOIP address ranges to and advertise them in the following Local Zone network border * groups: *

*
    *
  • *

    * us-east-1-dfw-2 *

    *
  • *
  • *

    * us-west-2-lax-1 *

    *
  • *
  • *

    * us-west-2-phx-2 *

    *
  • *
* *

* You cannot provision or advertise BYOIPv6 address ranges in Local Zones at this time. *

*
* * @param networkBorderGroup * If you have Local Zones * enabled, you can choose a network border group for Local Zones when you provision and advertise a * BYOIPv4 CIDR. Choose the network border group carefully as the EIP and the Amazon Web Services * resource it is associated with must reside in the same network border group.

*

* You can provision BYOIP address ranges to and advertise them in the following Local Zone network * border groups: *

*
    *
  • *

    * us-east-1-dfw-2 *

    *
  • *
  • *

    * us-west-2-lax-1 *

    *
  • *
  • *

    * us-west-2-phx-2 *

    *
  • *
* *

* You cannot provision or advertise BYOIPv6 address ranges in Local Zones at this time. *

* @return Returns a reference to this object so that method calls can be chained together. */ Builder networkBorderGroup(String networkBorderGroup); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends Ec2Request.BuilderImpl implements Builder { private String cidr; private String asn; private Boolean dryRun; private String networkBorderGroup; private BuilderImpl() { } private BuilderImpl(AdvertiseByoipCidrRequest model) { super(model); cidr(model.cidr); asn(model.asn); dryRun(model.dryRun); networkBorderGroup(model.networkBorderGroup); } public final String getCidr() { return cidr; } public final void setCidr(String cidr) { this.cidr = cidr; } @Override public final Builder cidr(String cidr) { this.cidr = cidr; return this; } public final String getAsn() { return asn; } public final void setAsn(String asn) { this.asn = asn; } @Override public final Builder asn(String asn) { this.asn = asn; return this; } public final Boolean getDryRun() { return dryRun; } public final void setDryRun(Boolean dryRun) { this.dryRun = dryRun; } @Override public final Builder dryRun(Boolean dryRun) { this.dryRun = dryRun; return this; } public final 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; } @Override public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) { super.overrideConfiguration(overrideConfiguration); return this; } @Override public Builder overrideConfiguration(Consumer builderConsumer) { super.overrideConfiguration(builderConsumer); return this; } @Override public AdvertiseByoipCidrRequest build() { return new AdvertiseByoipCidrRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy