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

* Represents a scaling policy to use with Application Auto Scaling. *

*

* For more information about configuring scaling policies for a specific service, see Amazon Web * Services services that you can use with Application Auto Scaling in the Application Auto Scaling User * Guide. *

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

* The Amazon Resource Name (ARN) of the scaling policy. *

*/ private String policyARN; /** *

* The name of the scaling policy. *

*/ private String policyName; /** *

* The namespace of the Amazon Web Services service that provides the resource, or a custom-resource. *

*/ private String serviceNamespace; /** *

* The identifier of the resource associated with the scaling policy. This string consists of the resource type and * unique identifier. *

* */ private String resourceId; /** *

* The scalable dimension. This string consists of the service namespace, resource type, and scaling property. *

* */ private String scalableDimension; /** *

* The scaling policy type. *

*

* The following policy types are supported: *

*

* TargetTrackingScaling—Not supported for Amazon EMR *

*

* StepScaling—Not supported for DynamoDB, Amazon Comprehend, Lambda, Amazon Keyspaces, Amazon MSK, * Amazon ElastiCache, or Neptune. *

*/ private String policyType; /** *

* A step scaling policy. *

*/ private StepScalingPolicyConfiguration stepScalingPolicyConfiguration; /** *

* A target tracking scaling policy. *

*/ private TargetTrackingScalingPolicyConfiguration targetTrackingScalingPolicyConfiguration; /** *

* The CloudWatch alarms associated with the scaling policy. *

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

* The Unix timestamp for when the scaling policy was created. *

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

* The Amazon Resource Name (ARN) of the scaling policy. *

* * @param policyARN * The Amazon Resource Name (ARN) of the scaling policy. */ public void setPolicyARN(String policyARN) { this.policyARN = policyARN; } /** *

* The Amazon Resource Name (ARN) of the scaling policy. *

* * @return The Amazon Resource Name (ARN) of the scaling policy. */ public String getPolicyARN() { return this.policyARN; } /** *

* The Amazon Resource Name (ARN) of the scaling policy. *

* * @param policyARN * The Amazon Resource Name (ARN) of the scaling policy. * @return Returns a reference to this object so that method calls can be chained together. */ public ScalingPolicy withPolicyARN(String policyARN) { setPolicyARN(policyARN); return this; } /** *

* The name of the scaling policy. *

* * @param policyName * The name of the scaling policy. */ public void setPolicyName(String policyName) { this.policyName = policyName; } /** *

* The name of the scaling policy. *

* * @return The name of the scaling policy. */ public String getPolicyName() { return this.policyName; } /** *

* The name of the scaling policy. *

* * @param policyName * The name of the scaling policy. * @return Returns a reference to this object so that method calls can be chained together. */ public ScalingPolicy withPolicyName(String policyName) { setPolicyName(policyName); return this; } /** *

* The namespace of the Amazon Web Services service that provides the resource, or a custom-resource. *

* * @param serviceNamespace * The namespace of the Amazon Web Services service that provides the resource, or a * custom-resource. * @see ServiceNamespace */ public void setServiceNamespace(String serviceNamespace) { this.serviceNamespace = serviceNamespace; } /** *

* The namespace of the Amazon Web Services service that provides the resource, or a custom-resource. *

* * @return The namespace of the Amazon Web Services service that provides the resource, or a * custom-resource. * @see ServiceNamespace */ public String getServiceNamespace() { return this.serviceNamespace; } /** *

* The namespace of the Amazon Web Services service that provides the resource, or a custom-resource. *

* * @param serviceNamespace * The namespace of the Amazon Web Services service that provides the resource, or a * custom-resource. * @return Returns a reference to this object so that method calls can be chained together. * @see ServiceNamespace */ public ScalingPolicy withServiceNamespace(String serviceNamespace) { setServiceNamespace(serviceNamespace); return this; } /** *

* The namespace of the Amazon Web Services service that provides the resource, or a custom-resource. *

* * @param serviceNamespace * The namespace of the Amazon Web Services service that provides the resource, or a * custom-resource. * @see ServiceNamespace */ public void setServiceNamespace(ServiceNamespace serviceNamespace) { withServiceNamespace(serviceNamespace); } /** *

* The namespace of the Amazon Web Services service that provides the resource, or a custom-resource. *

* * @param serviceNamespace * The namespace of the Amazon Web Services service that provides the resource, or a * custom-resource. * @return Returns a reference to this object so that method calls can be chained together. * @see ServiceNamespace */ public ScalingPolicy withServiceNamespace(ServiceNamespace serviceNamespace) { this.serviceNamespace = serviceNamespace.toString(); return this; } /** *

* The identifier of the resource associated with the scaling policy. This string consists of the resource type and * unique identifier. *

* * * @param resourceId * The identifier of the resource associated with the scaling policy. This string consists of the resource * type and unique identifier.

*