"use strict";
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Pool = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * Manages an Azure Batch pool.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 *
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "testaccbatch",
 *     location: "West Europe",
 * });
 * const exampleAccount = new azure.storage.Account("example", {
 *     name: "testaccsa",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     accountTier: "Standard",
 *     accountReplicationType: "LRS",
 * });
 * const exampleAccount2 = new azure.batch.Account("example", {
 *     name: "testaccbatch",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     poolAllocationMode: "BatchService",
 *     storageAccountId: exampleAccount.id,
 *     storageAccountAuthenticationMode: "StorageKeys",
 *     tags: {
 *         env: "test",
 *     },
 * });
 * const examplePool = new azure.batch.Pool("example", {
 *     name: "testaccpool",
 *     resourceGroupName: example.name,
 *     accountName: exampleAccount2.name,
 *     displayName: "Test Acc Pool Auto",
 *     vmSize: "STANDARD_A1_V2",
 *     nodeAgentSkuId: "batch.node.ubuntu 20.04",
 *     autoScale: {
 *         evaluationInterval: "PT15M",
 *         formula: `      startingNumberOfVMs = 1;
 *       maxNumberofVMs = 25;
 *       pendingTaskSamplePercent = PendingTasks.GetSamplePercent(180 * TimeInterval_Second);
 *       pendingTaskSamples = pendingTaskSamplePercent < 70 ? startingNumberOfVMs : avg(PendingTasks.GetSample(180 *   TimeInterval_Second));
 *       TargetDedicatedNodes=min(maxNumberofVMs, pendingTaskSamples);
 * `,
 *     },
 *     storageImageReference: {
 *         publisher: "microsoft-azure-batch",
 *         offer: "ubuntu-server-container",
 *         sku: "20-04-lts",
 *         version: "latest",
 *     },
 *     containerConfiguration: {
 *         type: "DockerCompatible",
 *         containerRegistries: [{
 *             registryServer: "docker.io",
 *             userName: "login",
 *             password: "apassword",
 *         }],
 *     },
 *     startTask: {
 *         commandLine: "echo 'Hello World from $env'",
 *         taskRetryMaximum: 1,
 *         waitForSuccess: true,
 *         commonEnvironmentProperties: {
 *             env: "TEST",
 *         },
 *         userIdentity: {
 *             autoUser: {
 *                 elevationLevel: "NonAdmin",
 *                 scope: "Task",
 *             },
 *         },
 *     },
 * });
 * ```
 *
 * ## API Providers
 *
 * <!-- This section is generated, changes will be overwritten -->
 * This resource uses the following Azure API Providers:
 *
 * * `Microsoft.Batch` - 2024-07-01
 *
 * ## Import
 *
 * Batch Pools can be imported using the `resource id`, e.g.
 *
 * ```sh
 * $ pulumi import azure:batch/pool:Pool example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myGroup1/providers/Microsoft.Batch/batchAccounts/myBatchAccount1/pools/myBatchPool1
 * ```
 */
class Pool extends pulumi.CustomResource {
    /**
     * Get an existing Pool resource's state with the given name, ID, and optional extra
     * properties used to qualify the lookup.
     *
     * @param name The _unique_ name of the resulting resource.
     * @param id The _unique_ provider ID of the resource to lookup.
     * @param state Any extra arguments used during the lookup.
     * @param opts Optional settings to control the behavior of the CustomResource.
     */
    static get(name, id, state, opts) {
        return new Pool(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'azure:batch/pool:Pool';
    /**
     * Returns true if the given object is an instance of Pool.  This is designed to work even
     * when multiple copies of the Pulumi SDK have been loaded into the same process.
     */
    static isInstance(obj) {
        if (obj === undefined || obj === null) {
            return false;
        }
        return obj['__pulumiType'] === Pool.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["accountName"] = state?.accountName;
            resourceInputs["autoScale"] = state?.autoScale;
            resourceInputs["certificates"] = state?.certificates;
            resourceInputs["containerConfiguration"] = state?.containerConfiguration;
            resourceInputs["dataDisks"] = state?.dataDisks;
            resourceInputs["diskEncryptions"] = state?.diskEncryptions;
            resourceInputs["displayName"] = state?.displayName;
            resourceInputs["extensions"] = state?.extensions;
            resourceInputs["fixedScale"] = state?.fixedScale;
            resourceInputs["identity"] = state?.identity;
            resourceInputs["interNodeCommunication"] = state?.interNodeCommunication;
            resourceInputs["licenseType"] = state?.licenseType;
            resourceInputs["maxTasksPerNode"] = state?.maxTasksPerNode;
            resourceInputs["metadata"] = state?.metadata;
            resourceInputs["mounts"] = state?.mounts;
            resourceInputs["name"] = state?.name;
            resourceInputs["networkConfiguration"] = state?.networkConfiguration;
            resourceInputs["nodeAgentSkuId"] = state?.nodeAgentSkuId;
            resourceInputs["nodePlacements"] = state?.nodePlacements;
            resourceInputs["osDiskPlacement"] = state?.osDiskPlacement;
            resourceInputs["resourceGroupName"] = state?.resourceGroupName;
            resourceInputs["securityProfile"] = state?.securityProfile;
            resourceInputs["startTask"] = state?.startTask;
            resourceInputs["stopPendingResizeOperation"] = state?.stopPendingResizeOperation;
            resourceInputs["storageImageReference"] = state?.storageImageReference;
            resourceInputs["targetNodeCommunicationMode"] = state?.targetNodeCommunicationMode;
            resourceInputs["taskSchedulingPolicies"] = state?.taskSchedulingPolicies;
            resourceInputs["userAccounts"] = state?.userAccounts;
            resourceInputs["vmSize"] = state?.vmSize;
            resourceInputs["windows"] = state?.windows;
        }
        else {
            const args = argsOrState;
            if (args?.accountName === undefined && !opts.urn) {
                throw new Error("Missing required property 'accountName'");
            }
            if (args?.nodeAgentSkuId === undefined && !opts.urn) {
                throw new Error("Missing required property 'nodeAgentSkuId'");
            }
            if (args?.resourceGroupName === undefined && !opts.urn) {
                throw new Error("Missing required property 'resourceGroupName'");
            }
            if (args?.storageImageReference === undefined && !opts.urn) {
                throw new Error("Missing required property 'storageImageReference'");
            }
            if (args?.vmSize === undefined && !opts.urn) {
                throw new Error("Missing required property 'vmSize'");
            }
            resourceInputs["accountName"] = args?.accountName;
            resourceInputs["autoScale"] = args?.autoScale;
            resourceInputs["certificates"] = args?.certificates;
            resourceInputs["containerConfiguration"] = args?.containerConfiguration;
            resourceInputs["dataDisks"] = args?.dataDisks;
            resourceInputs["diskEncryptions"] = args?.diskEncryptions;
            resourceInputs["displayName"] = args?.displayName;
            resourceInputs["extensions"] = args?.extensions;
            resourceInputs["fixedScale"] = args?.fixedScale;
            resourceInputs["identity"] = args?.identity;
            resourceInputs["interNodeCommunication"] = args?.interNodeCommunication;
            resourceInputs["licenseType"] = args?.licenseType;
            resourceInputs["maxTasksPerNode"] = args?.maxTasksPerNode;
            resourceInputs["metadata"] = args?.metadata;
            resourceInputs["mounts"] = args?.mounts;
            resourceInputs["name"] = args?.name;
            resourceInputs["networkConfiguration"] = args?.networkConfiguration;
            resourceInputs["nodeAgentSkuId"] = args?.nodeAgentSkuId;
            resourceInputs["nodePlacements"] = args?.nodePlacements;
            resourceInputs["osDiskPlacement"] = args?.osDiskPlacement;
            resourceInputs["resourceGroupName"] = args?.resourceGroupName;
            resourceInputs["securityProfile"] = args?.securityProfile;
            resourceInputs["startTask"] = args?.startTask;
            resourceInputs["stopPendingResizeOperation"] = args?.stopPendingResizeOperation;
            resourceInputs["storageImageReference"] = args?.storageImageReference;
            resourceInputs["targetNodeCommunicationMode"] = args?.targetNodeCommunicationMode;
            resourceInputs["taskSchedulingPolicies"] = args?.taskSchedulingPolicies;
            resourceInputs["userAccounts"] = args?.userAccounts;
            resourceInputs["vmSize"] = args?.vmSize;
            resourceInputs["windows"] = args?.windows;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(Pool.__pulumiType, name, resourceInputs, opts);
    }
}
exports.Pool = Pool;
//# sourceMappingURL=pool.js.map