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

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

/*
 * 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 an association between a Direct Connect gateway and a virtual private gateway or transit gateway. *

*/ @Generated("software.amazon.awssdk:codegen") public final class DirectConnectGatewayAssociation implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField DIRECT_CONNECT_GATEWAY_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("directConnectGatewayId").getter(getter(DirectConnectGatewayAssociation::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(DirectConnectGatewayAssociation::directConnectGatewayOwnerAccount)) .setter(setter(Builder::directConnectGatewayOwnerAccount)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("directConnectGatewayOwnerAccount") .build()).build(); private static final SdkField ASSOCIATION_STATE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("associationState").getter(getter(DirectConnectGatewayAssociation::associationStateAsString)) .setter(setter(Builder::associationState)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("associationState").build()).build(); private static final SdkField STATE_CHANGE_ERROR_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("stateChangeError").getter(getter(DirectConnectGatewayAssociation::stateChangeError)) .setter(setter(Builder::stateChangeError)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("stateChangeError").build()).build(); private static final SdkField ASSOCIATED_GATEWAY_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("associatedGateway") .getter(getter(DirectConnectGatewayAssociation::associatedGateway)).setter(setter(Builder::associatedGateway)) .constructor(AssociatedGateway::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("associatedGateway").build()).build(); private static final SdkField ASSOCIATION_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("associationId").getter(getter(DirectConnectGatewayAssociation::associationId)) .setter(setter(Builder::associationId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("associationId").build()).build(); private static final SdkField> ALLOWED_PREFIXES_TO_DIRECT_CONNECT_GATEWAY_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("allowedPrefixesToDirectConnectGateway") .getter(getter(DirectConnectGatewayAssociation::allowedPrefixesToDirectConnectGateway)) .setter(setter(Builder::allowedPrefixesToDirectConnectGateway)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("allowedPrefixesToDirectConnectGateway").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 VIRTUAL_GATEWAY_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("virtualGatewayId").getter(getter(DirectConnectGatewayAssociation::virtualGatewayId)) .setter(setter(Builder::virtualGatewayId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("virtualGatewayId").build()).build(); private static final SdkField VIRTUAL_GATEWAY_REGION_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("virtualGatewayRegion").getter(getter(DirectConnectGatewayAssociation::virtualGatewayRegion)) .setter(setter(Builder::virtualGatewayRegion)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("virtualGatewayRegion").build()) .build(); private static final SdkField VIRTUAL_GATEWAY_OWNER_ACCOUNT_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("virtualGatewayOwnerAccount") .getter(getter(DirectConnectGatewayAssociation::virtualGatewayOwnerAccount)) .setter(setter(Builder::virtualGatewayOwnerAccount)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("virtualGatewayOwnerAccount").build()) .build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList( DIRECT_CONNECT_GATEWAY_ID_FIELD, DIRECT_CONNECT_GATEWAY_OWNER_ACCOUNT_FIELD, ASSOCIATION_STATE_FIELD, STATE_CHANGE_ERROR_FIELD, ASSOCIATED_GATEWAY_FIELD, ASSOCIATION_ID_FIELD, ALLOWED_PREFIXES_TO_DIRECT_CONNECT_GATEWAY_FIELD, VIRTUAL_GATEWAY_ID_FIELD, VIRTUAL_GATEWAY_REGION_FIELD, VIRTUAL_GATEWAY_OWNER_ACCOUNT_FIELD)); private static final long serialVersionUID = 1L; private final String directConnectGatewayId; private final String directConnectGatewayOwnerAccount; private final String associationState; private final String stateChangeError; private final AssociatedGateway associatedGateway; private final String associationId; private final List allowedPrefixesToDirectConnectGateway; private final String virtualGatewayId; private final String virtualGatewayRegion; private final String virtualGatewayOwnerAccount; private DirectConnectGatewayAssociation(BuilderImpl builder) { this.directConnectGatewayId = builder.directConnectGatewayId; this.directConnectGatewayOwnerAccount = builder.directConnectGatewayOwnerAccount; this.associationState = builder.associationState; this.stateChangeError = builder.stateChangeError; this.associatedGateway = builder.associatedGateway; this.associationId = builder.associationId; this.allowedPrefixesToDirectConnectGateway = builder.allowedPrefixesToDirectConnectGateway; this.virtualGatewayId = builder.virtualGatewayId; this.virtualGatewayRegion = builder.virtualGatewayRegion; this.virtualGatewayOwnerAccount = builder.virtualGatewayOwnerAccount; } /** *

* 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 associated gateway. *

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

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

*
    *
  • *

    * associating: The initial state after calling CreateDirectConnectGatewayAssociation. *

    *
  • *
  • *

    * associated: The Direct Connect gateway and virtual private gateway or transit gateway are * successfully associated and ready to pass traffic. *

    *
  • *
  • *

    * disassociating: The initial state after calling DeleteDirectConnectGatewayAssociation. *

    *
  • *
  • *

    * disassociated: The virtual private gateway or transit gateway is disassociated from the Direct * Connect gateway. Traffic flow between the Direct Connect gateway and virtual private gateway or transit gateway * is stopped. *

    *
  • *
  • *

    * updating: The CIDR blocks for the virtual private gateway or transit gateway are currently being * updated. This could be new CIDR blocks added or current CIDR blocks removed. *

    *
  • *
*

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

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

*
    *
  • *

    * associating: The initial state after calling CreateDirectConnectGatewayAssociation. *

    *
  • *
  • *

    * associated: The Direct Connect gateway and virtual private gateway or transit gateway are * successfully associated and ready to pass traffic. *

    *
  • *
  • *

    * disassociating: The initial state after calling * DeleteDirectConnectGatewayAssociation. *

    *
  • *
  • *

    * disassociated: The virtual private gateway or transit gateway is disassociated from the * Direct Connect gateway. Traffic flow between the Direct Connect gateway and virtual private gateway or * transit gateway is stopped. *

    *
  • *
  • *

    * updating: The CIDR blocks for the virtual private gateway or transit gateway are currently * being updated. This could be new CIDR blocks added or current CIDR blocks removed. *

    *
  • * @see DirectConnectGatewayAssociationState */ public final DirectConnectGatewayAssociationState associationState() { return DirectConnectGatewayAssociationState.fromValue(associationState); } /** *

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

    *
      *
    • *

      * associating: The initial state after calling CreateDirectConnectGatewayAssociation. *

      *
    • *
    • *

      * associated: The Direct Connect gateway and virtual private gateway or transit gateway are * successfully associated and ready to pass traffic. *

      *
    • *
    • *

      * disassociating: The initial state after calling DeleteDirectConnectGatewayAssociation. *

      *
    • *
    • *

      * disassociated: The virtual private gateway or transit gateway is disassociated from the Direct * Connect gateway. Traffic flow between the Direct Connect gateway and virtual private gateway or transit gateway * is stopped. *

      *
    • *
    • *

      * updating: The CIDR blocks for the virtual private gateway or transit gateway are currently being * updated. This could be new CIDR blocks added or current CIDR blocks removed. *

      *
    • *
    *

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

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

    *
      *
    • *

      * associating: The initial state after calling CreateDirectConnectGatewayAssociation. *

      *
    • *
    • *

      * associated: The Direct Connect gateway and virtual private gateway or transit gateway are * successfully associated and ready to pass traffic. *

      *
    • *
    • *

      * disassociating: The initial state after calling * DeleteDirectConnectGatewayAssociation. *

      *
    • *
    • *

      * disassociated: The virtual private gateway or transit gateway is disassociated from the * Direct Connect gateway. Traffic flow between the Direct Connect gateway and virtual private gateway or * transit gateway is stopped. *

      *
    • *
    • *

      * updating: The CIDR blocks for the virtual private gateway or transit gateway are currently * being updated. This could be new CIDR blocks added or current CIDR blocks removed. *

      *
    • * @see DirectConnectGatewayAssociationState */ public final String associationStateAsString() { return associationState; } /** *

      * The error message if the state of an object failed to advance. *

      * * @return The error message if the state of an object failed to advance. */ public final String stateChangeError() { return stateChangeError; } /** *

      * Information about the associated gateway. *

      * * @return Information about the associated gateway. */ public final AssociatedGateway associatedGateway() { return associatedGateway; } /** *

      * The ID of the Direct Connect gateway association. *

      * * @return The ID of the Direct Connect gateway association. */ public final String associationId() { return associationId; } /** * For responses, this returns true if the service returned a value for the AllowedPrefixesToDirectConnectGateway * 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 hasAllowedPrefixesToDirectConnectGateway() { return allowedPrefixesToDirectConnectGateway != null && !(allowedPrefixesToDirectConnectGateway 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 #hasAllowedPrefixesToDirectConnectGateway} * method. *

      * * @return The Amazon VPC prefixes to advertise to the Direct Connect gateway. */ public final List allowedPrefixesToDirectConnectGateway() { return allowedPrefixesToDirectConnectGateway; } /** *

      * The ID of the virtual private gateway. Applies only to private virtual interfaces. *

      * * @return The ID of the virtual private gateway. Applies only to private virtual interfaces. */ public final String virtualGatewayId() { return virtualGatewayId; } /** *

      * The Amazon Web Services Region where the virtual private gateway is located. *

      * * @return The Amazon Web Services Region where the virtual private gateway is located. */ public final String virtualGatewayRegion() { return virtualGatewayRegion; } /** *

      * The ID of the Amazon Web Services account that owns the virtual private gateway. *

      * * @return The ID of the Amazon Web Services account that owns the virtual private gateway. */ public final String virtualGatewayOwnerAccount() { return virtualGatewayOwnerAccount; } @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(directConnectGatewayId()); hashCode = 31 * hashCode + Objects.hashCode(directConnectGatewayOwnerAccount()); hashCode = 31 * hashCode + Objects.hashCode(associationStateAsString()); hashCode = 31 * hashCode + Objects.hashCode(stateChangeError()); hashCode = 31 * hashCode + Objects.hashCode(associatedGateway()); hashCode = 31 * hashCode + Objects.hashCode(associationId()); hashCode = 31 * hashCode + Objects.hashCode(hasAllowedPrefixesToDirectConnectGateway() ? allowedPrefixesToDirectConnectGateway() : null); hashCode = 31 * hashCode + Objects.hashCode(virtualGatewayId()); hashCode = 31 * hashCode + Objects.hashCode(virtualGatewayRegion()); hashCode = 31 * hashCode + Objects.hashCode(virtualGatewayOwnerAccount()); 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 DirectConnectGatewayAssociation)) { return false; } DirectConnectGatewayAssociation other = (DirectConnectGatewayAssociation) obj; return Objects.equals(directConnectGatewayId(), other.directConnectGatewayId()) && Objects.equals(directConnectGatewayOwnerAccount(), other.directConnectGatewayOwnerAccount()) && Objects.equals(associationStateAsString(), other.associationStateAsString()) && Objects.equals(stateChangeError(), other.stateChangeError()) && Objects.equals(associatedGateway(), other.associatedGateway()) && Objects.equals(associationId(), other.associationId()) && hasAllowedPrefixesToDirectConnectGateway() == other.hasAllowedPrefixesToDirectConnectGateway() && Objects.equals(allowedPrefixesToDirectConnectGateway(), other.allowedPrefixesToDirectConnectGateway()) && Objects.equals(virtualGatewayId(), other.virtualGatewayId()) && Objects.equals(virtualGatewayRegion(), other.virtualGatewayRegion()) && Objects.equals(virtualGatewayOwnerAccount(), other.virtualGatewayOwnerAccount()); } /** * 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("DirectConnectGatewayAssociation") .add("DirectConnectGatewayId", directConnectGatewayId()) .add("DirectConnectGatewayOwnerAccount", directConnectGatewayOwnerAccount()) .add("AssociationState", associationStateAsString()) .add("StateChangeError", stateChangeError()) .add("AssociatedGateway", associatedGateway()) .add("AssociationId", associationId()) .add("AllowedPrefixesToDirectConnectGateway", hasAllowedPrefixesToDirectConnectGateway() ? allowedPrefixesToDirectConnectGateway() : null) .add("VirtualGatewayId", virtualGatewayId()).add("VirtualGatewayRegion", virtualGatewayRegion()) .add("VirtualGatewayOwnerAccount", virtualGatewayOwnerAccount()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "directConnectGatewayId": return Optional.ofNullable(clazz.cast(directConnectGatewayId())); case "directConnectGatewayOwnerAccount": return Optional.ofNullable(clazz.cast(directConnectGatewayOwnerAccount())); case "associationState": return Optional.ofNullable(clazz.cast(associationStateAsString())); case "stateChangeError": return Optional.ofNullable(clazz.cast(stateChangeError())); case "associatedGateway": return Optional.ofNullable(clazz.cast(associatedGateway())); case "associationId": return Optional.ofNullable(clazz.cast(associationId())); case "allowedPrefixesToDirectConnectGateway": return Optional.ofNullable(clazz.cast(allowedPrefixesToDirectConnectGateway())); case "virtualGatewayId": return Optional.ofNullable(clazz.cast(virtualGatewayId())); case "virtualGatewayRegion": return Optional.ofNullable(clazz.cast(virtualGatewayRegion())); case "virtualGatewayOwnerAccount": return Optional.ofNullable(clazz.cast(virtualGatewayOwnerAccount())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((DirectConnectGatewayAssociation) 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 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 associated gateway. *

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

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

      *
        *
      • *

        * associating: The initial state after calling CreateDirectConnectGatewayAssociation. *

        *
      • *
      • *

        * associated: The Direct Connect gateway and virtual private gateway or transit gateway are * successfully associated and ready to pass traffic. *

        *
      • *
      • *

        * disassociating: The initial state after calling DeleteDirectConnectGatewayAssociation. *

        *
      • *
      • *

        * disassociated: The virtual private gateway or transit gateway is disassociated from the Direct * Connect gateway. Traffic flow between the Direct Connect gateway and virtual private gateway or transit * gateway is stopped. *

        *
      • *
      • *

        * updating: The CIDR blocks for the virtual private gateway or transit gateway are currently being * updated. This could be new CIDR blocks added or current CIDR blocks removed. *

        *
      • *
      * * @param associationState * The state of the association. The following are the possible values:

      *
        *
      • *

        * associating: The initial state after calling * CreateDirectConnectGatewayAssociation. *

        *
      • *
      • *

        * associated: The Direct Connect gateway and virtual private gateway or transit gateway are * successfully associated and ready to pass traffic. *

        *
      • *
      • *

        * disassociating: The initial state after calling * DeleteDirectConnectGatewayAssociation. *

        *
      • *
      • *

        * disassociated: The virtual private gateway or transit gateway is disassociated from the * Direct Connect gateway. Traffic flow between the Direct Connect gateway and virtual private gateway or * transit gateway is stopped. *

        *
      • *
      • *

        * updating: The CIDR blocks for the virtual private gateway or transit gateway are * currently being updated. This could be new CIDR blocks added or current CIDR blocks removed. *

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

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

        *
          *
        • *

          * associating: The initial state after calling CreateDirectConnectGatewayAssociation. *

          *
        • *
        • *

          * associated: The Direct Connect gateway and virtual private gateway or transit gateway are * successfully associated and ready to pass traffic. *

          *
        • *
        • *

          * disassociating: The initial state after calling DeleteDirectConnectGatewayAssociation. *

          *
        • *
        • *

          * disassociated: The virtual private gateway or transit gateway is disassociated from the Direct * Connect gateway. Traffic flow between the Direct Connect gateway and virtual private gateway or transit * gateway is stopped. *

          *
        • *
        • *

          * updating: The CIDR blocks for the virtual private gateway or transit gateway are currently being * updated. This could be new CIDR blocks added or current CIDR blocks removed. *

          *
        • *
        * * @param associationState * The state of the association. The following are the possible values:

        *
          *
        • *

          * associating: The initial state after calling * CreateDirectConnectGatewayAssociation. *

          *
        • *
        • *

          * associated: The Direct Connect gateway and virtual private gateway or transit gateway are * successfully associated and ready to pass traffic. *

          *
        • *
        • *

          * disassociating: The initial state after calling * DeleteDirectConnectGatewayAssociation. *

          *
        • *
        • *

          * disassociated: The virtual private gateway or transit gateway is disassociated from the * Direct Connect gateway. Traffic flow between the Direct Connect gateway and virtual private gateway or * transit gateway is stopped. *

          *
        • *
        • *

          * updating: The CIDR blocks for the virtual private gateway or transit gateway are * currently being updated. This could be new CIDR blocks added or current CIDR blocks removed. *

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

          * The error message if the state of an object failed to advance. *

          * * @param stateChangeError * The error message if the state of an object failed to advance. * @return Returns a reference to this object so that method calls can be chained together. */ Builder stateChangeError(String stateChangeError); /** *

          * 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 ID of the Direct Connect gateway association. *

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

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

          * * @param allowedPrefixesToDirectConnectGateway * 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 allowedPrefixesToDirectConnectGateway(Collection allowedPrefixesToDirectConnectGateway); /** *

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

          * * @param allowedPrefixesToDirectConnectGateway * 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 allowedPrefixesToDirectConnectGateway(RouteFilterPrefix... allowedPrefixesToDirectConnectGateway); /** *

          * 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 * #allowedPrefixesToDirectConnectGateway(List)}. * * @param allowedPrefixesToDirectConnectGateway * 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 #allowedPrefixesToDirectConnectGateway(java.util.Collection) */ Builder allowedPrefixesToDirectConnectGateway( Consumer... allowedPrefixesToDirectConnectGateway); /** *

          * The ID of the virtual private gateway. Applies only to private virtual interfaces. *

          * * @param virtualGatewayId * The ID of the virtual private gateway. Applies only to private virtual interfaces. * @return Returns a reference to this object so that method calls can be chained together. */ Builder virtualGatewayId(String virtualGatewayId); /** *

          * The Amazon Web Services Region where the virtual private gateway is located. *

          * * @param virtualGatewayRegion * The Amazon Web Services Region where the virtual private gateway is located. * @return Returns a reference to this object so that method calls can be chained together. */ Builder virtualGatewayRegion(String virtualGatewayRegion); /** *

          * The ID of the Amazon Web Services account that owns the virtual private gateway. *

          * * @param virtualGatewayOwnerAccount * The ID of the Amazon Web Services account that owns the virtual private gateway. * @return Returns a reference to this object so that method calls can be chained together. */ Builder virtualGatewayOwnerAccount(String virtualGatewayOwnerAccount); } static final class BuilderImpl implements Builder { private String directConnectGatewayId; private String directConnectGatewayOwnerAccount; private String associationState; private String stateChangeError; private AssociatedGateway associatedGateway; private String associationId; private List allowedPrefixesToDirectConnectGateway = DefaultSdkAutoConstructList.getInstance(); private String virtualGatewayId; private String virtualGatewayRegion; private String virtualGatewayOwnerAccount; private BuilderImpl() { } private BuilderImpl(DirectConnectGatewayAssociation model) { directConnectGatewayId(model.directConnectGatewayId); directConnectGatewayOwnerAccount(model.directConnectGatewayOwnerAccount); associationState(model.associationState); stateChangeError(model.stateChangeError); associatedGateway(model.associatedGateway); associationId(model.associationId); allowedPrefixesToDirectConnectGateway(model.allowedPrefixesToDirectConnectGateway); virtualGatewayId(model.virtualGatewayId); virtualGatewayRegion(model.virtualGatewayRegion); virtualGatewayOwnerAccount(model.virtualGatewayOwnerAccount); } 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 getAssociationState() { return associationState; } public final void setAssociationState(String associationState) { this.associationState = associationState; } @Override public final Builder associationState(String associationState) { this.associationState = associationState; return this; } @Override public final Builder associationState(DirectConnectGatewayAssociationState associationState) { this.associationState(associationState == null ? null : associationState.toString()); return this; } public final String getStateChangeError() { return stateChangeError; } public final void setStateChangeError(String stateChangeError) { this.stateChangeError = stateChangeError; } @Override public final Builder stateChangeError(String stateChangeError) { this.stateChangeError = stateChangeError; 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 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 List getAllowedPrefixesToDirectConnectGateway() { List result = RouteFilterPrefixListCopier .copyToBuilder(this.allowedPrefixesToDirectConnectGateway); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setAllowedPrefixesToDirectConnectGateway( Collection allowedPrefixesToDirectConnectGateway) { this.allowedPrefixesToDirectConnectGateway = RouteFilterPrefixListCopier .copyFromBuilder(allowedPrefixesToDirectConnectGateway); } @Override public final Builder allowedPrefixesToDirectConnectGateway( Collection allowedPrefixesToDirectConnectGateway) { this.allowedPrefixesToDirectConnectGateway = RouteFilterPrefixListCopier.copy(allowedPrefixesToDirectConnectGateway); return this; } @Override @SafeVarargs public final Builder allowedPrefixesToDirectConnectGateway(RouteFilterPrefix... allowedPrefixesToDirectConnectGateway) { allowedPrefixesToDirectConnectGateway(Arrays.asList(allowedPrefixesToDirectConnectGateway)); return this; } @Override @SafeVarargs public final Builder allowedPrefixesToDirectConnectGateway( Consumer... allowedPrefixesToDirectConnectGateway) { allowedPrefixesToDirectConnectGateway(Stream.of(allowedPrefixesToDirectConnectGateway) .map(c -> RouteFilterPrefix.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } public final String getVirtualGatewayId() { return virtualGatewayId; } public final void setVirtualGatewayId(String virtualGatewayId) { this.virtualGatewayId = virtualGatewayId; } @Override public final Builder virtualGatewayId(String virtualGatewayId) { this.virtualGatewayId = virtualGatewayId; return this; } public final String getVirtualGatewayRegion() { return virtualGatewayRegion; } public final void setVirtualGatewayRegion(String virtualGatewayRegion) { this.virtualGatewayRegion = virtualGatewayRegion; } @Override public final Builder virtualGatewayRegion(String virtualGatewayRegion) { this.virtualGatewayRegion = virtualGatewayRegion; return this; } public final String getVirtualGatewayOwnerAccount() { return virtualGatewayOwnerAccount; } public final void setVirtualGatewayOwnerAccount(String virtualGatewayOwnerAccount) { this.virtualGatewayOwnerAccount = virtualGatewayOwnerAccount; } @Override public final Builder virtualGatewayOwnerAccount(String virtualGatewayOwnerAccount) { this.virtualGatewayOwnerAccount = virtualGatewayOwnerAccount; return this; } @Override public DirectConnectGatewayAssociation build() { return new DirectConnectGatewayAssociation(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy