/* * 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.gamelift.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; /** * * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class PutScalingPolicyRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *

* A descriptive label that is associated with a fleet's scaling policy. Policy names do not need to be unique. A * fleet can have only one scaling policy with the same name. *

*/ private String name; /** *

* A unique identifier for the fleet to apply this policy to. You can use either the fleet ID or ARN value. The * fleet cannot be in any of the following statuses: ERROR or DELETING. *

*/ private String fleetId; /** *

* Amount of adjustment to make, based on the scaling adjustment type. *

*/ private Integer scalingAdjustment; /** *

* The type of adjustment to make to a fleet's instance count: *

* */ private String scalingAdjustmentType; /** *

* Metric value used to trigger a scaling event. *

*/ private Double threshold; /** *

* Comparison operator to use when measuring the metric against the threshold value. *

*/ private String comparisonOperator; /** *

* Length of time (in minutes) the metric must be at or beyond the threshold before a scaling event is triggered. *

*/ private Integer evaluationPeriods; /** *

* Name of the Amazon GameLift-defined metric that is used to trigger a scaling adjustment. For detailed * descriptions of fleet metrics, see Monitor Amazon * GameLift with Amazon CloudWatch. *

* */ private String metricName; /** *

* The type of scaling policy to create. For a target-based policy, set the parameter MetricName to * 'PercentAvailableGameSessions' and specify a TargetConfiguration. For a rule-based policy set the * following parameters: MetricName, ComparisonOperator, Threshold, EvaluationPeriods, * ScalingAdjustmentType, and ScalingAdjustment. *

*/ private String policyType; /** *

* An object that contains settings for a target-based scaling policy. *

*/ private TargetConfiguration targetConfiguration; /** *

* A descriptive label that is associated with a fleet's scaling policy. Policy names do not need to be unique. A * fleet can have only one scaling policy with the same name. *

* * @param name * A descriptive label that is associated with a fleet's scaling policy. Policy names do not need to be * unique. A fleet can have only one scaling policy with the same name. */ public void setName(String name) { this.name = name; } /** *

* A descriptive label that is associated with a fleet's scaling policy. Policy names do not need to be unique. A * fleet can have only one scaling policy with the same name. *

* * @return A descriptive label that is associated with a fleet's scaling policy. Policy names do not need to be * unique. A fleet can have only one scaling policy with the same name. */ public String getName() { return this.name; } /** *

* A descriptive label that is associated with a fleet's scaling policy. Policy names do not need to be unique. A * fleet can have only one scaling policy with the same name. *

* * @param name * A descriptive label that is associated with a fleet's scaling policy. Policy names do not need to be * unique. A fleet can have only one scaling policy with the same name. * @return Returns a reference to this object so that method calls can be chained together. */ public PutScalingPolicyRequest withName(String name) { setName(name); return this; } /** *

* A unique identifier for the fleet to apply this policy to. You can use either the fleet ID or ARN value. The * fleet cannot be in any of the following statuses: ERROR or DELETING. *

* * @param fleetId * A unique identifier for the fleet to apply this policy to. You can use either the fleet ID or ARN value. * The fleet cannot be in any of the following statuses: ERROR or DELETING. */ public void setFleetId(String fleetId) { this.fleetId = fleetId; } /** *

* A unique identifier for the fleet to apply this policy to. You can use either the fleet ID or ARN value. The * fleet cannot be in any of the following statuses: ERROR or DELETING. *

* * @return A unique identifier for the fleet to apply this policy to. You can use either the fleet ID or ARN value. * The fleet cannot be in any of the following statuses: ERROR or DELETING. */ public String getFleetId() { return this.fleetId; } /** *

* A unique identifier for the fleet to apply this policy to. You can use either the fleet ID or ARN value. The * fleet cannot be in any of the following statuses: ERROR or DELETING. *

* * @param fleetId * A unique identifier for the fleet to apply this policy to. You can use either the fleet ID or ARN value. * The fleet cannot be in any of the following statuses: ERROR or DELETING. * @return Returns a reference to this object so that method calls can be chained together. */ public PutScalingPolicyRequest withFleetId(String fleetId) { setFleetId(fleetId); return this; } /** *

* Amount of adjustment to make, based on the scaling adjustment type. *

* * @param scalingAdjustment * Amount of adjustment to make, based on the scaling adjustment type. */ public void setScalingAdjustment(Integer scalingAdjustment) { this.scalingAdjustment = scalingAdjustment; } /** *

* Amount of adjustment to make, based on the scaling adjustment type. *

* * @return Amount of adjustment to make, based on the scaling adjustment type. */ public Integer getScalingAdjustment() { return this.scalingAdjustment; } /** *

* Amount of adjustment to make, based on the scaling adjustment type. *

* * @param scalingAdjustment * Amount of adjustment to make, based on the scaling adjustment type. * @return Returns a reference to this object so that method calls can be chained together. */ public PutScalingPolicyRequest withScalingAdjustment(Integer scalingAdjustment) { setScalingAdjustment(scalingAdjustment); return this; } /** *

* The type of adjustment to make to a fleet's instance count: *

* * * @param scalingAdjustmentType * The type of adjustment to make to a fleet's instance count:

*