/* * Copyright 2018-2023 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 com.amazonaws.services.autoscalingplans.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *

* Represents a scaling plan. *

* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class ScalingPlan implements Serializable, Cloneable, StructuredPojo { /** *

* The name of the scaling plan. *

*/ private String scalingPlanName; /** *

* The version number of the scaling plan. *

*/ private Long scalingPlanVersion; /** *

* A CloudFormation stack or a set of tags. You can create one scaling plan per application source. *

*/ private ApplicationSource applicationSource; /** *

* The scaling instructions. *

*/ private java.util.List scalingInstructions; /** *

* The status of the scaling plan. *

* */ private String statusCode; /** *

* A simple message about the current status of the scaling plan. *

*/ private String statusMessage; /** *

* The Unix time stamp when the scaling plan entered the current status. *

*/ private java.util.Date statusStartTime; /** *

* The Unix time stamp when the scaling plan was created. *

*/ private java.util.Date creationTime; /** *

* The name of the scaling plan. *

* * @param scalingPlanName * The name of the scaling plan. */ public void setScalingPlanName(String scalingPlanName) { this.scalingPlanName = scalingPlanName; } /** *

* The name of the scaling plan. *

* * @return The name of the scaling plan. */ public String getScalingPlanName() { return this.scalingPlanName; } /** *

* The name of the scaling plan. *

* * @param scalingPlanName * The name of the scaling plan. * @return Returns a reference to this object so that method calls can be chained together. */ public ScalingPlan withScalingPlanName(String scalingPlanName) { setScalingPlanName(scalingPlanName); return this; } /** *

* The version number of the scaling plan. *

* * @param scalingPlanVersion * The version number of the scaling plan. */ public void setScalingPlanVersion(Long scalingPlanVersion) { this.scalingPlanVersion = scalingPlanVersion; } /** *

* The version number of the scaling plan. *

* * @return The version number of the scaling plan. */ public Long getScalingPlanVersion() { return this.scalingPlanVersion; } /** *

* The version number of the scaling plan. *

* * @param scalingPlanVersion * The version number of the scaling plan. * @return Returns a reference to this object so that method calls can be chained together. */ public ScalingPlan withScalingPlanVersion(Long scalingPlanVersion) { setScalingPlanVersion(scalingPlanVersion); return this; } /** *

* A CloudFormation stack or a set of tags. You can create one scaling plan per application source. *

* * @param applicationSource * A CloudFormation stack or a set of tags. You can create one scaling plan per application source. */ public void setApplicationSource(ApplicationSource applicationSource) { this.applicationSource = applicationSource; } /** *

* A CloudFormation stack or a set of tags. You can create one scaling plan per application source. *

* * @return A CloudFormation stack or a set of tags. You can create one scaling plan per application source. */ public ApplicationSource getApplicationSource() { return this.applicationSource; } /** *

* A CloudFormation stack or a set of tags. You can create one scaling plan per application source. *

* * @param applicationSource * A CloudFormation stack or a set of tags. You can create one scaling plan per application source. * @return Returns a reference to this object so that method calls can be chained together. */ public ScalingPlan withApplicationSource(ApplicationSource applicationSource) { setApplicationSource(applicationSource); return this; } /** *

* The scaling instructions. *

* * @return The scaling instructions. */ public java.util.List getScalingInstructions() { return scalingInstructions; } /** *

* The scaling instructions. *

* * @param scalingInstructions * The scaling instructions. */ public void setScalingInstructions(java.util.Collection scalingInstructions) { if (scalingInstructions == null) { this.scalingInstructions = null; return; } this.scalingInstructions = new java.util.ArrayList(scalingInstructions); } /** *

* The scaling instructions. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setScalingInstructions(java.util.Collection)} or {@link #withScalingInstructions(java.util.Collection)} * if you want to override the existing values. *

* * @param scalingInstructions * The scaling instructions. * @return Returns a reference to this object so that method calls can be chained together. */ public ScalingPlan withScalingInstructions(ScalingInstruction... scalingInstructions) { if (this.scalingInstructions == null) { setScalingInstructions(new java.util.ArrayList(scalingInstructions.length)); } for (ScalingInstruction ele : scalingInstructions) { this.scalingInstructions.add(ele); } return this; } /** *

* The scaling instructions. *

* * @param scalingInstructions * The scaling instructions. * @return Returns a reference to this object so that method calls can be chained together. */ public ScalingPlan withScalingInstructions(java.util.Collection scalingInstructions) { setScalingInstructions(scalingInstructions); return this; } /** *

* The status of the scaling plan. *

*
    *
  • *

    * Active - The scaling plan is active. *

    *
  • *
  • *

    * ActiveWithProblems - The scaling plan is active, but the scaling configuration for one or more * resources could not be applied. *

    *
  • *
  • *

    * CreationInProgress - The scaling plan is being created. *

    *
  • *
  • *

    * CreationFailed - The scaling plan could not be created. *

    *
  • *
  • *

    * DeletionInProgress - The scaling plan is being deleted. *

    *
  • *
  • *

    * DeletionFailed - The scaling plan could not be deleted. *

    *
  • *
  • *

    * UpdateInProgress - The scaling plan is being updated. *

    *
  • *
  • *

    * UpdateFailed - The scaling plan could not be updated. *

    *
  • *
* * @param statusCode * The status of the scaling plan.

*
    *
  • *

    * Active - The scaling plan is active. *

    *
  • *
  • *

    * ActiveWithProblems - The scaling plan is active, but the scaling configuration for one or * more resources could not be applied. *

    *
  • *
  • *

    * CreationInProgress - The scaling plan is being created. *

    *
  • *
  • *

    * CreationFailed - The scaling plan could not be created. *

    *
  • *
  • *

    * DeletionInProgress - The scaling plan is being deleted. *

    *
  • *
  • *

    * DeletionFailed - The scaling plan could not be deleted. *

    *
  • *
  • *

    * UpdateInProgress - The scaling plan is being updated. *

    *
  • *
  • *

    * UpdateFailed - The scaling plan could not be updated. *

    *
  • * @see ScalingPlanStatusCode */ public void setStatusCode(String statusCode) { this.statusCode = statusCode; } /** *

    * The status of the scaling plan. *

    *
      *
    • *

      * Active - The scaling plan is active. *

      *
    • *
    • *

      * ActiveWithProblems - The scaling plan is active, but the scaling configuration for one or more * resources could not be applied. *

      *
    • *
    • *

      * CreationInProgress - The scaling plan is being created. *

      *
    • *
    • *

      * CreationFailed - The scaling plan could not be created. *

      *
    • *
    • *

      * DeletionInProgress - The scaling plan is being deleted. *

      *
    • *
    • *

      * DeletionFailed - The scaling plan could not be deleted. *

      *
    • *
    • *

      * UpdateInProgress - The scaling plan is being updated. *

      *
    • *
    • *

      * UpdateFailed - The scaling plan could not be updated. *

      *
    • *
    * * @return The status of the scaling plan.

    *
      *
    • *

      * Active - The scaling plan is active. *

      *
    • *
    • *

      * ActiveWithProblems - The scaling plan is active, but the scaling configuration for one or * more resources could not be applied. *

      *
    • *
    • *

      * CreationInProgress - The scaling plan is being created. *

      *
    • *
    • *

      * CreationFailed - The scaling plan could not be created. *

      *
    • *
    • *

      * DeletionInProgress - The scaling plan is being deleted. *

      *
    • *
    • *

      * DeletionFailed - The scaling plan could not be deleted. *

      *
    • *
    • *

      * UpdateInProgress - The scaling plan is being updated. *

      *
    • *
    • *

      * UpdateFailed - The scaling plan could not be updated. *

      *
    • * @see ScalingPlanStatusCode */ public String getStatusCode() { return this.statusCode; } /** *

      * The status of the scaling plan. *

      *
        *
      • *

        * Active - The scaling plan is active. *

        *
      • *
      • *

        * ActiveWithProblems - The scaling plan is active, but the scaling configuration for one or more * resources could not be applied. *

        *
      • *
      • *

        * CreationInProgress - The scaling plan is being created. *

        *
      • *
      • *

        * CreationFailed - The scaling plan could not be created. *

        *
      • *
      • *

        * DeletionInProgress - The scaling plan is being deleted. *

        *
      • *
      • *

        * DeletionFailed - The scaling plan could not be deleted. *

        *
      • *
      • *

        * UpdateInProgress - The scaling plan is being updated. *

        *
      • *
      • *

        * UpdateFailed - The scaling plan could not be updated. *

        *
      • *
      * * @param statusCode * The status of the scaling plan.

      *
        *
      • *

        * Active - The scaling plan is active. *

        *
      • *
      • *

        * ActiveWithProblems - The scaling plan is active, but the scaling configuration for one or * more resources could not be applied. *

        *
      • *
      • *

        * CreationInProgress - The scaling plan is being created. *

        *
      • *
      • *

        * CreationFailed - The scaling plan could not be created. *

        *
      • *
      • *

        * DeletionInProgress - The scaling plan is being deleted. *

        *
      • *
      • *

        * DeletionFailed - The scaling plan could not be deleted. *

        *
      • *
      • *

        * UpdateInProgress - The scaling plan is being updated. *

        *
      • *
      • *

        * UpdateFailed - The scaling plan could not be updated. *

        *
      • * @return Returns a reference to this object so that method calls can be chained together. * @see ScalingPlanStatusCode */ public ScalingPlan withStatusCode(String statusCode) { setStatusCode(statusCode); return this; } /** *

        * The status of the scaling plan. *

        *
          *
        • *

          * Active - The scaling plan is active. *

          *
        • *
        • *

          * ActiveWithProblems - The scaling plan is active, but the scaling configuration for one or more * resources could not be applied. *

          *
        • *
        • *

          * CreationInProgress - The scaling plan is being created. *

          *
        • *
        • *

          * CreationFailed - The scaling plan could not be created. *

          *
        • *
        • *

          * DeletionInProgress - The scaling plan is being deleted. *

          *
        • *
        • *

          * DeletionFailed - The scaling plan could not be deleted. *

          *
        • *
        • *

          * UpdateInProgress - The scaling plan is being updated. *

          *
        • *
        • *

          * UpdateFailed - The scaling plan could not be updated. *

          *
        • *
        * * @param statusCode * The status of the scaling plan.

        *
          *
        • *

          * Active - The scaling plan is active. *

          *
        • *
        • *

          * ActiveWithProblems - The scaling plan is active, but the scaling configuration for one or * more resources could not be applied. *

          *
        • *
        • *

          * CreationInProgress - The scaling plan is being created. *

          *
        • *
        • *

          * CreationFailed - The scaling plan could not be created. *

          *
        • *
        • *

          * DeletionInProgress - The scaling plan is being deleted. *

          *
        • *
        • *

          * DeletionFailed - The scaling plan could not be deleted. *

          *
        • *
        • *

          * UpdateInProgress - The scaling plan is being updated. *

          *
        • *
        • *

          * UpdateFailed - The scaling plan could not be updated. *

          *
        • * @return Returns a reference to this object so that method calls can be chained together. * @see ScalingPlanStatusCode */ public ScalingPlan withStatusCode(ScalingPlanStatusCode statusCode) { this.statusCode = statusCode.toString(); return this; } /** *

          * A simple message about the current status of the scaling plan. *

          * * @param statusMessage * A simple message about the current status of the scaling plan. */ public void setStatusMessage(String statusMessage) { this.statusMessage = statusMessage; } /** *

          * A simple message about the current status of the scaling plan. *

          * * @return A simple message about the current status of the scaling plan. */ public String getStatusMessage() { return this.statusMessage; } /** *

          * A simple message about the current status of the scaling plan. *

          * * @param statusMessage * A simple message about the current status of the scaling plan. * @return Returns a reference to this object so that method calls can be chained together. */ public ScalingPlan withStatusMessage(String statusMessage) { setStatusMessage(statusMessage); return this; } /** *

          * The Unix time stamp when the scaling plan entered the current status. *

          * * @param statusStartTime * The Unix time stamp when the scaling plan entered the current status. */ public void setStatusStartTime(java.util.Date statusStartTime) { this.statusStartTime = statusStartTime; } /** *

          * The Unix time stamp when the scaling plan entered the current status. *

          * * @return The Unix time stamp when the scaling plan entered the current status. */ public java.util.Date getStatusStartTime() { return this.statusStartTime; } /** *

          * The Unix time stamp when the scaling plan entered the current status. *

          * * @param statusStartTime * The Unix time stamp when the scaling plan entered the current status. * @return Returns a reference to this object so that method calls can be chained together. */ public ScalingPlan withStatusStartTime(java.util.Date statusStartTime) { setStatusStartTime(statusStartTime); return this; } /** *

          * The Unix time stamp when the scaling plan was created. *

          * * @param creationTime * The Unix time stamp when the scaling plan was created. */ public void setCreationTime(java.util.Date creationTime) { this.creationTime = creationTime; } /** *

          * The Unix time stamp when the scaling plan was created. *

          * * @return The Unix time stamp when the scaling plan was created. */ public java.util.Date getCreationTime() { return this.creationTime; } /** *

          * The Unix time stamp when the scaling plan was created. *

          * * @param creationTime * The Unix time stamp when the scaling plan was created. * @return Returns a reference to this object so that method calls can be chained together. */ public ScalingPlan withCreationTime(java.util.Date creationTime) { setCreationTime(creationTime); return this; } /** * 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. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getScalingPlanName() != null) sb.append("ScalingPlanName: ").append(getScalingPlanName()).append(","); if (getScalingPlanVersion() != null) sb.append("ScalingPlanVersion: ").append(getScalingPlanVersion()).append(","); if (getApplicationSource() != null) sb.append("ApplicationSource: ").append(getApplicationSource()).append(","); if (getScalingInstructions() != null) sb.append("ScalingInstructions: ").append(getScalingInstructions()).append(","); if (getStatusCode() != null) sb.append("StatusCode: ").append(getStatusCode()).append(","); if (getStatusMessage() != null) sb.append("StatusMessage: ").append(getStatusMessage()).append(","); if (getStatusStartTime() != null) sb.append("StatusStartTime: ").append(getStatusStartTime()).append(","); if (getCreationTime() != null) sb.append("CreationTime: ").append(getCreationTime()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ScalingPlan == false) return false; ScalingPlan other = (ScalingPlan) obj; if (other.getScalingPlanName() == null ^ this.getScalingPlanName() == null) return false; if (other.getScalingPlanName() != null && other.getScalingPlanName().equals(this.getScalingPlanName()) == false) return false; if (other.getScalingPlanVersion() == null ^ this.getScalingPlanVersion() == null) return false; if (other.getScalingPlanVersion() != null && other.getScalingPlanVersion().equals(this.getScalingPlanVersion()) == false) return false; if (other.getApplicationSource() == null ^ this.getApplicationSource() == null) return false; if (other.getApplicationSource() != null && other.getApplicationSource().equals(this.getApplicationSource()) == false) return false; if (other.getScalingInstructions() == null ^ this.getScalingInstructions() == null) return false; if (other.getScalingInstructions() != null && other.getScalingInstructions().equals(this.getScalingInstructions()) == false) return false; if (other.getStatusCode() == null ^ this.getStatusCode() == null) return false; if (other.getStatusCode() != null && other.getStatusCode().equals(this.getStatusCode()) == false) return false; if (other.getStatusMessage() == null ^ this.getStatusMessage() == null) return false; if (other.getStatusMessage() != null && other.getStatusMessage().equals(this.getStatusMessage()) == false) return false; if (other.getStatusStartTime() == null ^ this.getStatusStartTime() == null) return false; if (other.getStatusStartTime() != null && other.getStatusStartTime().equals(this.getStatusStartTime()) == false) return false; if (other.getCreationTime() == null ^ this.getCreationTime() == null) return false; if (other.getCreationTime() != null && other.getCreationTime().equals(this.getCreationTime()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getScalingPlanName() == null) ? 0 : getScalingPlanName().hashCode()); hashCode = prime * hashCode + ((getScalingPlanVersion() == null) ? 0 : getScalingPlanVersion().hashCode()); hashCode = prime * hashCode + ((getApplicationSource() == null) ? 0 : getApplicationSource().hashCode()); hashCode = prime * hashCode + ((getScalingInstructions() == null) ? 0 : getScalingInstructions().hashCode()); hashCode = prime * hashCode + ((getStatusCode() == null) ? 0 : getStatusCode().hashCode()); hashCode = prime * hashCode + ((getStatusMessage() == null) ? 0 : getStatusMessage().hashCode()); hashCode = prime * hashCode + ((getStatusStartTime() == null) ? 0 : getStatusStartTime().hashCode()); hashCode = prime * hashCode + ((getCreationTime() == null) ? 0 : getCreationTime().hashCode()); return hashCode; } @Override public ScalingPlan clone() { try { return (ScalingPlan) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } @com.amazonaws.annotation.SdkInternalApi @Override public void marshall(ProtocolMarshaller protocolMarshaller) { com.amazonaws.services.autoscalingplans.model.transform.ScalingPlanMarshaller.getInstance().marshall(this, protocolMarshaller); } }