// *** 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.azure.batch.inputs;

import com.pulumi.azure.batch.inputs.PoolStartTaskContainerArgs;
import com.pulumi.azure.batch.inputs.PoolStartTaskResourceFileArgs;
import com.pulumi.azure.batch.inputs.PoolStartTaskUserIdentityArgs;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import java.lang.Boolean;
import java.lang.Integer;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


public final class PoolStartTaskArgs extends com.pulumi.resources.ResourceArgs {

    public static final PoolStartTaskArgs Empty = new PoolStartTaskArgs();

    /**
     * The command line executed by the start task.
     * 
     */
    @Import(name="commandLine", required=true)
    private Output<String> commandLine;

    /**
     * @return The command line executed by the start task.
     * 
     */
    public Output<String> commandLine() {
        return this.commandLine;
    }

    /**
     * A map of strings (key,value) that represents the environment variables to set in the start task.
     * 
     */
    @Import(name="commonEnvironmentProperties")
    private @Nullable Output<Map<String,String>> commonEnvironmentProperties;

    /**
     * @return A map of strings (key,value) that represents the environment variables to set in the start task.
     * 
     */
    public Optional<Output<Map<String,String>>> commonEnvironmentProperties() {
        return Optional.ofNullable(this.commonEnvironmentProperties);
    }

    /**
     * A `container` block is the settings for the container under which the start task runs. When this is specified, all directories recursively below the `AZ_BATCH_NODE_ROOT_DIR` (the root of Azure Batch directories on the node) are mapped into the container, all task environment variables are mapped into the container, and the task command line is executed in the container.
     * 
     */
    @Import(name="containers")
    private @Nullable Output<List<PoolStartTaskContainerArgs>> containers;

    /**
     * @return A `container` block is the settings for the container under which the start task runs. When this is specified, all directories recursively below the `AZ_BATCH_NODE_ROOT_DIR` (the root of Azure Batch directories on the node) are mapped into the container, all task environment variables are mapped into the container, and the task command line is executed in the container.
     * 
     */
    public Optional<Output<List<PoolStartTaskContainerArgs>>> containers() {
        return Optional.ofNullable(this.containers);
    }

    /**
     * One or more `resource_file` blocks that describe the files to be downloaded to a compute node as defined below.
     * 
     */
    @Import(name="resourceFiles")
    private @Nullable Output<List<PoolStartTaskResourceFileArgs>> resourceFiles;

    /**
     * @return One or more `resource_file` blocks that describe the files to be downloaded to a compute node as defined below.
     * 
     */
    public Optional<Output<List<PoolStartTaskResourceFileArgs>>> resourceFiles() {
        return Optional.ofNullable(this.resourceFiles);
    }

    /**
     * The number of retry count.
     * 
     */
    @Import(name="taskRetryMaximum")
    private @Nullable Output<Integer> taskRetryMaximum;

    /**
     * @return The number of retry count.
     * 
     */
    public Optional<Output<Integer>> taskRetryMaximum() {
        return Optional.ofNullable(this.taskRetryMaximum);
    }

    /**
     * A `user_identity` block that describes the user identity under which the start task runs as defined below.
     * 
     */
    @Import(name="userIdentity", required=true)
    private Output<PoolStartTaskUserIdentityArgs> userIdentity;

    /**
     * @return A `user_identity` block that describes the user identity under which the start task runs as defined below.
     * 
     */
    public Output<PoolStartTaskUserIdentityArgs> userIdentity() {
        return this.userIdentity;
    }

    /**
     * A flag that indicates if the Batch pool should wait for the start task to be completed. Default to `false`.
     * 
     */
    @Import(name="waitForSuccess")
    private @Nullable Output<Boolean> waitForSuccess;

    /**
     * @return A flag that indicates if the Batch pool should wait for the start task to be completed. Default to `false`.
     * 
     */
    public Optional<Output<Boolean>> waitForSuccess() {
        return Optional.ofNullable(this.waitForSuccess);
    }

    private PoolStartTaskArgs() {}

    private PoolStartTaskArgs(PoolStartTaskArgs $) {
        this.commandLine = $.commandLine;
        this.commonEnvironmentProperties = $.commonEnvironmentProperties;
        this.containers = $.containers;
        this.resourceFiles = $.resourceFiles;
        this.taskRetryMaximum = $.taskRetryMaximum;
        this.userIdentity = $.userIdentity;
        this.waitForSuccess = $.waitForSuccess;
    }

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

    public static final class Builder {
        private PoolStartTaskArgs $;

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

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

        /**
         * @param commandLine The command line executed by the start task.
         * 
         * @return builder
         * 
         */
        public Builder commandLine(Output<String> commandLine) {
            $.commandLine = commandLine;
            return this;
        }

        /**
         * @param commandLine The command line executed by the start task.
         * 
         * @return builder
         * 
         */
        public Builder commandLine(String commandLine) {
            return commandLine(Output.of(commandLine));
        }

        /**
         * @param commonEnvironmentProperties A map of strings (key,value) that represents the environment variables to set in the start task.
         * 
         * @return builder
         * 
         */
        public Builder commonEnvironmentProperties(@Nullable Output<Map<String,String>> commonEnvironmentProperties) {
            $.commonEnvironmentProperties = commonEnvironmentProperties;
            return this;
        }

        /**
         * @param commonEnvironmentProperties A map of strings (key,value) that represents the environment variables to set in the start task.
         * 
         * @return builder
         * 
         */
        public Builder commonEnvironmentProperties(Map<String,String> commonEnvironmentProperties) {
            return commonEnvironmentProperties(Output.of(commonEnvironmentProperties));
        }

        /**
         * @param containers A `container` block is the settings for the container under which the start task runs. When this is specified, all directories recursively below the `AZ_BATCH_NODE_ROOT_DIR` (the root of Azure Batch directories on the node) are mapped into the container, all task environment variables are mapped into the container, and the task command line is executed in the container.
         * 
         * @return builder
         * 
         */
        public Builder containers(@Nullable Output<List<PoolStartTaskContainerArgs>> containers) {
            $.containers = containers;
            return this;
        }

        /**
         * @param containers A `container` block is the settings for the container under which the start task runs. When this is specified, all directories recursively below the `AZ_BATCH_NODE_ROOT_DIR` (the root of Azure Batch directories on the node) are mapped into the container, all task environment variables are mapped into the container, and the task command line is executed in the container.
         * 
         * @return builder
         * 
         */
        public Builder containers(List<PoolStartTaskContainerArgs> containers) {
            return containers(Output.of(containers));
        }

        /**
         * @param containers A `container` block is the settings for the container under which the start task runs. When this is specified, all directories recursively below the `AZ_BATCH_NODE_ROOT_DIR` (the root of Azure Batch directories on the node) are mapped into the container, all task environment variables are mapped into the container, and the task command line is executed in the container.
         * 
         * @return builder
         * 
         */
        public Builder containers(PoolStartTaskContainerArgs... containers) {
            return containers(List.of(containers));
        }

        /**
         * @param resourceFiles One or more `resource_file` blocks that describe the files to be downloaded to a compute node as defined below.
         * 
         * @return builder
         * 
         */
        public Builder resourceFiles(@Nullable Output<List<PoolStartTaskResourceFileArgs>> resourceFiles) {
            $.resourceFiles = resourceFiles;
            return this;
        }

        /**
         * @param resourceFiles One or more `resource_file` blocks that describe the files to be downloaded to a compute node as defined below.
         * 
         * @return builder
         * 
         */
        public Builder resourceFiles(List<PoolStartTaskResourceFileArgs> resourceFiles) {
            return resourceFiles(Output.of(resourceFiles));
        }

        /**
         * @param resourceFiles One or more `resource_file` blocks that describe the files to be downloaded to a compute node as defined below.
         * 
         * @return builder
         * 
         */
        public Builder resourceFiles(PoolStartTaskResourceFileArgs... resourceFiles) {
            return resourceFiles(List.of(resourceFiles));
        }

        /**
         * @param taskRetryMaximum The number of retry count.
         * 
         * @return builder
         * 
         */
        public Builder taskRetryMaximum(@Nullable Output<Integer> taskRetryMaximum) {
            $.taskRetryMaximum = taskRetryMaximum;
            return this;
        }

        /**
         * @param taskRetryMaximum The number of retry count.
         * 
         * @return builder
         * 
         */
        public Builder taskRetryMaximum(Integer taskRetryMaximum) {
            return taskRetryMaximum(Output.of(taskRetryMaximum));
        }

        /**
         * @param userIdentity A `user_identity` block that describes the user identity under which the start task runs as defined below.
         * 
         * @return builder
         * 
         */
        public Builder userIdentity(Output<PoolStartTaskUserIdentityArgs> userIdentity) {
            $.userIdentity = userIdentity;
            return this;
        }

        /**
         * @param userIdentity A `user_identity` block that describes the user identity under which the start task runs as defined below.
         * 
         * @return builder
         * 
         */
        public Builder userIdentity(PoolStartTaskUserIdentityArgs userIdentity) {
            return userIdentity(Output.of(userIdentity));
        }

        /**
         * @param waitForSuccess A flag that indicates if the Batch pool should wait for the start task to be completed. Default to `false`.
         * 
         * @return builder
         * 
         */
        public Builder waitForSuccess(@Nullable Output<Boolean> waitForSuccess) {
            $.waitForSuccess = waitForSuccess;
            return this;
        }

        /**
         * @param waitForSuccess A flag that indicates if the Batch pool should wait for the start task to be completed. Default to `false`.
         * 
         * @return builder
         * 
         */
        public Builder waitForSuccess(Boolean waitForSuccess) {
            return waitForSuccess(Output.of(waitForSuccess));
        }

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

}
