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

software.amazon.awssdk.services.arczonalshift.model.StartZonalShiftResponse Maven / Gradle / Ivy

Go to download

The AWS Java SDK for ARC Zonal Shift module holds the client classes that are used for communicating with ARC Zonal Shift.

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

import java.time.Instant;
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;

/**
 */
@Generated("software.amazon.awssdk:codegen")
public final class StartZonalShiftResponse extends ArcZonalShiftResponse implements
        ToCopyableBuilder {
    private static final SdkField AWAY_FROM_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("awayFrom").getter(getter(StartZonalShiftResponse::awayFrom)).setter(setter(Builder::awayFrom))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("awayFrom").build()).build();

    private static final SdkField COMMENT_FIELD = SdkField. builder(MarshallingType.STRING).memberName("comment")
            .getter(getter(StartZonalShiftResponse::comment)).setter(setter(Builder::comment))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("comment").build()).build();

    private static final SdkField EXPIRY_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
            .memberName("expiryTime").getter(getter(StartZonalShiftResponse::expiryTime)).setter(setter(Builder::expiryTime))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("expiryTime").build()).build();

    private static final SdkField RESOURCE_IDENTIFIER_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("resourceIdentifier").getter(getter(StartZonalShiftResponse::resourceIdentifier))
            .setter(setter(Builder::resourceIdentifier))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("resourceIdentifier").build())
            .build();

    private static final SdkField START_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
            .memberName("startTime").getter(getter(StartZonalShiftResponse::startTime)).setter(setter(Builder::startTime))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("startTime").build()).build();

    private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("status")
            .getter(getter(StartZonalShiftResponse::statusAsString)).setter(setter(Builder::status))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("status").build()).build();

    private static final SdkField ZONAL_SHIFT_ID_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("zonalShiftId").getter(getter(StartZonalShiftResponse::zonalShiftId))
            .setter(setter(Builder::zonalShiftId))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("zonalShiftId").build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(AWAY_FROM_FIELD,
            COMMENT_FIELD, EXPIRY_TIME_FIELD, RESOURCE_IDENTIFIER_FIELD, START_TIME_FIELD, STATUS_FIELD, ZONAL_SHIFT_ID_FIELD));

    private final String awayFrom;

    private final String comment;

    private final Instant expiryTime;

    private final String resourceIdentifier;

    private final Instant startTime;

    private final String status;

    private final String zonalShiftId;

    private StartZonalShiftResponse(BuilderImpl builder) {
        super(builder);
        this.awayFrom = builder.awayFrom;
        this.comment = builder.comment;
        this.expiryTime = builder.expiryTime;
        this.resourceIdentifier = builder.resourceIdentifier;
        this.startTime = builder.startTime;
        this.status = builder.status;
        this.zonalShiftId = builder.zonalShiftId;
    }

    /**
     * 

* The Availability Zone (for example, use1-az1) that traffic is moved away from for a resource when * you start a zonal shift. Until the zonal shift expires or you cancel it, traffic for the resource is instead * moved to other Availability Zones in the Amazon Web Services Region. *

* * @return The Availability Zone (for example, use1-az1) that traffic is moved away from for a resource * when you start a zonal shift. Until the zonal shift expires or you cancel it, traffic for the resource is * instead moved to other Availability Zones in the Amazon Web Services Region. */ public final String awayFrom() { return awayFrom; } /** *

* A comment that you enter about the zonal shift. Only the latest comment is retained; no comment history is * maintained. A new comment overwrites any existing comment string. *

* * @return A comment that you enter about the zonal shift. Only the latest comment is retained; no comment history * is maintained. A new comment overwrites any existing comment string. */ public final String comment() { return comment; } /** *

* The expiry time (expiration time) for a customer-initiated zonal shift. A zonal shift is temporary and must be * set to expire when you start the zonal shift. You can initially set a zonal shift to expire in a maximum of three * days (72 hours). However, you can update a zonal shift to set a new expiration at any time. *

*

* When you start a zonal shift, you specify how long you want it to be active, which Route 53 ARC converts to an * expiry time (expiration time). You can cancel a zonal shift when you're ready to restore traffic to the * Availability Zone, or just wait for it to expire. Or you can update the zonal shift to specify another length of * time to expire in. *

* * @return The expiry time (expiration time) for a customer-initiated zonal shift. A zonal shift is temporary and * must be set to expire when you start the zonal shift. You can initially set a zonal shift to expire in a * maximum of three days (72 hours). However, you can update a zonal shift to set a new expiration at any * time.

*

* When you start a zonal shift, you specify how long you want it to be active, which Route 53 ARC converts * to an expiry time (expiration time). You can cancel a zonal shift when you're ready to restore traffic to * the Availability Zone, or just wait for it to expire. Or you can update the zonal shift to specify * another length of time to expire in. */ public final Instant expiryTime() { return expiryTime; } /** *

* The identifier for the resource that Amazon Web Services shifts traffic for. The identifier is the Amazon * Resource Name (ARN) for the resource. *

*

* At this time, supported resources are Network Load Balancers and Application Load Balancers with cross-zone load * balancing turned off. *

* * @return The identifier for the resource that Amazon Web Services shifts traffic for. The identifier is the Amazon * Resource Name (ARN) for the resource.

*

* At this time, supported resources are Network Load Balancers and Application Load Balancers with * cross-zone load balancing turned off. */ public final String resourceIdentifier() { return resourceIdentifier; } /** *

* The time (UTC) when the zonal shift starts. *

* * @return The time (UTC) when the zonal shift starts. */ public final Instant startTime() { return startTime; } /** *

* A status for a zonal shift. *

*

* The Status for a zonal shift can have one of the following values: *

*
    *
  • *

    * ACTIVE: The zonal shift has been started and active. *

    *
  • *
  • *

    * EXPIRED: The zonal shift has expired (the expiry time was exceeded). *

    *
  • *
  • *

    * CANCELED: The zonal shift was canceled. *

    *
  • *
*

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

* * @return A status for a zonal shift.

*

* The Status for a zonal shift can have one of the following values: *

*
    *
  • *

    * ACTIVE: The zonal shift has been started and active. *

    *
  • *
  • *

    * EXPIRED: The zonal shift has expired (the expiry time was exceeded). *

    *
  • *
  • *

    * CANCELED: The zonal shift was canceled. *

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

    * A status for a zonal shift. *

    *

    * The Status for a zonal shift can have one of the following values: *

    *
      *
    • *

      * ACTIVE: The zonal shift has been started and active. *

      *
    • *
    • *

      * EXPIRED: The zonal shift has expired (the expiry time was exceeded). *

      *
    • *
    • *

      * CANCELED: The zonal shift was canceled. *

      *
    • *
    *

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

    * * @return A status for a zonal shift.

    *

    * The Status for a zonal shift can have one of the following values: *

    *
      *
    • *

      * ACTIVE: The zonal shift has been started and active. *

      *
    • *
    • *

      * EXPIRED: The zonal shift has expired (the expiry time was exceeded). *

      *
    • *
    • *

      * CANCELED: The zonal shift was canceled. *

      *
    • * @see ZonalShiftStatus */ public final String statusAsString() { return status; } /** *

      * The identifier of a zonal shift. *

      * * @return The identifier of a zonal shift. */ public final String zonalShiftId() { return zonalShiftId; } @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(awayFrom()); hashCode = 31 * hashCode + Objects.hashCode(comment()); hashCode = 31 * hashCode + Objects.hashCode(expiryTime()); hashCode = 31 * hashCode + Objects.hashCode(resourceIdentifier()); hashCode = 31 * hashCode + Objects.hashCode(startTime()); hashCode = 31 * hashCode + Objects.hashCode(statusAsString()); hashCode = 31 * hashCode + Objects.hashCode(zonalShiftId()); 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 StartZonalShiftResponse)) { return false; } StartZonalShiftResponse other = (StartZonalShiftResponse) obj; return Objects.equals(awayFrom(), other.awayFrom()) && Objects.equals(comment(), other.comment()) && Objects.equals(expiryTime(), other.expiryTime()) && Objects.equals(resourceIdentifier(), other.resourceIdentifier()) && Objects.equals(startTime(), other.startTime()) && Objects.equals(statusAsString(), other.statusAsString()) && Objects.equals(zonalShiftId(), other.zonalShiftId()); } /** * 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("StartZonalShiftResponse").add("AwayFrom", awayFrom()).add("Comment", comment()) .add("ExpiryTime", expiryTime()).add("ResourceIdentifier", resourceIdentifier()).add("StartTime", startTime()) .add("Status", statusAsString()).add("ZonalShiftId", zonalShiftId()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "awayFrom": return Optional.ofNullable(clazz.cast(awayFrom())); case "comment": return Optional.ofNullable(clazz.cast(comment())); case "expiryTime": return Optional.ofNullable(clazz.cast(expiryTime())); case "resourceIdentifier": return Optional.ofNullable(clazz.cast(resourceIdentifier())); case "startTime": return Optional.ofNullable(clazz.cast(startTime())); case "status": return Optional.ofNullable(clazz.cast(statusAsString())); case "zonalShiftId": return Optional.ofNullable(clazz.cast(zonalShiftId())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((StartZonalShiftResponse) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends ArcZonalShiftResponse.Builder, SdkPojo, CopyableBuilder { /** *

      * The Availability Zone (for example, use1-az1) that traffic is moved away from for a resource * when you start a zonal shift. Until the zonal shift expires or you cancel it, traffic for the resource is * instead moved to other Availability Zones in the Amazon Web Services Region. *

      * * @param awayFrom * The Availability Zone (for example, use1-az1) that traffic is moved away from for a * resource when you start a zonal shift. Until the zonal shift expires or you cancel it, traffic for the * resource is instead moved to other Availability Zones in the Amazon Web Services Region. * @return Returns a reference to this object so that method calls can be chained together. */ Builder awayFrom(String awayFrom); /** *

      * A comment that you enter about the zonal shift. Only the latest comment is retained; no comment history is * maintained. A new comment overwrites any existing comment string. *

      * * @param comment * A comment that you enter about the zonal shift. Only the latest comment is retained; no comment * history is maintained. A new comment overwrites any existing comment string. * @return Returns a reference to this object so that method calls can be chained together. */ Builder comment(String comment); /** *

      * The expiry time (expiration time) for a customer-initiated zonal shift. A zonal shift is temporary and must * be set to expire when you start the zonal shift. You can initially set a zonal shift to expire in a maximum * of three days (72 hours). However, you can update a zonal shift to set a new expiration at any time. *

      *

      * When you start a zonal shift, you specify how long you want it to be active, which Route 53 ARC converts to * an expiry time (expiration time). You can cancel a zonal shift when you're ready to restore traffic to the * Availability Zone, or just wait for it to expire. Or you can update the zonal shift to specify another length * of time to expire in. *

      * * @param expiryTime * The expiry time (expiration time) for a customer-initiated zonal shift. A zonal shift is temporary and * must be set to expire when you start the zonal shift. You can initially set a zonal shift to expire in * a maximum of three days (72 hours). However, you can update a zonal shift to set a new expiration at * any time.

      *

      * When you start a zonal shift, you specify how long you want it to be active, which Route 53 ARC * converts to an expiry time (expiration time). You can cancel a zonal shift when you're ready to * restore traffic to the Availability Zone, or just wait for it to expire. Or you can update the zonal * shift to specify another length of time to expire in. * @return Returns a reference to this object so that method calls can be chained together. */ Builder expiryTime(Instant expiryTime); /** *

      * The identifier for the resource that Amazon Web Services shifts traffic for. The identifier is the Amazon * Resource Name (ARN) for the resource. *

      *

      * At this time, supported resources are Network Load Balancers and Application Load Balancers with cross-zone * load balancing turned off. *

      * * @param resourceIdentifier * The identifier for the resource that Amazon Web Services shifts traffic for. The identifier is the * Amazon Resource Name (ARN) for the resource.

      *

      * At this time, supported resources are Network Load Balancers and Application Load Balancers with * cross-zone load balancing turned off. * @return Returns a reference to this object so that method calls can be chained together. */ Builder resourceIdentifier(String resourceIdentifier); /** *

      * The time (UTC) when the zonal shift starts. *

      * * @param startTime * The time (UTC) when the zonal shift starts. * @return Returns a reference to this object so that method calls can be chained together. */ Builder startTime(Instant startTime); /** *

      * A status for a zonal shift. *

      *

      * The Status for a zonal shift can have one of the following values: *

      *
        *
      • *

        * ACTIVE: The zonal shift has been started and active. *

        *
      • *
      • *

        * EXPIRED: The zonal shift has expired (the expiry time was exceeded). *

        *
      • *
      • *

        * CANCELED: The zonal shift was canceled. *

        *
      • *
      * * @param status * A status for a zonal shift.

      *

      * The Status for a zonal shift can have one of the following values: *

      *
        *
      • *

        * ACTIVE: The zonal shift has been started and active. *

        *
      • *
      • *

        * EXPIRED: The zonal shift has expired (the expiry time was exceeded). *

        *
      • *
      • *

        * CANCELED: The zonal shift was canceled. *

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

        * A status for a zonal shift. *

        *

        * The Status for a zonal shift can have one of the following values: *

        *
          *
        • *

          * ACTIVE: The zonal shift has been started and active. *

          *
        • *
        • *

          * EXPIRED: The zonal shift has expired (the expiry time was exceeded). *

          *
        • *
        • *

          * CANCELED: The zonal shift was canceled. *

          *
        • *
        * * @param status * A status for a zonal shift.

        *

        * The Status for a zonal shift can have one of the following values: *

        *
          *
        • *

          * ACTIVE: The zonal shift has been started and active. *

          *
        • *
        • *

          * EXPIRED: The zonal shift has expired (the expiry time was exceeded). *

          *
        • *
        • *

          * CANCELED: The zonal shift was canceled. *

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

          * The identifier of a zonal shift. *

          * * @param zonalShiftId * The identifier of a zonal shift. * @return Returns a reference to this object so that method calls can be chained together. */ Builder zonalShiftId(String zonalShiftId); } static final class BuilderImpl extends ArcZonalShiftResponse.BuilderImpl implements Builder { private String awayFrom; private String comment; private Instant expiryTime; private String resourceIdentifier; private Instant startTime; private String status; private String zonalShiftId; private BuilderImpl() { } private BuilderImpl(StartZonalShiftResponse model) { super(model); awayFrom(model.awayFrom); comment(model.comment); expiryTime(model.expiryTime); resourceIdentifier(model.resourceIdentifier); startTime(model.startTime); status(model.status); zonalShiftId(model.zonalShiftId); } public final String getAwayFrom() { return awayFrom; } public final void setAwayFrom(String awayFrom) { this.awayFrom = awayFrom; } @Override public final Builder awayFrom(String awayFrom) { this.awayFrom = awayFrom; return this; } public final String getComment() { return comment; } public final void setComment(String comment) { this.comment = comment; } @Override public final Builder comment(String comment) { this.comment = comment; return this; } public final Instant getExpiryTime() { return expiryTime; } public final void setExpiryTime(Instant expiryTime) { this.expiryTime = expiryTime; } @Override public final Builder expiryTime(Instant expiryTime) { this.expiryTime = expiryTime; return this; } public final String getResourceIdentifier() { return resourceIdentifier; } public final void setResourceIdentifier(String resourceIdentifier) { this.resourceIdentifier = resourceIdentifier; } @Override public final Builder resourceIdentifier(String resourceIdentifier) { this.resourceIdentifier = resourceIdentifier; return this; } public final Instant getStartTime() { return startTime; } public final void setStartTime(Instant startTime) { this.startTime = startTime; } @Override public final Builder startTime(Instant startTime) { this.startTime = startTime; 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(ZonalShiftStatus status) { this.status(status == null ? null : status.toString()); return this; } public final String getZonalShiftId() { return zonalShiftId; } public final void setZonalShiftId(String zonalShiftId) { this.zonalShiftId = zonalShiftId; } @Override public final Builder zonalShiftId(String zonalShiftId) { this.zonalShiftId = zonalShiftId; return this; } @Override public StartZonalShiftResponse build() { return new StartZonalShiftResponse(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy