"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.Account = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * Manages a CosmosDB (formally DocumentDB) Account.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * import * as random from "@pulumi/random";
 *
 * const rg = new azure.core.ResourceGroup("rg", {
 *     name: "sample-rg",
 *     location: "westus",
 * });
 * const ri = new random.index.Integer("ri", {
 *     min: 10000,
 *     max: 99999,
 * });
 * const db = new azure.cosmosdb.Account("db", {
 *     name: `tfex-cosmos-db-${ri.result}`,
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     offerType: "Standard",
 *     kind: "MongoDB",
 *     automaticFailoverEnabled: true,
 *     capabilities: [
 *         {
 *             name: "EnableAggregationPipeline",
 *         },
 *         {
 *             name: "mongoEnableDocLevelTTL",
 *         },
 *         {
 *             name: "MongoDBv3.4",
 *         },
 *         {
 *             name: "EnableMongo",
 *         },
 *     ],
 *     consistencyPolicy: {
 *         consistencyLevel: "BoundedStaleness",
 *         maxIntervalInSeconds: 300,
 *         maxStalenessPrefix: 100000,
 *     },
 *     geoLocations: [
 *         {
 *             location: "eastus",
 *             failoverPriority: 1,
 *         },
 *         {
 *             location: "westus",
 *             failoverPriority: 0,
 *         },
 *     ],
 * });
 * ```
 *
 * ## User Assigned Identity Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * import * as std from "@pulumi/std";
 *
 * const example = new azure.authorization.UserAssignedIdentity("example", {
 *     resourceGroupName: exampleAzurermResourceGroup.name,
 *     location: exampleAzurermResourceGroup.location,
 *     name: "example-resource",
 * });
 * const exampleAccount = new azure.cosmosdb.Account("example", {
 *     name: "example-resource",
 *     location: exampleAzurermResourceGroup.location,
 *     resourceGroupName: exampleAzurermResourceGroup.name,
 *     defaultIdentityType: std.joinOutput({
 *         separator: "=",
 *         input: [
 *             "UserAssignedIdentity",
 *             example.id,
 *         ],
 *     }).apply(invoke => invoke.result),
 *     offerType: "Standard",
 *     kind: "MongoDB",
 *     capabilities: [{
 *         name: "EnableMongo",
 *     }],
 *     consistencyPolicy: {
 *         consistencyLevel: "Strong",
 *     },
 *     geoLocations: [{
 *         location: "westus",
 *         failoverPriority: 0,
 *     }],
 *     identity: {
 *         type: "UserAssigned",
 *         identityIds: [example.id],
 *     },
 * });
 * ```
 * ## API Providers
 *
 * <!-- This section is generated, changes will be overwritten -->
 * This resource uses the following Azure API Providers:
 *
 * * `Microsoft.DocumentDB` - 2024-08-15
 *
 * ## Import
 *
 * CosmosDB Accounts can be imported using the `resource id`, e.g.
 *
 * ```sh
 * $ pulumi import azure:cosmosdb/account:Account account1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DocumentDB/databaseAccounts/account1
 * ```
 */
class Account extends pulumi.CustomResource {
    /**
     * Get an existing Account 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 Account(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'azure:cosmosdb/account:Account';
    /**
     * Returns true if the given object is an instance of Account.  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'] === Account.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["accessKeyMetadataWritesEnabled"] = state?.accessKeyMetadataWritesEnabled;
            resourceInputs["analyticalStorage"] = state?.analyticalStorage;
            resourceInputs["analyticalStorageEnabled"] = state?.analyticalStorageEnabled;
            resourceInputs["automaticFailoverEnabled"] = state?.automaticFailoverEnabled;
            resourceInputs["backup"] = state?.backup;
            resourceInputs["burstCapacityEnabled"] = state?.burstCapacityEnabled;
            resourceInputs["capabilities"] = state?.capabilities;
            resourceInputs["capacity"] = state?.capacity;
            resourceInputs["consistencyPolicy"] = state?.consistencyPolicy;
            resourceInputs["corsRule"] = state?.corsRule;
            resourceInputs["createMode"] = state?.createMode;
            resourceInputs["defaultIdentityType"] = state?.defaultIdentityType;
            resourceInputs["endpoint"] = state?.endpoint;
            resourceInputs["freeTierEnabled"] = state?.freeTierEnabled;
            resourceInputs["geoLocations"] = state?.geoLocations;
            resourceInputs["identity"] = state?.identity;
            resourceInputs["ipRangeFilters"] = state?.ipRangeFilters;
            resourceInputs["isVirtualNetworkFilterEnabled"] = state?.isVirtualNetworkFilterEnabled;
            resourceInputs["keyVaultKeyId"] = state?.keyVaultKeyId;
            resourceInputs["kind"] = state?.kind;
            resourceInputs["localAuthenticationDisabled"] = state?.localAuthenticationDisabled;
            resourceInputs["location"] = state?.location;
            resourceInputs["managedHsmKeyId"] = state?.managedHsmKeyId;
            resourceInputs["minimalTlsVersion"] = state?.minimalTlsVersion;
            resourceInputs["mongoServerVersion"] = state?.mongoServerVersion;
            resourceInputs["multipleWriteLocationsEnabled"] = state?.multipleWriteLocationsEnabled;
            resourceInputs["name"] = state?.name;
            resourceInputs["networkAclBypassForAzureServices"] = state?.networkAclBypassForAzureServices;
            resourceInputs["networkAclBypassIds"] = state?.networkAclBypassIds;
            resourceInputs["offerType"] = state?.offerType;
            resourceInputs["partitionMergeEnabled"] = state?.partitionMergeEnabled;
            resourceInputs["primaryKey"] = state?.primaryKey;
            resourceInputs["primaryMongodbConnectionString"] = state?.primaryMongodbConnectionString;
            resourceInputs["primaryReadonlyKey"] = state?.primaryReadonlyKey;
            resourceInputs["primaryReadonlyMongodbConnectionString"] = state?.primaryReadonlyMongodbConnectionString;
            resourceInputs["primaryReadonlySqlConnectionString"] = state?.primaryReadonlySqlConnectionString;
            resourceInputs["primarySqlConnectionString"] = state?.primarySqlConnectionString;
            resourceInputs["publicNetworkAccessEnabled"] = state?.publicNetworkAccessEnabled;
            resourceInputs["readEndpoints"] = state?.readEndpoints;
            resourceInputs["resourceGroupName"] = state?.resourceGroupName;
            resourceInputs["restore"] = state?.restore;
            resourceInputs["secondaryKey"] = state?.secondaryKey;
            resourceInputs["secondaryMongodbConnectionString"] = state?.secondaryMongodbConnectionString;
            resourceInputs["secondaryReadonlyKey"] = state?.secondaryReadonlyKey;
            resourceInputs["secondaryReadonlyMongodbConnectionString"] = state?.secondaryReadonlyMongodbConnectionString;
            resourceInputs["secondaryReadonlySqlConnectionString"] = state?.secondaryReadonlySqlConnectionString;
            resourceInputs["secondarySqlConnectionString"] = state?.secondarySqlConnectionString;
            resourceInputs["tags"] = state?.tags;
            resourceInputs["virtualNetworkRules"] = state?.virtualNetworkRules;
            resourceInputs["writeEndpoints"] = state?.writeEndpoints;
        }
        else {
            const args = argsOrState;
            if (args?.consistencyPolicy === undefined && !opts.urn) {
                throw new Error("Missing required property 'consistencyPolicy'");
            }
            if (args?.geoLocations === undefined && !opts.urn) {
                throw new Error("Missing required property 'geoLocations'");
            }
            if (args?.offerType === undefined && !opts.urn) {
                throw new Error("Missing required property 'offerType'");
            }
            if (args?.resourceGroupName === undefined && !opts.urn) {
                throw new Error("Missing required property 'resourceGroupName'");
            }
            resourceInputs["accessKeyMetadataWritesEnabled"] = args?.accessKeyMetadataWritesEnabled;
            resourceInputs["analyticalStorage"] = args?.analyticalStorage;
            resourceInputs["analyticalStorageEnabled"] = args?.analyticalStorageEnabled;
            resourceInputs["automaticFailoverEnabled"] = args?.automaticFailoverEnabled;
            resourceInputs["backup"] = args?.backup;
            resourceInputs["burstCapacityEnabled"] = args?.burstCapacityEnabled;
            resourceInputs["capabilities"] = args?.capabilities;
            resourceInputs["capacity"] = args?.capacity;
            resourceInputs["consistencyPolicy"] = args?.consistencyPolicy;
            resourceInputs["corsRule"] = args?.corsRule;
            resourceInputs["createMode"] = args?.createMode;
            resourceInputs["defaultIdentityType"] = args?.defaultIdentityType;
            resourceInputs["freeTierEnabled"] = args?.freeTierEnabled;
            resourceInputs["geoLocations"] = args?.geoLocations;
            resourceInputs["identity"] = args?.identity;
            resourceInputs["ipRangeFilters"] = args?.ipRangeFilters;
            resourceInputs["isVirtualNetworkFilterEnabled"] = args?.isVirtualNetworkFilterEnabled;
            resourceInputs["keyVaultKeyId"] = args?.keyVaultKeyId;
            resourceInputs["kind"] = args?.kind;
            resourceInputs["localAuthenticationDisabled"] = args?.localAuthenticationDisabled;
            resourceInputs["location"] = args?.location;
            resourceInputs["managedHsmKeyId"] = args?.managedHsmKeyId;
            resourceInputs["minimalTlsVersion"] = args?.minimalTlsVersion;
            resourceInputs["mongoServerVersion"] = args?.mongoServerVersion;
            resourceInputs["multipleWriteLocationsEnabled"] = args?.multipleWriteLocationsEnabled;
            resourceInputs["name"] = args?.name;
            resourceInputs["networkAclBypassForAzureServices"] = args?.networkAclBypassForAzureServices;
            resourceInputs["networkAclBypassIds"] = args?.networkAclBypassIds;
            resourceInputs["offerType"] = args?.offerType;
            resourceInputs["partitionMergeEnabled"] = args?.partitionMergeEnabled;
            resourceInputs["publicNetworkAccessEnabled"] = args?.publicNetworkAccessEnabled;
            resourceInputs["resourceGroupName"] = args?.resourceGroupName;
            resourceInputs["restore"] = args?.restore;
            resourceInputs["tags"] = args?.tags;
            resourceInputs["virtualNetworkRules"] = args?.virtualNetworkRules;
            resourceInputs["endpoint"] = undefined /*out*/;
            resourceInputs["primaryKey"] = undefined /*out*/;
            resourceInputs["primaryMongodbConnectionString"] = undefined /*out*/;
            resourceInputs["primaryReadonlyKey"] = undefined /*out*/;
            resourceInputs["primaryReadonlyMongodbConnectionString"] = undefined /*out*/;
            resourceInputs["primaryReadonlySqlConnectionString"] = undefined /*out*/;
            resourceInputs["primarySqlConnectionString"] = undefined /*out*/;
            resourceInputs["readEndpoints"] = undefined /*out*/;
            resourceInputs["secondaryKey"] = undefined /*out*/;
            resourceInputs["secondaryMongodbConnectionString"] = undefined /*out*/;
            resourceInputs["secondaryReadonlyKey"] = undefined /*out*/;
            resourceInputs["secondaryReadonlyMongodbConnectionString"] = undefined /*out*/;
            resourceInputs["secondaryReadonlySqlConnectionString"] = undefined /*out*/;
            resourceInputs["secondarySqlConnectionString"] = undefined /*out*/;
            resourceInputs["writeEndpoints"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const secretOpts = { additionalSecretOutputs: ["primaryKey", "primaryMongodbConnectionString", "primaryReadonlyKey", "primaryReadonlyMongodbConnectionString", "primaryReadonlySqlConnectionString", "primarySqlConnectionString", "secondaryKey", "secondaryMongodbConnectionString", "secondaryReadonlyKey", "secondaryReadonlyMongodbConnectionString", "secondaryReadonlySqlConnectionString", "secondarySqlConnectionString"] };
        opts = pulumi.mergeOptions(opts, secretOpts);
        super(Account.__pulumiType, name, resourceInputs, opts);
    }
}
exports.Account = Account;
//# sourceMappingURL=account.js.map