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

software.amazon.awssdk.services.directconnect.model.DirectConnectGatewayAssociationProposal Maven / Gradle / Ivy

Go to download

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

There is a newer version: 2.30.1
Show 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.directconnect.model;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Information about the proposal request to attach a virtual private gateway to a Direct Connect gateway. *

*/ @Generated("software.amazon.awssdk:codegen") public final class DirectConnectGatewayAssociationProposal implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField PROPOSAL_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("proposalId").getter(getter(DirectConnectGatewayAssociationProposal::proposalId)) .setter(setter(Builder::proposalId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("proposalId").build()).build(); private static final SdkField DIRECT_CONNECT_GATEWAY_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("directConnectGatewayId").getter(getter(DirectConnectGatewayAssociationProposal::directConnectGatewayId)) .setter(setter(Builder::directConnectGatewayId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("directConnectGatewayId").build()) .build(); private static final SdkField DIRECT_CONNECT_GATEWAY_OWNER_ACCOUNT_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("directConnectGatewayOwnerAccount") .getter(getter(DirectConnectGatewayAssociationProposal::directConnectGatewayOwnerAccount)) .setter(setter(Builder::directConnectGatewayOwnerAccount)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("directConnectGatewayOwnerAccount") .build()).build(); private static final SdkField PROPOSAL_STATE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("proposalState").getter(getter(DirectConnectGatewayAssociationProposal::proposalStateAsString)) .setter(setter(Builder::proposalState)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("proposalState").build()).build(); private static final SdkField ASSOCIATED_GATEWAY_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("associatedGateway") .getter(getter(DirectConnectGatewayAssociationProposal::associatedGateway)) .setter(setter(Builder::associatedGateway)).constructor(AssociatedGateway::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("associatedGateway").build()).build(); private static final SdkField> EXISTING_ALLOWED_PREFIXES_TO_DIRECT_CONNECT_GATEWAY_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("existingAllowedPrefixesToDirectConnectGateway") .getter(getter(DirectConnectGatewayAssociationProposal::existingAllowedPrefixesToDirectConnectGateway)) .setter(setter(Builder::existingAllowedPrefixesToDirectConnectGateway)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("existingAllowedPrefixesToDirectConnectGateway").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(RouteFilterPrefix::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField> REQUESTED_ALLOWED_PREFIXES_TO_DIRECT_CONNECT_GATEWAY_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("requestedAllowedPrefixesToDirectConnectGateway") .getter(getter(DirectConnectGatewayAssociationProposal::requestedAllowedPrefixesToDirectConnectGateway)) .setter(setter(Builder::requestedAllowedPrefixesToDirectConnectGateway)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("requestedAllowedPrefixesToDirectConnectGateway").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(RouteFilterPrefix::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(PROPOSAL_ID_FIELD, DIRECT_CONNECT_GATEWAY_ID_FIELD, DIRECT_CONNECT_GATEWAY_OWNER_ACCOUNT_FIELD, PROPOSAL_STATE_FIELD, ASSOCIATED_GATEWAY_FIELD, EXISTING_ALLOWED_PREFIXES_TO_DIRECT_CONNECT_GATEWAY_FIELD, REQUESTED_ALLOWED_PREFIXES_TO_DIRECT_CONNECT_GATEWAY_FIELD)); private static final long serialVersionUID = 1L; private final String proposalId; private final String directConnectGatewayId; private final String directConnectGatewayOwnerAccount; private final String proposalState; private final AssociatedGateway associatedGateway; private final List existingAllowedPrefixesToDirectConnectGateway; private final List requestedAllowedPrefixesToDirectConnectGateway; private DirectConnectGatewayAssociationProposal(BuilderImpl builder) { this.proposalId = builder.proposalId; this.directConnectGatewayId = builder.directConnectGatewayId; this.directConnectGatewayOwnerAccount = builder.directConnectGatewayOwnerAccount; this.proposalState = builder.proposalState; this.associatedGateway = builder.associatedGateway; this.existingAllowedPrefixesToDirectConnectGateway = builder.existingAllowedPrefixesToDirectConnectGateway; this.requestedAllowedPrefixesToDirectConnectGateway = builder.requestedAllowedPrefixesToDirectConnectGateway; } /** *

* The ID of the association proposal. *

* * @return The ID of the association proposal. */ public final String proposalId() { return proposalId; } /** *

* The ID of the Direct Connect gateway. *

* * @return The ID of the Direct Connect gateway. */ public final String directConnectGatewayId() { return directConnectGatewayId; } /** *

* The ID of the Amazon Web Services account that owns the Direct Connect gateway. *

* * @return The ID of the Amazon Web Services account that owns the Direct Connect gateway. */ public final String directConnectGatewayOwnerAccount() { return directConnectGatewayOwnerAccount; } /** *

* The state of the proposal. The following are possible values: *

*
    *
  • *

    * accepted: The proposal has been accepted. The Direct Connect gateway association is available to use * in this state. *

    *
  • *
  • *

    * deleted: The proposal has been deleted by the owner that made the proposal. The Direct Connect * gateway association cannot be used in this state. *

    *
  • *
  • *

    * requested: The proposal has been requested. The Direct Connect gateway association cannot be used in * this state. *

    *
  • *
*

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

* * @return The state of the proposal. The following are possible values:

*
    *
  • *

    * accepted: The proposal has been accepted. The Direct Connect gateway association is * available to use in this state. *

    *
  • *
  • *

    * deleted: The proposal has been deleted by the owner that made the proposal. The Direct * Connect gateway association cannot be used in this state. *

    *
  • *
  • *

    * requested: The proposal has been requested. The Direct Connect gateway association cannot be * used in this state. *

    *
  • * @see DirectConnectGatewayAssociationProposalState */ public final DirectConnectGatewayAssociationProposalState proposalState() { return DirectConnectGatewayAssociationProposalState.fromValue(proposalState); } /** *

    * The state of the proposal. The following are possible values: *

    *
      *
    • *

      * accepted: The proposal has been accepted. The Direct Connect gateway association is available to use * in this state. *

      *
    • *
    • *

      * deleted: The proposal has been deleted by the owner that made the proposal. The Direct Connect * gateway association cannot be used in this state. *

      *
    • *
    • *

      * requested: The proposal has been requested. The Direct Connect gateway association cannot be used in * this state. *

      *
    • *
    *

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

    * * @return The state of the proposal. The following are possible values:

    *
      *
    • *

      * accepted: The proposal has been accepted. The Direct Connect gateway association is * available to use in this state. *

      *
    • *
    • *

      * deleted: The proposal has been deleted by the owner that made the proposal. The Direct * Connect gateway association cannot be used in this state. *

      *
    • *
    • *

      * requested: The proposal has been requested. The Direct Connect gateway association cannot be * used in this state. *

      *
    • * @see DirectConnectGatewayAssociationProposalState */ public final String proposalStateAsString() { return proposalState; } /** *

      * Information about the associated gateway. *

      * * @return Information about the associated gateway. */ public final AssociatedGateway associatedGateway() { return associatedGateway; } /** * For responses, this returns true if the service returned a value for the * ExistingAllowedPrefixesToDirectConnectGateway 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 hasExistingAllowedPrefixesToDirectConnectGateway() { return existingAllowedPrefixesToDirectConnectGateway != null && !(existingAllowedPrefixesToDirectConnectGateway instanceof SdkAutoConstructList); } /** *

      * The existing Amazon VPC prefixes advertised to the Direct Connect gateway. *

      *

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

      *

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

      * * @return The existing Amazon VPC prefixes advertised to the Direct Connect gateway. */ public final List existingAllowedPrefixesToDirectConnectGateway() { return existingAllowedPrefixesToDirectConnectGateway; } /** * For responses, this returns true if the service returned a value for the * RequestedAllowedPrefixesToDirectConnectGateway 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 hasRequestedAllowedPrefixesToDirectConnectGateway() { return requestedAllowedPrefixesToDirectConnectGateway != null && !(requestedAllowedPrefixesToDirectConnectGateway instanceof SdkAutoConstructList); } /** *

      * The Amazon VPC prefixes to advertise to the Direct Connect gateway. *

      *

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

      *

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

      * * @return The Amazon VPC prefixes to advertise to the Direct Connect gateway. */ public final List requestedAllowedPrefixesToDirectConnectGateway() { return requestedAllowedPrefixesToDirectConnectGateway; } @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(proposalId()); hashCode = 31 * hashCode + Objects.hashCode(directConnectGatewayId()); hashCode = 31 * hashCode + Objects.hashCode(directConnectGatewayOwnerAccount()); hashCode = 31 * hashCode + Objects.hashCode(proposalStateAsString()); hashCode = 31 * hashCode + Objects.hashCode(associatedGateway()); hashCode = 31 * hashCode + Objects .hashCode(hasExistingAllowedPrefixesToDirectConnectGateway() ? existingAllowedPrefixesToDirectConnectGateway() : null); hashCode = 31 * hashCode + Objects .hashCode(hasRequestedAllowedPrefixesToDirectConnectGateway() ? requestedAllowedPrefixesToDirectConnectGateway() : null); 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 DirectConnectGatewayAssociationProposal)) { return false; } DirectConnectGatewayAssociationProposal other = (DirectConnectGatewayAssociationProposal) obj; return Objects.equals(proposalId(), other.proposalId()) && Objects.equals(directConnectGatewayId(), other.directConnectGatewayId()) && Objects.equals(directConnectGatewayOwnerAccount(), other.directConnectGatewayOwnerAccount()) && Objects.equals(proposalStateAsString(), other.proposalStateAsString()) && Objects.equals(associatedGateway(), other.associatedGateway()) && hasExistingAllowedPrefixesToDirectConnectGateway() == other.hasExistingAllowedPrefixesToDirectConnectGateway() && Objects.equals(existingAllowedPrefixesToDirectConnectGateway(), other.existingAllowedPrefixesToDirectConnectGateway()) && hasRequestedAllowedPrefixesToDirectConnectGateway() == other .hasRequestedAllowedPrefixesToDirectConnectGateway() && Objects.equals(requestedAllowedPrefixesToDirectConnectGateway(), other.requestedAllowedPrefixesToDirectConnectGateway()); } /** * 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("DirectConnectGatewayAssociationProposal") .add("ProposalId", proposalId()) .add("DirectConnectGatewayId", directConnectGatewayId()) .add("DirectConnectGatewayOwnerAccount", directConnectGatewayOwnerAccount()) .add("ProposalState", proposalStateAsString()) .add("AssociatedGateway", associatedGateway()) .add("ExistingAllowedPrefixesToDirectConnectGateway", hasExistingAllowedPrefixesToDirectConnectGateway() ? existingAllowedPrefixesToDirectConnectGateway() : null) .add("RequestedAllowedPrefixesToDirectConnectGateway", hasRequestedAllowedPrefixesToDirectConnectGateway() ? requestedAllowedPrefixesToDirectConnectGateway() : null).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "proposalId": return Optional.ofNullable(clazz.cast(proposalId())); case "directConnectGatewayId": return Optional.ofNullable(clazz.cast(directConnectGatewayId())); case "directConnectGatewayOwnerAccount": return Optional.ofNullable(clazz.cast(directConnectGatewayOwnerAccount())); case "proposalState": return Optional.ofNullable(clazz.cast(proposalStateAsString())); case "associatedGateway": return Optional.ofNullable(clazz.cast(associatedGateway())); case "existingAllowedPrefixesToDirectConnectGateway": return Optional.ofNullable(clazz.cast(existingAllowedPrefixesToDirectConnectGateway())); case "requestedAllowedPrefixesToDirectConnectGateway": return Optional.ofNullable(clazz.cast(requestedAllowedPrefixesToDirectConnectGateway())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((DirectConnectGatewayAssociationProposal) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

      * The ID of the association proposal. *

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

      * The ID of the Direct Connect gateway. *

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

      * The ID of the Amazon Web Services account that owns the Direct Connect gateway. *

      * * @param directConnectGatewayOwnerAccount * The ID of the Amazon Web Services account that owns the Direct Connect gateway. * @return Returns a reference to this object so that method calls can be chained together. */ Builder directConnectGatewayOwnerAccount(String directConnectGatewayOwnerAccount); /** *

      * The state of the proposal. The following are possible values: *

      *
        *
      • *

        * accepted: The proposal has been accepted. The Direct Connect gateway association is available to * use in this state. *

        *
      • *
      • *

        * deleted: The proposal has been deleted by the owner that made the proposal. The Direct Connect * gateway association cannot be used in this state. *

        *
      • *
      • *

        * requested: The proposal has been requested. The Direct Connect gateway association cannot be * used in this state. *

        *
      • *
      * * @param proposalState * The state of the proposal. The following are possible values:

      *
        *
      • *

        * accepted: The proposal has been accepted. The Direct Connect gateway association is * available to use in this state. *

        *
      • *
      • *

        * deleted: The proposal has been deleted by the owner that made the proposal. The Direct * Connect gateway association cannot be used in this state. *

        *
      • *
      • *

        * requested: The proposal has been requested. The Direct Connect gateway association cannot * be used in this state. *

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

        * The state of the proposal. The following are possible values: *

        *
          *
        • *

          * accepted: The proposal has been accepted. The Direct Connect gateway association is available to * use in this state. *

          *
        • *
        • *

          * deleted: The proposal has been deleted by the owner that made the proposal. The Direct Connect * gateway association cannot be used in this state. *

          *
        • *
        • *

          * requested: The proposal has been requested. The Direct Connect gateway association cannot be * used in this state. *

          *
        • *
        * * @param proposalState * The state of the proposal. The following are possible values:

        *
          *
        • *

          * accepted: The proposal has been accepted. The Direct Connect gateway association is * available to use in this state. *

          *
        • *
        • *

          * deleted: The proposal has been deleted by the owner that made the proposal. The Direct * Connect gateway association cannot be used in this state. *

          *
        • *
        • *

          * requested: The proposal has been requested. The Direct Connect gateway association cannot * be used in this state. *

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

          * Information about the associated gateway. *

          * * @param associatedGateway * Information about the associated gateway. * @return Returns a reference to this object so that method calls can be chained together. */ Builder associatedGateway(AssociatedGateway associatedGateway); /** *

          * Information about the associated gateway. *

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

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

          * The existing Amazon VPC prefixes advertised to the Direct Connect gateway. *

          * * @param existingAllowedPrefixesToDirectConnectGateway * The existing Amazon VPC prefixes advertised to the Direct Connect gateway. * @return Returns a reference to this object so that method calls can be chained together. */ Builder existingAllowedPrefixesToDirectConnectGateway( Collection existingAllowedPrefixesToDirectConnectGateway); /** *

          * The existing Amazon VPC prefixes advertised to the Direct Connect gateway. *

          * * @param existingAllowedPrefixesToDirectConnectGateway * The existing Amazon VPC prefixes advertised to the Direct Connect gateway. * @return Returns a reference to this object so that method calls can be chained together. */ Builder existingAllowedPrefixesToDirectConnectGateway(RouteFilterPrefix... existingAllowedPrefixesToDirectConnectGateway); /** *

          * The existing Amazon VPC prefixes advertised to the Direct Connect gateway. *

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

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

          * The Amazon VPC prefixes to advertise to the Direct Connect gateway. *

          * * @param requestedAllowedPrefixesToDirectConnectGateway * The Amazon VPC prefixes to advertise to the Direct Connect gateway. * @return Returns a reference to this object so that method calls can be chained together. */ Builder requestedAllowedPrefixesToDirectConnectGateway( Collection requestedAllowedPrefixesToDirectConnectGateway); /** *

          * The Amazon VPC prefixes to advertise to the Direct Connect gateway. *

          * * @param requestedAllowedPrefixesToDirectConnectGateway * The Amazon VPC prefixes to advertise to the Direct Connect gateway. * @return Returns a reference to this object so that method calls can be chained together. */ Builder requestedAllowedPrefixesToDirectConnectGateway( RouteFilterPrefix... requestedAllowedPrefixesToDirectConnectGateway); /** *

          * The Amazon VPC prefixes to advertise to the Direct Connect gateway. *

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

          * When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.directconnect.model.RouteFilterPrefix.Builder#build()} is called * immediately and its result is passed to {@link * #requestedAllowedPrefixesToDirectConnectGateway(List)}. * * @param requestedAllowedPrefixesToDirectConnectGateway * a consumer that will call methods on * {@link software.amazon.awssdk.services.directconnect.model.RouteFilterPrefix.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #requestedAllowedPrefixesToDirectConnectGateway(java.util.Collection) */ Builder requestedAllowedPrefixesToDirectConnectGateway( Consumer... requestedAllowedPrefixesToDirectConnectGateway); } static final class BuilderImpl implements Builder { private String proposalId; private String directConnectGatewayId; private String directConnectGatewayOwnerAccount; private String proposalState; private AssociatedGateway associatedGateway; private List existingAllowedPrefixesToDirectConnectGateway = DefaultSdkAutoConstructList.getInstance(); private List requestedAllowedPrefixesToDirectConnectGateway = DefaultSdkAutoConstructList .getInstance(); private BuilderImpl() { } private BuilderImpl(DirectConnectGatewayAssociationProposal model) { proposalId(model.proposalId); directConnectGatewayId(model.directConnectGatewayId); directConnectGatewayOwnerAccount(model.directConnectGatewayOwnerAccount); proposalState(model.proposalState); associatedGateway(model.associatedGateway); existingAllowedPrefixesToDirectConnectGateway(model.existingAllowedPrefixesToDirectConnectGateway); requestedAllowedPrefixesToDirectConnectGateway(model.requestedAllowedPrefixesToDirectConnectGateway); } public final String getProposalId() { return proposalId; } public final void setProposalId(String proposalId) { this.proposalId = proposalId; } @Override public final Builder proposalId(String proposalId) { this.proposalId = proposalId; return this; } public final String getDirectConnectGatewayId() { return directConnectGatewayId; } public final void setDirectConnectGatewayId(String directConnectGatewayId) { this.directConnectGatewayId = directConnectGatewayId; } @Override public final Builder directConnectGatewayId(String directConnectGatewayId) { this.directConnectGatewayId = directConnectGatewayId; return this; } public final String getDirectConnectGatewayOwnerAccount() { return directConnectGatewayOwnerAccount; } public final void setDirectConnectGatewayOwnerAccount(String directConnectGatewayOwnerAccount) { this.directConnectGatewayOwnerAccount = directConnectGatewayOwnerAccount; } @Override public final Builder directConnectGatewayOwnerAccount(String directConnectGatewayOwnerAccount) { this.directConnectGatewayOwnerAccount = directConnectGatewayOwnerAccount; return this; } public final String getProposalState() { return proposalState; } public final void setProposalState(String proposalState) { this.proposalState = proposalState; } @Override public final Builder proposalState(String proposalState) { this.proposalState = proposalState; return this; } @Override public final Builder proposalState(DirectConnectGatewayAssociationProposalState proposalState) { this.proposalState(proposalState == null ? null : proposalState.toString()); return this; } public final AssociatedGateway.Builder getAssociatedGateway() { return associatedGateway != null ? associatedGateway.toBuilder() : null; } public final void setAssociatedGateway(AssociatedGateway.BuilderImpl associatedGateway) { this.associatedGateway = associatedGateway != null ? associatedGateway.build() : null; } @Override public final Builder associatedGateway(AssociatedGateway associatedGateway) { this.associatedGateway = associatedGateway; return this; } public final List getExistingAllowedPrefixesToDirectConnectGateway() { List result = RouteFilterPrefixListCopier .copyToBuilder(this.existingAllowedPrefixesToDirectConnectGateway); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setExistingAllowedPrefixesToDirectConnectGateway( Collection existingAllowedPrefixesToDirectConnectGateway) { this.existingAllowedPrefixesToDirectConnectGateway = RouteFilterPrefixListCopier .copyFromBuilder(existingAllowedPrefixesToDirectConnectGateway); } @Override public final Builder existingAllowedPrefixesToDirectConnectGateway( Collection existingAllowedPrefixesToDirectConnectGateway) { this.existingAllowedPrefixesToDirectConnectGateway = RouteFilterPrefixListCopier .copy(existingAllowedPrefixesToDirectConnectGateway); return this; } @Override @SafeVarargs public final Builder existingAllowedPrefixesToDirectConnectGateway( RouteFilterPrefix... existingAllowedPrefixesToDirectConnectGateway) { existingAllowedPrefixesToDirectConnectGateway(Arrays.asList(existingAllowedPrefixesToDirectConnectGateway)); return this; } @Override @SafeVarargs public final Builder existingAllowedPrefixesToDirectConnectGateway( Consumer... existingAllowedPrefixesToDirectConnectGateway) { existingAllowedPrefixesToDirectConnectGateway(Stream.of(existingAllowedPrefixesToDirectConnectGateway) .map(c -> RouteFilterPrefix.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } public final List getRequestedAllowedPrefixesToDirectConnectGateway() { List result = RouteFilterPrefixListCopier .copyToBuilder(this.requestedAllowedPrefixesToDirectConnectGateway); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setRequestedAllowedPrefixesToDirectConnectGateway( Collection requestedAllowedPrefixesToDirectConnectGateway) { this.requestedAllowedPrefixesToDirectConnectGateway = RouteFilterPrefixListCopier .copyFromBuilder(requestedAllowedPrefixesToDirectConnectGateway); } @Override public final Builder requestedAllowedPrefixesToDirectConnectGateway( Collection requestedAllowedPrefixesToDirectConnectGateway) { this.requestedAllowedPrefixesToDirectConnectGateway = RouteFilterPrefixListCopier .copy(requestedAllowedPrefixesToDirectConnectGateway); return this; } @Override @SafeVarargs public final Builder requestedAllowedPrefixesToDirectConnectGateway( RouteFilterPrefix... requestedAllowedPrefixesToDirectConnectGateway) { requestedAllowedPrefixesToDirectConnectGateway(Arrays.asList(requestedAllowedPrefixesToDirectConnectGateway)); return this; } @Override @SafeVarargs public final Builder requestedAllowedPrefixesToDirectConnectGateway( Consumer... requestedAllowedPrefixesToDirectConnectGateway) { requestedAllowedPrefixesToDirectConnectGateway(Stream.of(requestedAllowedPrefixesToDirectConnectGateway) .map(c -> RouteFilterPrefix.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } @Override public DirectConnectGatewayAssociationProposal build() { return new DirectConnectGatewayAssociationProposal(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy