// *** 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.gcp.compute.outputs;

import com.pulumi.core.annotations.CustomType;
import java.lang.Double;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;

@CustomType
public final class AutoscalarAutoscalingPolicyCpuUtilization {
    /**
     * @return Indicates whether predictive autoscaling based on CPU metric is enabled. Valid values are:
     * - NONE (default). No predictive method is used. The autoscaler scales the group to meet current demand based on real-time metrics.
     * - OPTIMIZE_AVAILABILITY. Predictive autoscaling improves availability by monitoring daily and weekly load patterns and scaling out ahead of anticipated demand.
     * 
     */
    private @Nullable String predictiveMethod;
    /**
     * @return The target CPU utilization that the autoscaler should maintain.
     * Must be a float value in the range (0, 1]. If not specified, the
     * default is 0.6.
     * If the CPU level is below the target utilization, the autoscaler
     * scales down the number of instances until it reaches the minimum
     * number of instances you specified or until the average CPU of
     * your instances reaches the target utilization.
     * If the average CPU is above the target utilization, the autoscaler
     * scales up until it reaches the maximum number of instances you
     * specified or until the average utilization reaches the target
     * utilization.
     * 
     */
    private Double target;

    private AutoscalarAutoscalingPolicyCpuUtilization() {}
    /**
     * @return Indicates whether predictive autoscaling based on CPU metric is enabled. Valid values are:
     * - NONE (default). No predictive method is used. The autoscaler scales the group to meet current demand based on real-time metrics.
     * - OPTIMIZE_AVAILABILITY. Predictive autoscaling improves availability by monitoring daily and weekly load patterns and scaling out ahead of anticipated demand.
     * 
     */
    public Optional<String> predictiveMethod() {
        return Optional.ofNullable(this.predictiveMethod);
    }
    /**
     * @return The target CPU utilization that the autoscaler should maintain.
     * Must be a float value in the range (0, 1]. If not specified, the
     * default is 0.6.
     * If the CPU level is below the target utilization, the autoscaler
     * scales down the number of instances until it reaches the minimum
     * number of instances you specified or until the average CPU of
     * your instances reaches the target utilization.
     * If the average CPU is above the target utilization, the autoscaler
     * scales up until it reaches the maximum number of instances you
     * specified or until the average utilization reaches the target
     * utilization.
     * 
     */
    public Double target() {
        return this.target;
    }

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

    public static Builder builder(AutoscalarAutoscalingPolicyCpuUtilization defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private @Nullable String predictiveMethod;
        private Double target;
        public Builder() {}
        public Builder(AutoscalarAutoscalingPolicyCpuUtilization defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.predictiveMethod = defaults.predictiveMethod;
    	      this.target = defaults.target;
        }

        @CustomType.Setter
        public Builder predictiveMethod(@Nullable String predictiveMethod) {
            this.predictiveMethod = predictiveMethod;
            return this;
        }
        @CustomType.Setter
        public Builder target(Double target) {
            this.target = Objects.requireNonNull(target);
            return this;
        }
        public AutoscalarAutoscalingPolicyCpuUtilization build() {
            final var o = new AutoscalarAutoscalingPolicyCpuUtilization();
            o.predictiveMethod = predictiveMethod;
            o.target = target;
            return o;
        }
    }
}
