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

software.amazon.awssdk.services.vpclattice.model.TargetSummary Maven / Gradle / Ivy

Go to download

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

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

import java.io.Serializable;
import java.util.Arrays;
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.Function;
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.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Summary information about a target. *

*/ @Generated("software.amazon.awssdk:codegen") public final class TargetSummary implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField ID_FIELD = SdkField. builder(MarshallingType.STRING).memberName("id") .getter(getter(TargetSummary::id)).setter(setter(Builder::id)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("id").build()).build(); private static final SdkField PORT_FIELD = SdkField. builder(MarshallingType.INTEGER).memberName("port") .getter(getter(TargetSummary::port)).setter(setter(Builder::port)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("port").build()).build(); private static final SdkField REASON_CODE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("reasonCode").getter(getter(TargetSummary::reasonCode)).setter(setter(Builder::reasonCode)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("reasonCode").build()).build(); private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("status") .getter(getter(TargetSummary::statusAsString)).setter(setter(Builder::status)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("status").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ID_FIELD, PORT_FIELD, REASON_CODE_FIELD, STATUS_FIELD)); private static final long serialVersionUID = 1L; private final String id; private final Integer port; private final String reasonCode; private final String status; private TargetSummary(BuilderImpl builder) { this.id = builder.id; this.port = builder.port; this.reasonCode = builder.reasonCode; this.status = builder.status; } /** *

* The ID of the target. If the target group type is INSTANCE, this is an instance ID. If the target * group type is IP, this is an IP address. If the target group type is LAMBDA, this is * the ARN of a Lambda function. If the target type is ALB, this is the ARN of an Application Load * Balancer. *

* * @return The ID of the target. If the target group type is INSTANCE, this is an instance ID. If the * target group type is IP, this is an IP address. If the target group type is * LAMBDA, this is the ARN of a Lambda function. If the target type is ALB, this * is the ARN of an Application Load Balancer. */ public final String id() { return id; } /** *

* The port on which the target is listening. *

* * @return The port on which the target is listening. */ public final Integer port() { return port; } /** *

* The code for why the target status is what it is. *

* * @return The code for why the target status is what it is. */ public final String reasonCode() { return reasonCode; } /** *

* The status of the target. *

*
    *
  • *

    * DRAINING: The target is being deregistered. No new connections are sent to this target while current * connections are being drained. The default draining time is 5 minutes. *

    *
  • *
  • *

    * UNAVAILABLE: Health checks are unavailable for the target group. *

    *
  • *
  • *

    * HEALTHY: The target is healthy. *

    *
  • *
  • *

    * UNHEALTHY: The target is unhealthy. *

    *
  • *
  • *

    * INITIAL: Initial health checks on the target are being performed. *

    *
  • *
  • *

    * UNUSED: Target group is not used in a service. *

    *
  • *
*

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

* * @return The status of the target.

*
    *
  • *

    * DRAINING: The target is being deregistered. No new connections are sent to this target while * current connections are being drained. The default draining time is 5 minutes. *

    *
  • *
  • *

    * UNAVAILABLE: Health checks are unavailable for the target group. *

    *
  • *
  • *

    * HEALTHY: The target is healthy. *

    *
  • *
  • *

    * UNHEALTHY: The target is unhealthy. *

    *
  • *
  • *

    * INITIAL: Initial health checks on the target are being performed. *

    *
  • *
  • *

    * UNUSED: Target group is not used in a service. *

    *
  • * @see TargetStatus */ public final TargetStatus status() { return TargetStatus.fromValue(status); } /** *

    * The status of the target. *

    *
      *
    • *

      * DRAINING: The target is being deregistered. No new connections are sent to this target while current * connections are being drained. The default draining time is 5 minutes. *

      *
    • *
    • *

      * UNAVAILABLE: Health checks are unavailable for the target group. *

      *
    • *
    • *

      * HEALTHY: The target is healthy. *

      *
    • *
    • *

      * UNHEALTHY: The target is unhealthy. *

      *
    • *
    • *

      * INITIAL: Initial health checks on the target are being performed. *

      *
    • *
    • *

      * UNUSED: Target group is not used in a service. *

      *
    • *
    *

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

    * * @return The status of the target.

    *
      *
    • *

      * DRAINING: The target is being deregistered. No new connections are sent to this target while * current connections are being drained. The default draining time is 5 minutes. *

      *
    • *
    • *

      * UNAVAILABLE: Health checks are unavailable for the target group. *

      *
    • *
    • *

      * HEALTHY: The target is healthy. *

      *
    • *
    • *

      * UNHEALTHY: The target is unhealthy. *

      *
    • *
    • *

      * INITIAL: Initial health checks on the target are being performed. *

      *
    • *
    • *

      * UNUSED: Target group is not used in a service. *

      *
    • * @see TargetStatus */ public final String statusAsString() { return status; } @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(id()); hashCode = 31 * hashCode + Objects.hashCode(port()); hashCode = 31 * hashCode + Objects.hashCode(reasonCode()); hashCode = 31 * hashCode + Objects.hashCode(statusAsString()); 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 TargetSummary)) { return false; } TargetSummary other = (TargetSummary) obj; return Objects.equals(id(), other.id()) && Objects.equals(port(), other.port()) && Objects.equals(reasonCode(), other.reasonCode()) && Objects.equals(statusAsString(), other.statusAsString()); } /** * 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("TargetSummary").add("Id", id()).add("Port", port()).add("ReasonCode", reasonCode()) .add("Status", statusAsString()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "id": return Optional.ofNullable(clazz.cast(id())); case "port": return Optional.ofNullable(clazz.cast(port())); case "reasonCode": return Optional.ofNullable(clazz.cast(reasonCode())); case "status": return Optional.ofNullable(clazz.cast(statusAsString())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((TargetSummary) 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 target. If the target group type is INSTANCE, this is an instance ID. If the * target group type is IP, this is an IP address. If the target group type is LAMBDA, * this is the ARN of a Lambda function. If the target type is ALB, this is the ARN of an * Application Load Balancer. *

      * * @param id * The ID of the target. If the target group type is INSTANCE, this is an instance ID. If * the target group type is IP, this is an IP address. If the target group type is * LAMBDA, this is the ARN of a Lambda function. If the target type is ALB, * this is the ARN of an Application Load Balancer. * @return Returns a reference to this object so that method calls can be chained together. */ Builder id(String id); /** *

      * The port on which the target is listening. *

      * * @param port * The port on which the target is listening. * @return Returns a reference to this object so that method calls can be chained together. */ Builder port(Integer port); /** *

      * The code for why the target status is what it is. *

      * * @param reasonCode * The code for why the target status is what it is. * @return Returns a reference to this object so that method calls can be chained together. */ Builder reasonCode(String reasonCode); /** *

      * The status of the target. *

      *
        *
      • *

        * DRAINING: The target is being deregistered. No new connections are sent to this target while * current connections are being drained. The default draining time is 5 minutes. *

        *
      • *
      • *

        * UNAVAILABLE: Health checks are unavailable for the target group. *

        *
      • *
      • *

        * HEALTHY: The target is healthy. *

        *
      • *
      • *

        * UNHEALTHY: The target is unhealthy. *

        *
      • *
      • *

        * INITIAL: Initial health checks on the target are being performed. *

        *
      • *
      • *

        * UNUSED: Target group is not used in a service. *

        *
      • *
      * * @param status * The status of the target.

      *
        *
      • *

        * DRAINING: The target is being deregistered. No new connections are sent to this target * while current connections are being drained. The default draining time is 5 minutes. *

        *
      • *
      • *

        * UNAVAILABLE: Health checks are unavailable for the target group. *

        *
      • *
      • *

        * HEALTHY: The target is healthy. *

        *
      • *
      • *

        * UNHEALTHY: The target is unhealthy. *

        *
      • *
      • *

        * INITIAL: Initial health checks on the target are being performed. *

        *
      • *
      • *

        * UNUSED: Target group is not used in a service. *

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

        * The status of the target. *

        *
          *
        • *

          * DRAINING: The target is being deregistered. No new connections are sent to this target while * current connections are being drained. The default draining time is 5 minutes. *

          *
        • *
        • *

          * UNAVAILABLE: Health checks are unavailable for the target group. *

          *
        • *
        • *

          * HEALTHY: The target is healthy. *

          *
        • *
        • *

          * UNHEALTHY: The target is unhealthy. *

          *
        • *
        • *

          * INITIAL: Initial health checks on the target are being performed. *

          *
        • *
        • *

          * UNUSED: Target group is not used in a service. *

          *
        • *
        * * @param status * The status of the target.

        *
          *
        • *

          * DRAINING: The target is being deregistered. No new connections are sent to this target * while current connections are being drained. The default draining time is 5 minutes. *

          *
        • *
        • *

          * UNAVAILABLE: Health checks are unavailable for the target group. *

          *
        • *
        • *

          * HEALTHY: The target is healthy. *

          *
        • *
        • *

          * UNHEALTHY: The target is unhealthy. *

          *
        • *
        • *

          * INITIAL: Initial health checks on the target are being performed. *

          *
        • *
        • *

          * UNUSED: Target group is not used in a service. *

          *
        • * @see TargetStatus * @return Returns a reference to this object so that method calls can be chained together. * @see TargetStatus */ Builder status(TargetStatus status); } static final class BuilderImpl implements Builder { private String id; private Integer port; private String reasonCode; private String status; private BuilderImpl() { } private BuilderImpl(TargetSummary model) { id(model.id); port(model.port); reasonCode(model.reasonCode); status(model.status); } public final String getId() { return id; } public final void setId(String id) { this.id = id; } @Override public final Builder id(String id) { this.id = id; return this; } public final Integer getPort() { return port; } public final void setPort(Integer port) { this.port = port; } @Override public final Builder port(Integer port) { this.port = port; return this; } public final String getReasonCode() { return reasonCode; } public final void setReasonCode(String reasonCode) { this.reasonCode = reasonCode; } @Override public final Builder reasonCode(String reasonCode) { this.reasonCode = reasonCode; return this; } public final String getStatus() { return status; } public final void setStatus(String status) { this.status = status; } @Override public final Builder status(String status) { this.status = status; return this; } @Override public final Builder status(TargetStatus status) { this.status(status == null ? null : status.toString()); return this; } @Override public TargetSummary build() { return new TargetSummary(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy