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

software.amazon.awssdk.services.globalaccelerator.model.CreateEndpointGroupRequest Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Global Accelerator module holds the client classes that are used for communicating with Global Accelerator.

There is a newer version: 2.29.39
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.globalaccelerator.model;

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.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.DefaultValueTrait;
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 CreateEndpointGroupRequest extends GlobalAcceleratorRequest implements
        ToCopyableBuilder {
    private static final SdkField LISTENER_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("ListenerArn").getter(getter(CreateEndpointGroupRequest::listenerArn))
            .setter(setter(Builder::listenerArn))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListenerArn").build()).build();

    private static final SdkField ENDPOINT_GROUP_REGION_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("EndpointGroupRegion").getter(getter(CreateEndpointGroupRequest::endpointGroupRegion))
            .setter(setter(Builder::endpointGroupRegion))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EndpointGroupRegion").build())
            .build();

    private static final SdkField> ENDPOINT_CONFIGURATIONS_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("EndpointConfigurations")
            .getter(getter(CreateEndpointGroupRequest::endpointConfigurations))
            .setter(setter(Builder::endpointConfigurations))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EndpointConfigurations").build(),
                    ListTrait
                            .builder()
                            .memberLocationName(null)
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.SDK_POJO)
                                            .constructor(EndpointConfiguration::builder)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("member").build()).build()).build()).build();

    private static final SdkField TRAFFIC_DIAL_PERCENTAGE_FIELD = SdkField. builder(MarshallingType.FLOAT)
            .memberName("TrafficDialPercentage").getter(getter(CreateEndpointGroupRequest::trafficDialPercentage))
            .setter(setter(Builder::trafficDialPercentage))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TrafficDialPercentage").build())
            .build();

    private static final SdkField HEALTH_CHECK_PORT_FIELD = SdkField. builder(MarshallingType.INTEGER)
            .memberName("HealthCheckPort").getter(getter(CreateEndpointGroupRequest::healthCheckPort))
            .setter(setter(Builder::healthCheckPort))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("HealthCheckPort").build()).build();

    private static final SdkField HEALTH_CHECK_PROTOCOL_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("HealthCheckProtocol").getter(getter(CreateEndpointGroupRequest::healthCheckProtocolAsString))
            .setter(setter(Builder::healthCheckProtocol))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("HealthCheckProtocol").build())
            .build();

    private static final SdkField HEALTH_CHECK_PATH_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("HealthCheckPath").getter(getter(CreateEndpointGroupRequest::healthCheckPath))
            .setter(setter(Builder::healthCheckPath))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("HealthCheckPath").build()).build();

    private static final SdkField HEALTH_CHECK_INTERVAL_SECONDS_FIELD = SdkField
            . builder(MarshallingType.INTEGER)
            .memberName("HealthCheckIntervalSeconds")
            .getter(getter(CreateEndpointGroupRequest::healthCheckIntervalSeconds))
            .setter(setter(Builder::healthCheckIntervalSeconds))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("HealthCheckIntervalSeconds").build())
            .build();

    private static final SdkField THRESHOLD_COUNT_FIELD = SdkField. builder(MarshallingType.INTEGER)
            .memberName("ThresholdCount").getter(getter(CreateEndpointGroupRequest::thresholdCount))
            .setter(setter(Builder::thresholdCount))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ThresholdCount").build()).build();

    private static final SdkField IDEMPOTENCY_TOKEN_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .memberName("IdempotencyToken")
            .getter(getter(CreateEndpointGroupRequest::idempotencyToken))
            .setter(setter(Builder::idempotencyToken))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IdempotencyToken").build(),
                    DefaultValueTrait.idempotencyToken()).build();

    private static final SdkField> PORT_OVERRIDES_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("PortOverrides")
            .getter(getter(CreateEndpointGroupRequest::portOverrides))
            .setter(setter(Builder::portOverrides))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PortOverrides").build(),
                    ListTrait
                            .builder()
                            .memberLocationName(null)
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.SDK_POJO)
                                            .constructor(PortOverride::builder)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("member").build()).build()).build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(LISTENER_ARN_FIELD,
            ENDPOINT_GROUP_REGION_FIELD, ENDPOINT_CONFIGURATIONS_FIELD, TRAFFIC_DIAL_PERCENTAGE_FIELD, HEALTH_CHECK_PORT_FIELD,
            HEALTH_CHECK_PROTOCOL_FIELD, HEALTH_CHECK_PATH_FIELD, HEALTH_CHECK_INTERVAL_SECONDS_FIELD, THRESHOLD_COUNT_FIELD,
            IDEMPOTENCY_TOKEN_FIELD, PORT_OVERRIDES_FIELD));

    private final String listenerArn;

    private final String endpointGroupRegion;

    private final List endpointConfigurations;

    private final Float trafficDialPercentage;

    private final Integer healthCheckPort;

    private final String healthCheckProtocol;

    private final String healthCheckPath;

    private final Integer healthCheckIntervalSeconds;

    private final Integer thresholdCount;

    private final String idempotencyToken;

    private final List portOverrides;

    private CreateEndpointGroupRequest(BuilderImpl builder) {
        super(builder);
        this.listenerArn = builder.listenerArn;
        this.endpointGroupRegion = builder.endpointGroupRegion;
        this.endpointConfigurations = builder.endpointConfigurations;
        this.trafficDialPercentage = builder.trafficDialPercentage;
        this.healthCheckPort = builder.healthCheckPort;
        this.healthCheckProtocol = builder.healthCheckProtocol;
        this.healthCheckPath = builder.healthCheckPath;
        this.healthCheckIntervalSeconds = builder.healthCheckIntervalSeconds;
        this.thresholdCount = builder.thresholdCount;
        this.idempotencyToken = builder.idempotencyToken;
        this.portOverrides = builder.portOverrides;
    }

    /**
     * 

* The Amazon Resource Name (ARN) of the listener. *

* * @return The Amazon Resource Name (ARN) of the listener. */ public final String listenerArn() { return listenerArn; } /** *

* The AWS Region where the endpoint group is located. A listener can have only one endpoint group in a specific * Region. *

* * @return The AWS Region where the endpoint group is located. A listener can have only one endpoint group in a * specific Region. */ public final String endpointGroupRegion() { return endpointGroupRegion; } /** * Returns true if the EndpointConfigurations property was specified by the sender (it may be empty), or false if * the sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS * service. */ public final boolean hasEndpointConfigurations() { return endpointConfigurations != null && !(endpointConfigurations instanceof SdkAutoConstructList); } /** *

* The list of endpoint objects. *

*

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

*

* You can use {@link #hasEndpointConfigurations()} to see if a value was sent in this field. *

* * @return The list of endpoint objects. */ public final List endpointConfigurations() { return endpointConfigurations; } /** *

* The percentage of traffic to send to an AWS Region. Additional traffic is distributed to other endpoint groups * for this listener. *

*

* Use this action to increase (dial up) or decrease (dial down) traffic to a specific Region. The percentage is * applied to the traffic that would otherwise have been routed to the Region based on optimal routing. *

*

* The default value is 100. *

* * @return The percentage of traffic to send to an AWS Region. Additional traffic is distributed to other endpoint * groups for this listener.

*

* Use this action to increase (dial up) or decrease (dial down) traffic to a specific Region. The * percentage is applied to the traffic that would otherwise have been routed to the Region based on optimal * routing. *

*

* The default value is 100. */ public final Float trafficDialPercentage() { return trafficDialPercentage; } /** *

* The port that AWS Global Accelerator uses to check the health of endpoints that are part of this endpoint group. * The default port is the listener port that this endpoint group is associated with. If listener port is a list of * ports, Global Accelerator uses the first port in the list. *

* * @return The port that AWS Global Accelerator uses to check the health of endpoints that are part of this endpoint * group. The default port is the listener port that this endpoint group is associated with. If listener * port is a list of ports, Global Accelerator uses the first port in the list. */ public final Integer healthCheckPort() { return healthCheckPort; } /** *

* The protocol that AWS Global Accelerator uses to check the health of endpoints that are part of this endpoint * group. The default value is TCP. *

*

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

* * @return The protocol that AWS Global Accelerator uses to check the health of endpoints that are part of this * endpoint group. The default value is TCP. * @see HealthCheckProtocol */ public final HealthCheckProtocol healthCheckProtocol() { return HealthCheckProtocol.fromValue(healthCheckProtocol); } /** *

* The protocol that AWS Global Accelerator uses to check the health of endpoints that are part of this endpoint * group. The default value is TCP. *

*

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

* * @return The protocol that AWS Global Accelerator uses to check the health of endpoints that are part of this * endpoint group. The default value is TCP. * @see HealthCheckProtocol */ public final String healthCheckProtocolAsString() { return healthCheckProtocol; } /** *

* If the protocol is HTTP/S, then this specifies the path that is the destination for health check targets. The * default value is slash (/). *

* * @return If the protocol is HTTP/S, then this specifies the path that is the destination for health check targets. * The default value is slash (/). */ public final String healthCheckPath() { return healthCheckPath; } /** *

* The time—10 seconds or 30 seconds—between each health check for an endpoint. The default value is 30. *

* * @return The time—10 seconds or 30 seconds—between each health check for an endpoint. The default value is 30. */ public final Integer healthCheckIntervalSeconds() { return healthCheckIntervalSeconds; } /** *

* The number of consecutive health checks required to set the state of a healthy endpoint to unhealthy, or to set * an unhealthy endpoint to healthy. The default value is 3. *

* * @return The number of consecutive health checks required to set the state of a healthy endpoint to unhealthy, or * to set an unhealthy endpoint to healthy. The default value is 3. */ public final Integer thresholdCount() { return thresholdCount; } /** *

* A unique, case-sensitive identifier that you provide to ensure the idempotency—that is, the uniqueness—of the * request. *

* * @return A unique, case-sensitive identifier that you provide to ensure the idempotency—that is, the uniqueness—of * the request. */ public final String idempotencyToken() { return idempotencyToken; } /** * Returns true if the PortOverrides property was specified by the sender (it may be empty), or false if the sender * did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service. */ public final boolean hasPortOverrides() { return portOverrides != null && !(portOverrides instanceof SdkAutoConstructList); } /** *

* Override specific listener ports used to route traffic to endpoints that are part of this endpoint group. For * example, you can create a port override in which the listener receives user traffic on ports 80 and 443, but your * accelerator routes that traffic to ports 1080 and 1443, respectively, on the endpoints. *

*

* For more information, see Port * overrides in the AWS Global Accelerator Developer Guide. *

*

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

*

* You can use {@link #hasPortOverrides()} to see if a value was sent in this field. *

* * @return Override specific listener ports used to route traffic to endpoints that are part of this endpoint group. * For example, you can create a port override in which the listener receives user traffic on ports 80 and * 443, but your accelerator routes that traffic to ports 1080 and 1443, respectively, on the endpoints.

*

* For more information, see Port * overrides in the AWS Global Accelerator Developer Guide. */ public final List portOverrides() { return portOverrides; } @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(listenerArn()); hashCode = 31 * hashCode + Objects.hashCode(endpointGroupRegion()); hashCode = 31 * hashCode + Objects.hashCode(hasEndpointConfigurations() ? endpointConfigurations() : null); hashCode = 31 * hashCode + Objects.hashCode(trafficDialPercentage()); hashCode = 31 * hashCode + Objects.hashCode(healthCheckPort()); hashCode = 31 * hashCode + Objects.hashCode(healthCheckProtocolAsString()); hashCode = 31 * hashCode + Objects.hashCode(healthCheckPath()); hashCode = 31 * hashCode + Objects.hashCode(healthCheckIntervalSeconds()); hashCode = 31 * hashCode + Objects.hashCode(thresholdCount()); hashCode = 31 * hashCode + Objects.hashCode(idempotencyToken()); hashCode = 31 * hashCode + Objects.hashCode(hasPortOverrides() ? portOverrides() : 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 CreateEndpointGroupRequest)) { return false; } CreateEndpointGroupRequest other = (CreateEndpointGroupRequest) obj; return Objects.equals(listenerArn(), other.listenerArn()) && Objects.equals(endpointGroupRegion(), other.endpointGroupRegion()) && hasEndpointConfigurations() == other.hasEndpointConfigurations() && Objects.equals(endpointConfigurations(), other.endpointConfigurations()) && Objects.equals(trafficDialPercentage(), other.trafficDialPercentage()) && Objects.equals(healthCheckPort(), other.healthCheckPort()) && Objects.equals(healthCheckProtocolAsString(), other.healthCheckProtocolAsString()) && Objects.equals(healthCheckPath(), other.healthCheckPath()) && Objects.equals(healthCheckIntervalSeconds(), other.healthCheckIntervalSeconds()) && Objects.equals(thresholdCount(), other.thresholdCount()) && Objects.equals(idempotencyToken(), other.idempotencyToken()) && hasPortOverrides() == other.hasPortOverrides() && Objects.equals(portOverrides(), other.portOverrides()); } /** * 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("CreateEndpointGroupRequest").add("ListenerArn", listenerArn()) .add("EndpointGroupRegion", endpointGroupRegion()) .add("EndpointConfigurations", hasEndpointConfigurations() ? endpointConfigurations() : null) .add("TrafficDialPercentage", trafficDialPercentage()).add("HealthCheckPort", healthCheckPort()) .add("HealthCheckProtocol", healthCheckProtocolAsString()).add("HealthCheckPath", healthCheckPath()) .add("HealthCheckIntervalSeconds", healthCheckIntervalSeconds()).add("ThresholdCount", thresholdCount()) .add("IdempotencyToken", idempotencyToken()).add("PortOverrides", hasPortOverrides() ? portOverrides() : null) .build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "ListenerArn": return Optional.ofNullable(clazz.cast(listenerArn())); case "EndpointGroupRegion": return Optional.ofNullable(clazz.cast(endpointGroupRegion())); case "EndpointConfigurations": return Optional.ofNullable(clazz.cast(endpointConfigurations())); case "TrafficDialPercentage": return Optional.ofNullable(clazz.cast(trafficDialPercentage())); case "HealthCheckPort": return Optional.ofNullable(clazz.cast(healthCheckPort())); case "HealthCheckProtocol": return Optional.ofNullable(clazz.cast(healthCheckProtocolAsString())); case "HealthCheckPath": return Optional.ofNullable(clazz.cast(healthCheckPath())); case "HealthCheckIntervalSeconds": return Optional.ofNullable(clazz.cast(healthCheckIntervalSeconds())); case "ThresholdCount": return Optional.ofNullable(clazz.cast(thresholdCount())); case "IdempotencyToken": return Optional.ofNullable(clazz.cast(idempotencyToken())); case "PortOverrides": return Optional.ofNullable(clazz.cast(portOverrides())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((CreateEndpointGroupRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends GlobalAcceleratorRequest.Builder, SdkPojo, CopyableBuilder { /** *

* The Amazon Resource Name (ARN) of the listener. *

* * @param listenerArn * The Amazon Resource Name (ARN) of the listener. * @return Returns a reference to this object so that method calls can be chained together. */ Builder listenerArn(String listenerArn); /** *

* The AWS Region where the endpoint group is located. A listener can have only one endpoint group in a specific * Region. *

* * @param endpointGroupRegion * The AWS Region where the endpoint group is located. A listener can have only one endpoint group in a * specific Region. * @return Returns a reference to this object so that method calls can be chained together. */ Builder endpointGroupRegion(String endpointGroupRegion); /** *

* The list of endpoint objects. *

* * @param endpointConfigurations * The list of endpoint objects. * @return Returns a reference to this object so that method calls can be chained together. */ Builder endpointConfigurations(Collection endpointConfigurations); /** *

* The list of endpoint objects. *

* * @param endpointConfigurations * The list of endpoint objects. * @return Returns a reference to this object so that method calls can be chained together. */ Builder endpointConfigurations(EndpointConfiguration... endpointConfigurations); /** *

* The list of endpoint objects. *

* This is a convenience that creates an instance of the {@link List.Builder} avoiding * the need to create one manually via {@link List#builder()}. * * When the {@link Consumer} completes, {@link List.Builder#build()} is called * immediately and its result is passed to {@link #endpointConfigurations(List)}. * * @param endpointConfigurations * a consumer that will call methods on {@link List.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #endpointConfigurations(List) */ Builder endpointConfigurations(Consumer... endpointConfigurations); /** *

* The percentage of traffic to send to an AWS Region. Additional traffic is distributed to other endpoint * groups for this listener. *

*

* Use this action to increase (dial up) or decrease (dial down) traffic to a specific Region. The percentage is * applied to the traffic that would otherwise have been routed to the Region based on optimal routing. *

*

* The default value is 100. *

* * @param trafficDialPercentage * The percentage of traffic to send to an AWS Region. Additional traffic is distributed to other * endpoint groups for this listener.

*

* Use this action to increase (dial up) or decrease (dial down) traffic to a specific Region. The * percentage is applied to the traffic that would otherwise have been routed to the Region based on * optimal routing. *

*

* The default value is 100. * @return Returns a reference to this object so that method calls can be chained together. */ Builder trafficDialPercentage(Float trafficDialPercentage); /** *

* The port that AWS Global Accelerator uses to check the health of endpoints that are part of this endpoint * group. The default port is the listener port that this endpoint group is associated with. If listener port is * a list of ports, Global Accelerator uses the first port in the list. *

* * @param healthCheckPort * The port that AWS Global Accelerator uses to check the health of endpoints that are part of this * endpoint group. The default port is the listener port that this endpoint group is associated with. If * listener port is a list of ports, Global Accelerator uses the first port in the list. * @return Returns a reference to this object so that method calls can be chained together. */ Builder healthCheckPort(Integer healthCheckPort); /** *

* The protocol that AWS Global Accelerator uses to check the health of endpoints that are part of this endpoint * group. The default value is TCP. *

* * @param healthCheckProtocol * The protocol that AWS Global Accelerator uses to check the health of endpoints that are part of this * endpoint group. The default value is TCP. * @see HealthCheckProtocol * @return Returns a reference to this object so that method calls can be chained together. * @see HealthCheckProtocol */ Builder healthCheckProtocol(String healthCheckProtocol); /** *

* The protocol that AWS Global Accelerator uses to check the health of endpoints that are part of this endpoint * group. The default value is TCP. *

* * @param healthCheckProtocol * The protocol that AWS Global Accelerator uses to check the health of endpoints that are part of this * endpoint group. The default value is TCP. * @see HealthCheckProtocol * @return Returns a reference to this object so that method calls can be chained together. * @see HealthCheckProtocol */ Builder healthCheckProtocol(HealthCheckProtocol healthCheckProtocol); /** *

* If the protocol is HTTP/S, then this specifies the path that is the destination for health check targets. The * default value is slash (/). *

* * @param healthCheckPath * If the protocol is HTTP/S, then this specifies the path that is the destination for health check * targets. The default value is slash (/). * @return Returns a reference to this object so that method calls can be chained together. */ Builder healthCheckPath(String healthCheckPath); /** *

* The time—10 seconds or 30 seconds—between each health check for an endpoint. The default value is 30. *

* * @param healthCheckIntervalSeconds * The time—10 seconds or 30 seconds—between each health check for an endpoint. The default value is 30. * @return Returns a reference to this object so that method calls can be chained together. */ Builder healthCheckIntervalSeconds(Integer healthCheckIntervalSeconds); /** *

* The number of consecutive health checks required to set the state of a healthy endpoint to unhealthy, or to * set an unhealthy endpoint to healthy. The default value is 3. *

* * @param thresholdCount * The number of consecutive health checks required to set the state of a healthy endpoint to unhealthy, * or to set an unhealthy endpoint to healthy. The default value is 3. * @return Returns a reference to this object so that method calls can be chained together. */ Builder thresholdCount(Integer thresholdCount); /** *

* A unique, case-sensitive identifier that you provide to ensure the idempotency—that is, the uniqueness—of the * request. *

* * @param idempotencyToken * A unique, case-sensitive identifier that you provide to ensure the idempotency—that is, the * uniqueness—of the request. * @return Returns a reference to this object so that method calls can be chained together. */ Builder idempotencyToken(String idempotencyToken); /** *

* Override specific listener ports used to route traffic to endpoints that are part of this endpoint group. For * example, you can create a port override in which the listener receives user traffic on ports 80 and 443, but * your accelerator routes that traffic to ports 1080 and 1443, respectively, on the endpoints. *

*

* For more information, see * Port overrides in the AWS Global Accelerator Developer Guide. *

* * @param portOverrides * Override specific listener ports used to route traffic to endpoints that are part of this endpoint * group. For example, you can create a port override in which the listener receives user traffic on * ports 80 and 443, but your accelerator routes that traffic to ports 1080 and 1443, respectively, on * the endpoints.

*

* For more information, see * Port overrides in the AWS Global Accelerator Developer Guide. * @return Returns a reference to this object so that method calls can be chained together. */ Builder portOverrides(Collection portOverrides); /** *

* Override specific listener ports used to route traffic to endpoints that are part of this endpoint group. For * example, you can create a port override in which the listener receives user traffic on ports 80 and 443, but * your accelerator routes that traffic to ports 1080 and 1443, respectively, on the endpoints. *

*

* For more information, see * Port overrides in the AWS Global Accelerator Developer Guide. *

* * @param portOverrides * Override specific listener ports used to route traffic to endpoints that are part of this endpoint * group. For example, you can create a port override in which the listener receives user traffic on * ports 80 and 443, but your accelerator routes that traffic to ports 1080 and 1443, respectively, on * the endpoints.

*

* For more information, see * Port overrides in the AWS Global Accelerator Developer Guide. * @return Returns a reference to this object so that method calls can be chained together. */ Builder portOverrides(PortOverride... portOverrides); /** *

* Override specific listener ports used to route traffic to endpoints that are part of this endpoint group. For * example, you can create a port override in which the listener receives user traffic on ports 80 and 443, but * your accelerator routes that traffic to ports 1080 and 1443, respectively, on the endpoints. *

*

* For more information, see * Port overrides in the AWS Global Accelerator Developer Guide. *

* This is a convenience that creates an instance of the {@link List.Builder} avoiding the need to * create one manually via {@link List#builder()}. * * When the {@link Consumer} completes, {@link List.Builder#build()} is called immediately and its * result is passed to {@link #portOverrides(List)}. * * @param portOverrides * a consumer that will call methods on {@link List.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #portOverrides(List) */ Builder portOverrides(Consumer... portOverrides); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends GlobalAcceleratorRequest.BuilderImpl implements Builder { private String listenerArn; private String endpointGroupRegion; private List endpointConfigurations = DefaultSdkAutoConstructList.getInstance(); private Float trafficDialPercentage; private Integer healthCheckPort; private String healthCheckProtocol; private String healthCheckPath; private Integer healthCheckIntervalSeconds; private Integer thresholdCount; private String idempotencyToken; private List portOverrides = DefaultSdkAutoConstructList.getInstance(); private BuilderImpl() { } private BuilderImpl(CreateEndpointGroupRequest model) { super(model); listenerArn(model.listenerArn); endpointGroupRegion(model.endpointGroupRegion); endpointConfigurations(model.endpointConfigurations); trafficDialPercentage(model.trafficDialPercentage); healthCheckPort(model.healthCheckPort); healthCheckProtocol(model.healthCheckProtocol); healthCheckPath(model.healthCheckPath); healthCheckIntervalSeconds(model.healthCheckIntervalSeconds); thresholdCount(model.thresholdCount); idempotencyToken(model.idempotencyToken); portOverrides(model.portOverrides); } public final String getListenerArn() { return listenerArn; } @Override public final Builder listenerArn(String listenerArn) { this.listenerArn = listenerArn; return this; } public final void setListenerArn(String listenerArn) { this.listenerArn = listenerArn; } public final String getEndpointGroupRegion() { return endpointGroupRegion; } @Override public final Builder endpointGroupRegion(String endpointGroupRegion) { this.endpointGroupRegion = endpointGroupRegion; return this; } public final void setEndpointGroupRegion(String endpointGroupRegion) { this.endpointGroupRegion = endpointGroupRegion; } public final Collection getEndpointConfigurations() { if (endpointConfigurations instanceof SdkAutoConstructList) { return null; } return endpointConfigurations != null ? endpointConfigurations.stream().map(EndpointConfiguration::toBuilder) .collect(Collectors.toList()) : null; } @Override public final Builder endpointConfigurations(Collection endpointConfigurations) { this.endpointConfigurations = EndpointConfigurationsCopier.copy(endpointConfigurations); return this; } @Override @SafeVarargs public final Builder endpointConfigurations(EndpointConfiguration... endpointConfigurations) { endpointConfigurations(Arrays.asList(endpointConfigurations)); return this; } @Override @SafeVarargs public final Builder endpointConfigurations(Consumer... endpointConfigurations) { endpointConfigurations(Stream.of(endpointConfigurations) .map(c -> EndpointConfiguration.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } public final void setEndpointConfigurations(Collection endpointConfigurations) { this.endpointConfigurations = EndpointConfigurationsCopier.copyFromBuilder(endpointConfigurations); } public final Float getTrafficDialPercentage() { return trafficDialPercentage; } @Override public final Builder trafficDialPercentage(Float trafficDialPercentage) { this.trafficDialPercentage = trafficDialPercentage; return this; } public final void setTrafficDialPercentage(Float trafficDialPercentage) { this.trafficDialPercentage = trafficDialPercentage; } public final Integer getHealthCheckPort() { return healthCheckPort; } @Override public final Builder healthCheckPort(Integer healthCheckPort) { this.healthCheckPort = healthCheckPort; return this; } public final void setHealthCheckPort(Integer healthCheckPort) { this.healthCheckPort = healthCheckPort; } public final String getHealthCheckProtocol() { return healthCheckProtocol; } @Override public final Builder healthCheckProtocol(String healthCheckProtocol) { this.healthCheckProtocol = healthCheckProtocol; return this; } @Override public final Builder healthCheckProtocol(HealthCheckProtocol healthCheckProtocol) { this.healthCheckProtocol(healthCheckProtocol == null ? null : healthCheckProtocol.toString()); return this; } public final void setHealthCheckProtocol(String healthCheckProtocol) { this.healthCheckProtocol = healthCheckProtocol; } public final String getHealthCheckPath() { return healthCheckPath; } @Override public final Builder healthCheckPath(String healthCheckPath) { this.healthCheckPath = healthCheckPath; return this; } public final void setHealthCheckPath(String healthCheckPath) { this.healthCheckPath = healthCheckPath; } public final Integer getHealthCheckIntervalSeconds() { return healthCheckIntervalSeconds; } @Override public final Builder healthCheckIntervalSeconds(Integer healthCheckIntervalSeconds) { this.healthCheckIntervalSeconds = healthCheckIntervalSeconds; return this; } public final void setHealthCheckIntervalSeconds(Integer healthCheckIntervalSeconds) { this.healthCheckIntervalSeconds = healthCheckIntervalSeconds; } public final Integer getThresholdCount() { return thresholdCount; } @Override public final Builder thresholdCount(Integer thresholdCount) { this.thresholdCount = thresholdCount; return this; } public final void setThresholdCount(Integer thresholdCount) { this.thresholdCount = thresholdCount; } public final String getIdempotencyToken() { return idempotencyToken; } @Override public final Builder idempotencyToken(String idempotencyToken) { this.idempotencyToken = idempotencyToken; return this; } public final void setIdempotencyToken(String idempotencyToken) { this.idempotencyToken = idempotencyToken; } public final Collection getPortOverrides() { if (portOverrides instanceof SdkAutoConstructList) { return null; } return portOverrides != null ? portOverrides.stream().map(PortOverride::toBuilder).collect(Collectors.toList()) : null; } @Override public final Builder portOverrides(Collection portOverrides) { this.portOverrides = PortOverridesCopier.copy(portOverrides); return this; } @Override @SafeVarargs public final Builder portOverrides(PortOverride... portOverrides) { portOverrides(Arrays.asList(portOverrides)); return this; } @Override @SafeVarargs public final Builder portOverrides(Consumer... portOverrides) { portOverrides(Stream.of(portOverrides).map(c -> PortOverride.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final void setPortOverrides(Collection portOverrides) { this.portOverrides = PortOverridesCopier.copyFromBuilder(portOverrides); } @Override public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) { super.overrideConfiguration(overrideConfiguration); return this; } @Override public Builder overrideConfiguration(Consumer builderConsumer) { super.overrideConfiguration(builderConsumer); return this; } @Override public CreateEndpointGroupRequest build() { return new CreateEndpointGroupRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy