All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.azurenative.insights.inputs.ScaleActionArgs Maven / Gradle / Ivy

There is a newer version: 2.78.0
Show newest version
// *** 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.azurenative.insights.inputs;

import com.pulumi.azurenative.insights.enums.ScaleDirection;
import com.pulumi.azurenative.insights.enums.ScaleType;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.core.internal.Codegen;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


/**
 * The parameters for the scaling action.
 * 
 */
public final class ScaleActionArgs extends com.pulumi.resources.ResourceArgs {

    public static final ScaleActionArgs Empty = new ScaleActionArgs();

    /**
     * the amount of time to wait since the last scaling action before this action occurs. It must be between 1 week and 1 minute in ISO 8601 format.
     * 
     */
    @Import(name="cooldown", required=true)
    private Output cooldown;

    /**
     * @return the amount of time to wait since the last scaling action before this action occurs. It must be between 1 week and 1 minute in ISO 8601 format.
     * 
     */
    public Output cooldown() {
        return this.cooldown;
    }

    /**
     * the scale direction. Whether the scaling action increases or decreases the number of instances.
     * 
     */
    @Import(name="direction", required=true)
    private Output direction;

    /**
     * @return the scale direction. Whether the scaling action increases or decreases the number of instances.
     * 
     */
    public Output direction() {
        return this.direction;
    }

    /**
     * the type of action that should occur when the scale rule fires.
     * 
     */
    @Import(name="type", required=true)
    private Output type;

    /**
     * @return the type of action that should occur when the scale rule fires.
     * 
     */
    public Output type() {
        return this.type;
    }

    /**
     * the number of instances that are involved in the scaling action. This value must be 1 or greater. The default value is 1.
     * 
     */
    @Import(name="value")
    private @Nullable Output value;

    /**
     * @return the number of instances that are involved in the scaling action. This value must be 1 or greater. The default value is 1.
     * 
     */
    public Optional> value() {
        return Optional.ofNullable(this.value);
    }

    private ScaleActionArgs() {}

    private ScaleActionArgs(ScaleActionArgs $) {
        this.cooldown = $.cooldown;
        this.direction = $.direction;
        this.type = $.type;
        this.value = $.value;
    }

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

    public static final class Builder {
        private ScaleActionArgs $;

        public Builder() {
            $ = new ScaleActionArgs();
        }

        public Builder(ScaleActionArgs defaults) {
            $ = new ScaleActionArgs(Objects.requireNonNull(defaults));
        }

        /**
         * @param cooldown the amount of time to wait since the last scaling action before this action occurs. It must be between 1 week and 1 minute in ISO 8601 format.
         * 
         * @return builder
         * 
         */
        public Builder cooldown(Output cooldown) {
            $.cooldown = cooldown;
            return this;
        }

        /**
         * @param cooldown the amount of time to wait since the last scaling action before this action occurs. It must be between 1 week and 1 minute in ISO 8601 format.
         * 
         * @return builder
         * 
         */
        public Builder cooldown(String cooldown) {
            return cooldown(Output.of(cooldown));
        }

        /**
         * @param direction the scale direction. Whether the scaling action increases or decreases the number of instances.
         * 
         * @return builder
         * 
         */
        public Builder direction(Output direction) {
            $.direction = direction;
            return this;
        }

        /**
         * @param direction the scale direction. Whether the scaling action increases or decreases the number of instances.
         * 
         * @return builder
         * 
         */
        public Builder direction(ScaleDirection direction) {
            return direction(Output.of(direction));
        }

        /**
         * @param type the type of action that should occur when the scale rule fires.
         * 
         * @return builder
         * 
         */
        public Builder type(Output type) {
            $.type = type;
            return this;
        }

        /**
         * @param type the type of action that should occur when the scale rule fires.
         * 
         * @return builder
         * 
         */
        public Builder type(ScaleType type) {
            return type(Output.of(type));
        }

        /**
         * @param value the number of instances that are involved in the scaling action. This value must be 1 or greater. The default value is 1.
         * 
         * @return builder
         * 
         */
        public Builder value(@Nullable Output value) {
            $.value = value;
            return this;
        }

        /**
         * @param value the number of instances that are involved in the scaling action. This value must be 1 or greater. The default value is 1.
         * 
         * @return builder
         * 
         */
        public Builder value(String value) {
            return value(Output.of(value));
        }

        public ScaleActionArgs build() {
            if ($.cooldown == null) {
                throw new MissingRequiredPropertyException("ScaleActionArgs", "cooldown");
            }
            if ($.direction == null) {
                throw new MissingRequiredPropertyException("ScaleActionArgs", "direction");
            }
            if ($.type == null) {
                throw new MissingRequiredPropertyException("ScaleActionArgs", "type");
            }
            $.value = Codegen.stringProp("value").output().arg($.value).def("1").getNullable();
            return $;
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy