// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.aws.appautoscaling.outputs;

import com.pulumi.aws.appautoscaling.outputs.PolicyStepScalingPolicyConfigurationStepAdjustment;
import com.pulumi.core.annotations.CustomType;
import java.lang.Integer;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;

@CustomType
public final class PolicyStepScalingPolicyConfiguration {
    /**
     * @return Whether the adjustment is an absolute number or a percentage of the current capacity. Valid values are `ChangeInCapacity`, `ExactCapacity`, and `PercentChangeInCapacity`.
     * 
     */
    private @Nullable String adjustmentType;
    /**
     * @return Amount of time, in seconds, after a scaling activity completes and before the next scaling activity can start.
     * 
     */
    private @Nullable Integer cooldown;
    /**
     * @return Aggregation type for the policy&#39;s metrics. Valid values are &#34;Minimum&#34;, &#34;Maximum&#34;, and &#34;Average&#34;. Without a value, AWS will treat the aggregation type as &#34;Average&#34;.
     * 
     */
    private @Nullable String metricAggregationType;
    /**
     * @return Minimum number to adjust your scalable dimension as a result of a scaling activity. If the adjustment type is PercentChangeInCapacity, the scaling policy changes the scalable dimension of the scalable target by this amount.
     * 
     */
    private @Nullable Integer minAdjustmentMagnitude;
    /**
     * @return Set of adjustments that manage scaling. These have the following structure:
     * 
     */
    private @Nullable List<PolicyStepScalingPolicyConfigurationStepAdjustment> stepAdjustments;

    private PolicyStepScalingPolicyConfiguration() {}
    /**
     * @return Whether the adjustment is an absolute number or a percentage of the current capacity. Valid values are `ChangeInCapacity`, `ExactCapacity`, and `PercentChangeInCapacity`.
     * 
     */
    public Optional<String> adjustmentType() {
        return Optional.ofNullable(this.adjustmentType);
    }
    /**
     * @return Amount of time, in seconds, after a scaling activity completes and before the next scaling activity can start.
     * 
     */
    public Optional<Integer> cooldown() {
        return Optional.ofNullable(this.cooldown);
    }
    /**
     * @return Aggregation type for the policy&#39;s metrics. Valid values are &#34;Minimum&#34;, &#34;Maximum&#34;, and &#34;Average&#34;. Without a value, AWS will treat the aggregation type as &#34;Average&#34;.
     * 
     */
    public Optional<String> metricAggregationType() {
        return Optional.ofNullable(this.metricAggregationType);
    }
    /**
     * @return Minimum number to adjust your scalable dimension as a result of a scaling activity. If the adjustment type is PercentChangeInCapacity, the scaling policy changes the scalable dimension of the scalable target by this amount.
     * 
     */
    public Optional<Integer> minAdjustmentMagnitude() {
        return Optional.ofNullable(this.minAdjustmentMagnitude);
    }
    /**
     * @return Set of adjustments that manage scaling. These have the following structure:
     * 
     */
    public List<PolicyStepScalingPolicyConfigurationStepAdjustment> stepAdjustments() {
        return this.stepAdjustments == null ? List.of() : this.stepAdjustments;
    }

    public static Builder builder() {
        return new Builder();
    }

    public static Builder builder(PolicyStepScalingPolicyConfiguration defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private @Nullable String adjustmentType;
        private @Nullable Integer cooldown;
        private @Nullable String metricAggregationType;
        private @Nullable Integer minAdjustmentMagnitude;
        private @Nullable List<PolicyStepScalingPolicyConfigurationStepAdjustment> stepAdjustments;
        public Builder() {}
        public Builder(PolicyStepScalingPolicyConfiguration defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.adjustmentType = defaults.adjustmentType;
    	      this.cooldown = defaults.cooldown;
    	      this.metricAggregationType = defaults.metricAggregationType;
    	      this.minAdjustmentMagnitude = defaults.minAdjustmentMagnitude;
    	      this.stepAdjustments = defaults.stepAdjustments;
        }

        @CustomType.Setter
        public Builder adjustmentType(@Nullable String adjustmentType) {
            this.adjustmentType = adjustmentType;
            return this;
        }
        @CustomType.Setter
        public Builder cooldown(@Nullable Integer cooldown) {
            this.cooldown = cooldown;
            return this;
        }
        @CustomType.Setter
        public Builder metricAggregationType(@Nullable String metricAggregationType) {
            this.metricAggregationType = metricAggregationType;
            return this;
        }
        @CustomType.Setter
        public Builder minAdjustmentMagnitude(@Nullable Integer minAdjustmentMagnitude) {
            this.minAdjustmentMagnitude = minAdjustmentMagnitude;
            return this;
        }
        @CustomType.Setter
        public Builder stepAdjustments(@Nullable List<PolicyStepScalingPolicyConfigurationStepAdjustment> stepAdjustments) {
            this.stepAdjustments = stepAdjustments;
            return this;
        }
        public Builder stepAdjustments(PolicyStepScalingPolicyConfigurationStepAdjustment... stepAdjustments) {
            return stepAdjustments(List.of(stepAdjustments));
        }
        public PolicyStepScalingPolicyConfiguration build() {
            final var o = new PolicyStepScalingPolicyConfiguration();
            o.adjustmentType = adjustmentType;
            o.cooldown = cooldown;
            o.metricAggregationType = metricAggregationType;
            o.minAdjustmentMagnitude = minAdjustmentMagnitude;
            o.stepAdjustments = stepAdjustments;
            return o;
        }
    }
}
