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

software.amazon.awssdk.services.autoscaling.model.ScheduledUpdateGroupAction Maven / Gradle / Ivy

Go to download

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

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

import java.io.Serializable;
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;

/**
 * 

* Describes a scheduled scaling action. *

*/ @Generated("software.amazon.awssdk:codegen") public final class ScheduledUpdateGroupAction implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField AUTO_SCALING_GROUP_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("AutoScalingGroupName").getter(getter(ScheduledUpdateGroupAction::autoScalingGroupName)) .setter(setter(Builder::autoScalingGroupName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AutoScalingGroupName").build()) .build(); private static final SdkField SCHEDULED_ACTION_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ScheduledActionName").getter(getter(ScheduledUpdateGroupAction::scheduledActionName)) .setter(setter(Builder::scheduledActionName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ScheduledActionName").build()) .build(); private static final SdkField SCHEDULED_ACTION_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ScheduledActionARN").getter(getter(ScheduledUpdateGroupAction::scheduledActionARN)) .setter(setter(Builder::scheduledActionARN)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ScheduledActionARN").build()) .build(); private static final SdkField TIME_FIELD = SdkField. builder(MarshallingType.INSTANT).memberName("Time") .getter(getter(ScheduledUpdateGroupAction::time)).setter(setter(Builder::time)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Time").build()).build(); private static final SdkField START_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("StartTime").getter(getter(ScheduledUpdateGroupAction::startTime)).setter(setter(Builder::startTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StartTime").build()).build(); private static final SdkField END_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("EndTime").getter(getter(ScheduledUpdateGroupAction::endTime)).setter(setter(Builder::endTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EndTime").build()).build(); private static final SdkField RECURRENCE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("Recurrence").getter(getter(ScheduledUpdateGroupAction::recurrence)).setter(setter(Builder::recurrence)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Recurrence").build()).build(); private static final SdkField MIN_SIZE_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("MinSize").getter(getter(ScheduledUpdateGroupAction::minSize)).setter(setter(Builder::minSize)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MinSize").build()).build(); private static final SdkField MAX_SIZE_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("MaxSize").getter(getter(ScheduledUpdateGroupAction::maxSize)).setter(setter(Builder::maxSize)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MaxSize").build()).build(); private static final SdkField DESIRED_CAPACITY_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("DesiredCapacity").getter(getter(ScheduledUpdateGroupAction::desiredCapacity)) .setter(setter(Builder::desiredCapacity)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DesiredCapacity").build()).build(); private static final SdkField TIME_ZONE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("TimeZone").getter(getter(ScheduledUpdateGroupAction::timeZone)).setter(setter(Builder::timeZone)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TimeZone").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(AUTO_SCALING_GROUP_NAME_FIELD, SCHEDULED_ACTION_NAME_FIELD, SCHEDULED_ACTION_ARN_FIELD, TIME_FIELD, START_TIME_FIELD, END_TIME_FIELD, RECURRENCE_FIELD, MIN_SIZE_FIELD, MAX_SIZE_FIELD, DESIRED_CAPACITY_FIELD, TIME_ZONE_FIELD)); private static final long serialVersionUID = 1L; private final String autoScalingGroupName; private final String scheduledActionName; private final String scheduledActionARN; private final Instant time; private final Instant startTime; private final Instant endTime; private final String recurrence; private final Integer minSize; private final Integer maxSize; private final Integer desiredCapacity; private final String timeZone; private ScheduledUpdateGroupAction(BuilderImpl builder) { this.autoScalingGroupName = builder.autoScalingGroupName; this.scheduledActionName = builder.scheduledActionName; this.scheduledActionARN = builder.scheduledActionARN; this.time = builder.time; this.startTime = builder.startTime; this.endTime = builder.endTime; this.recurrence = builder.recurrence; this.minSize = builder.minSize; this.maxSize = builder.maxSize; this.desiredCapacity = builder.desiredCapacity; this.timeZone = builder.timeZone; } /** *

* The name of the Auto Scaling group. *

* * @return The name of the Auto Scaling group. */ public final String autoScalingGroupName() { return autoScalingGroupName; } /** *

* The name of the scheduled action. *

* * @return The name of the scheduled action. */ public final String scheduledActionName() { return scheduledActionName; } /** *

* The Amazon Resource Name (ARN) of the scheduled action. *

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

* This property is no longer used. *

* * @return This property is no longer used. */ public final Instant time() { return time; } /** *

* The date and time in UTC for this action to start. For example, "2019-06-01T00:00:00Z". *

* * @return The date and time in UTC for this action to start. For example, "2019-06-01T00:00:00Z". */ public final Instant startTime() { return startTime; } /** *

* The date and time in UTC for the recurring schedule to end. For example, "2019-06-01T00:00:00Z". *

* * @return The date and time in UTC for the recurring schedule to end. For example, * "2019-06-01T00:00:00Z". */ public final Instant endTime() { return endTime; } /** *

* The recurring schedule for the action, in Unix cron syntax format. *

*

* When StartTime and EndTime are specified with Recurrence, they form the * boundaries of when the recurring action starts and stops. *

* * @return The recurring schedule for the action, in Unix cron syntax format.

*

* When StartTime and EndTime are specified with Recurrence, they * form the boundaries of when the recurring action starts and stops. */ public final String recurrence() { return recurrence; } /** *

* The minimum size of the Auto Scaling group. *

* * @return The minimum size of the Auto Scaling group. */ public final Integer minSize() { return minSize; } /** *

* The maximum size of the Auto Scaling group. *

* * @return The maximum size of the Auto Scaling group. */ public final Integer maxSize() { return maxSize; } /** *

* The desired capacity is the initial capacity of the Auto Scaling group after the scheduled action runs and the * capacity it attempts to maintain. *

* * @return The desired capacity is the initial capacity of the Auto Scaling group after the scheduled action runs * and the capacity it attempts to maintain. */ public final Integer desiredCapacity() { return desiredCapacity; } /** *

* The time zone for the cron expression. *

* * @return The time zone for the cron expression. */ public final String timeZone() { return timeZone; } @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(autoScalingGroupName()); hashCode = 31 * hashCode + Objects.hashCode(scheduledActionName()); hashCode = 31 * hashCode + Objects.hashCode(scheduledActionARN()); hashCode = 31 * hashCode + Objects.hashCode(time()); hashCode = 31 * hashCode + Objects.hashCode(startTime()); hashCode = 31 * hashCode + Objects.hashCode(endTime()); hashCode = 31 * hashCode + Objects.hashCode(recurrence()); hashCode = 31 * hashCode + Objects.hashCode(minSize()); hashCode = 31 * hashCode + Objects.hashCode(maxSize()); hashCode = 31 * hashCode + Objects.hashCode(desiredCapacity()); hashCode = 31 * hashCode + Objects.hashCode(timeZone()); 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 ScheduledUpdateGroupAction)) { return false; } ScheduledUpdateGroupAction other = (ScheduledUpdateGroupAction) obj; return Objects.equals(autoScalingGroupName(), other.autoScalingGroupName()) && Objects.equals(scheduledActionName(), other.scheduledActionName()) && Objects.equals(scheduledActionARN(), other.scheduledActionARN()) && Objects.equals(time(), other.time()) && Objects.equals(startTime(), other.startTime()) && Objects.equals(endTime(), other.endTime()) && Objects.equals(recurrence(), other.recurrence()) && Objects.equals(minSize(), other.minSize()) && Objects.equals(maxSize(), other.maxSize()) && Objects.equals(desiredCapacity(), other.desiredCapacity()) && Objects.equals(timeZone(), other.timeZone()); } /** * 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("ScheduledUpdateGroupAction").add("AutoScalingGroupName", autoScalingGroupName()) .add("ScheduledActionName", scheduledActionName()).add("ScheduledActionARN", scheduledActionARN()) .add("Time", time()).add("StartTime", startTime()).add("EndTime", endTime()).add("Recurrence", recurrence()) .add("MinSize", minSize()).add("MaxSize", maxSize()).add("DesiredCapacity", desiredCapacity()) .add("TimeZone", timeZone()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "AutoScalingGroupName": return Optional.ofNullable(clazz.cast(autoScalingGroupName())); case "ScheduledActionName": return Optional.ofNullable(clazz.cast(scheduledActionName())); case "ScheduledActionARN": return Optional.ofNullable(clazz.cast(scheduledActionARN())); case "Time": return Optional.ofNullable(clazz.cast(time())); case "StartTime": return Optional.ofNullable(clazz.cast(startTime())); case "EndTime": return Optional.ofNullable(clazz.cast(endTime())); case "Recurrence": return Optional.ofNullable(clazz.cast(recurrence())); case "MinSize": return Optional.ofNullable(clazz.cast(minSize())); case "MaxSize": return Optional.ofNullable(clazz.cast(maxSize())); case "DesiredCapacity": return Optional.ofNullable(clazz.cast(desiredCapacity())); case "TimeZone": return Optional.ofNullable(clazz.cast(timeZone())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((ScheduledUpdateGroupAction) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The name of the Auto Scaling group. *

* * @param autoScalingGroupName * The name of the Auto Scaling group. * @return Returns a reference to this object so that method calls can be chained together. */ Builder autoScalingGroupName(String autoScalingGroupName); /** *

* The name of the scheduled action. *

* * @param scheduledActionName * The name of the scheduled action. * @return Returns a reference to this object so that method calls can be chained together. */ Builder scheduledActionName(String scheduledActionName); /** *

* The Amazon Resource Name (ARN) of the scheduled action. *

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

* This property is no longer used. *

* * @param time * This property is no longer used. * @return Returns a reference to this object so that method calls can be chained together. */ Builder time(Instant time); /** *

* The date and time in UTC for this action to start. For example, "2019-06-01T00:00:00Z". *

* * @param startTime * The date and time in UTC for this action to start. For example, "2019-06-01T00:00:00Z". * @return Returns a reference to this object so that method calls can be chained together. */ Builder startTime(Instant startTime); /** *

* The date and time in UTC for the recurring schedule to end. For example, "2019-06-01T00:00:00Z". *

* * @param endTime * The date and time in UTC for the recurring schedule to end. For example, * "2019-06-01T00:00:00Z". * @return Returns a reference to this object so that method calls can be chained together. */ Builder endTime(Instant endTime); /** *

* The recurring schedule for the action, in Unix cron syntax format. *

*

* When StartTime and EndTime are specified with Recurrence, they form * the boundaries of when the recurring action starts and stops. *

* * @param recurrence * The recurring schedule for the action, in Unix cron syntax format.

*

* When StartTime and EndTime are specified with Recurrence, they * form the boundaries of when the recurring action starts and stops. * @return Returns a reference to this object so that method calls can be chained together. */ Builder recurrence(String recurrence); /** *

* The minimum size of the Auto Scaling group. *

* * @param minSize * The minimum size of the Auto Scaling group. * @return Returns a reference to this object so that method calls can be chained together. */ Builder minSize(Integer minSize); /** *

* The maximum size of the Auto Scaling group. *

* * @param maxSize * The maximum size of the Auto Scaling group. * @return Returns a reference to this object so that method calls can be chained together. */ Builder maxSize(Integer maxSize); /** *

* The desired capacity is the initial capacity of the Auto Scaling group after the scheduled action runs and * the capacity it attempts to maintain. *

* * @param desiredCapacity * The desired capacity is the initial capacity of the Auto Scaling group after the scheduled action runs * and the capacity it attempts to maintain. * @return Returns a reference to this object so that method calls can be chained together. */ Builder desiredCapacity(Integer desiredCapacity); /** *

* The time zone for the cron expression. *

* * @param timeZone * The time zone for the cron expression. * @return Returns a reference to this object so that method calls can be chained together. */ Builder timeZone(String timeZone); } static final class BuilderImpl implements Builder { private String autoScalingGroupName; private String scheduledActionName; private String scheduledActionARN; private Instant time; private Instant startTime; private Instant endTime; private String recurrence; private Integer minSize; private Integer maxSize; private Integer desiredCapacity; private String timeZone; private BuilderImpl() { } private BuilderImpl(ScheduledUpdateGroupAction model) { autoScalingGroupName(model.autoScalingGroupName); scheduledActionName(model.scheduledActionName); scheduledActionARN(model.scheduledActionARN); time(model.time); startTime(model.startTime); endTime(model.endTime); recurrence(model.recurrence); minSize(model.minSize); maxSize(model.maxSize); desiredCapacity(model.desiredCapacity); timeZone(model.timeZone); } public final String getAutoScalingGroupName() { return autoScalingGroupName; } public final void setAutoScalingGroupName(String autoScalingGroupName) { this.autoScalingGroupName = autoScalingGroupName; } @Override public final Builder autoScalingGroupName(String autoScalingGroupName) { this.autoScalingGroupName = autoScalingGroupName; return this; } public final String getScheduledActionName() { return scheduledActionName; } public final void setScheduledActionName(String scheduledActionName) { this.scheduledActionName = scheduledActionName; } @Override public final Builder scheduledActionName(String scheduledActionName) { this.scheduledActionName = scheduledActionName; return this; } public final String getScheduledActionARN() { return scheduledActionARN; } public final void setScheduledActionARN(String scheduledActionARN) { this.scheduledActionARN = scheduledActionARN; } @Override public final Builder scheduledActionARN(String scheduledActionARN) { this.scheduledActionARN = scheduledActionARN; return this; } public final Instant getTime() { return time; } public final void setTime(Instant time) { this.time = time; } @Override public final Builder time(Instant time) { this.time = time; 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 Instant getEndTime() { return endTime; } public final void setEndTime(Instant endTime) { this.endTime = endTime; } @Override public final Builder endTime(Instant endTime) { this.endTime = endTime; return this; } public final String getRecurrence() { return recurrence; } public final void setRecurrence(String recurrence) { this.recurrence = recurrence; } @Override public final Builder recurrence(String recurrence) { this.recurrence = recurrence; return this; } public final Integer getMinSize() { return minSize; } public final void setMinSize(Integer minSize) { this.minSize = minSize; } @Override public final Builder minSize(Integer minSize) { this.minSize = minSize; return this; } public final Integer getMaxSize() { return maxSize; } public final void setMaxSize(Integer maxSize) { this.maxSize = maxSize; } @Override public final Builder maxSize(Integer maxSize) { this.maxSize = maxSize; return this; } public final Integer getDesiredCapacity() { return desiredCapacity; } public final void setDesiredCapacity(Integer desiredCapacity) { this.desiredCapacity = desiredCapacity; } @Override public final Builder desiredCapacity(Integer desiredCapacity) { this.desiredCapacity = desiredCapacity; return this; } public final String getTimeZone() { return timeZone; } public final void setTimeZone(String timeZone) { this.timeZone = timeZone; } @Override public final Builder timeZone(String timeZone) { this.timeZone = timeZone; return this; } @Override public ScheduledUpdateGroupAction build() { return new ScheduledUpdateGroupAction(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy