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

com.pulumi.googlenative.osconfig.v1beta.inputs.SoftwareRecipeStepRunScriptArgs Maven / Gradle / Ivy

// *** 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.googlenative.osconfig.v1beta.inputs;

import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.googlenative.osconfig.v1beta.enums.SoftwareRecipeStepRunScriptInterpreter;
import java.lang.Integer;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


/**
 * Runs a script through an interpreter.
 * 
 */
public final class SoftwareRecipeStepRunScriptArgs extends com.pulumi.resources.ResourceArgs {

    public static final SoftwareRecipeStepRunScriptArgs Empty = new SoftwareRecipeStepRunScriptArgs();

    /**
     * Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
     * 
     */
    @Import(name="allowedExitCodes")
    private @Nullable Output> allowedExitCodes;

    /**
     * @return Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
     * 
     */
    public Optional>> allowedExitCodes() {
        return Optional.ofNullable(this.allowedExitCodes);
    }

    /**
     * The script interpreter to use to run the script. If no interpreter is specified the script is executed directly, which likely only succeed for scripts with [shebang lines](<https://en.wikipedia.org/wiki/Shebang_\(Unix\)>).
     * 
     */
    @Import(name="interpreter")
    private @Nullable Output interpreter;

    /**
     * @return The script interpreter to use to run the script. If no interpreter is specified the script is executed directly, which likely only succeed for scripts with [shebang lines](<https://en.wikipedia.org/wiki/Shebang_\(Unix\)>).
     * 
     */
    public Optional> interpreter() {
        return Optional.ofNullable(this.interpreter);
    }

    /**
     * The shell script to be executed.
     * 
     */
    @Import(name="script", required=true)
    private Output script;

    /**
     * @return The shell script to be executed.
     * 
     */
    public Output script() {
        return this.script;
    }

    private SoftwareRecipeStepRunScriptArgs() {}

    private SoftwareRecipeStepRunScriptArgs(SoftwareRecipeStepRunScriptArgs $) {
        this.allowedExitCodes = $.allowedExitCodes;
        this.interpreter = $.interpreter;
        this.script = $.script;
    }

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

    public static final class Builder {
        private SoftwareRecipeStepRunScriptArgs $;

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

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

        /**
         * @param allowedExitCodes Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
         * 
         * @return builder
         * 
         */
        public Builder allowedExitCodes(@Nullable Output> allowedExitCodes) {
            $.allowedExitCodes = allowedExitCodes;
            return this;
        }

        /**
         * @param allowedExitCodes Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
         * 
         * @return builder
         * 
         */
        public Builder allowedExitCodes(List allowedExitCodes) {
            return allowedExitCodes(Output.of(allowedExitCodes));
        }

        /**
         * @param allowedExitCodes Return codes that indicate that the software installed or updated successfully. Behaviour defaults to [0]
         * 
         * @return builder
         * 
         */
        public Builder allowedExitCodes(Integer... allowedExitCodes) {
            return allowedExitCodes(List.of(allowedExitCodes));
        }

        /**
         * @param interpreter The script interpreter to use to run the script. If no interpreter is specified the script is executed directly, which likely only succeed for scripts with [shebang lines](<https://en.wikipedia.org/wiki/Shebang_\(Unix\)>).
         * 
         * @return builder
         * 
         */
        public Builder interpreter(@Nullable Output interpreter) {
            $.interpreter = interpreter;
            return this;
        }

        /**
         * @param interpreter The script interpreter to use to run the script. If no interpreter is specified the script is executed directly, which likely only succeed for scripts with [shebang lines](<https://en.wikipedia.org/wiki/Shebang_\(Unix\)>).
         * 
         * @return builder
         * 
         */
        public Builder interpreter(SoftwareRecipeStepRunScriptInterpreter interpreter) {
            return interpreter(Output.of(interpreter));
        }

        /**
         * @param script The shell script to be executed.
         * 
         * @return builder
         * 
         */
        public Builder script(Output script) {
            $.script = script;
            return this;
        }

        /**
         * @param script The shell script to be executed.
         * 
         * @return builder
         * 
         */
        public Builder script(String script) {
            return script(Output.of(script));
        }

        public SoftwareRecipeStepRunScriptArgs build() {
            $.script = Objects.requireNonNull($.script, "expected parameter 'script' to be non-null");
            return $;
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy