"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! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.KeystoresAliasesKeyCertFile = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * An alias from a key/certificate pair.
 *
 * To get more information about KeystoresAliasesKeyCertFile, see:
 *
 * * [API documentation](https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations.environments.keystores.aliases)
 * * How-to Guides
 *     * [Keystores Aliases](https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations.environments.keystores.aliases)
 *
 * ## Import
 *
 * KeystoresAliasesKeyCertFile can be imported using any of these accepted formats:
 *
 * * `organizations/{{org_id}}/environments/{{environment}}/keystores/{{keystore}}/aliases/{{alias}}`
 *
 * * `{{org_id}}/{{environment}}/{{keystore}}/{{alias}}`
 *
 * When using the `pulumi import` command, KeystoresAliasesKeyCertFile can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:apigee/keystoresAliasesKeyCertFile:KeystoresAliasesKeyCertFile default organizations/{{org_id}}/environments/{{environment}}/keystores/{{keystore}}/aliases/{{alias}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:apigee/keystoresAliasesKeyCertFile:KeystoresAliasesKeyCertFile default {{org_id}}/{{environment}}/{{keystore}}/{{alias}}
 * ```
 */
class KeystoresAliasesKeyCertFile extends pulumi.CustomResource {
    /**
     * Get an existing KeystoresAliasesKeyCertFile 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 KeystoresAliasesKeyCertFile(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of KeystoresAliasesKeyCertFile.  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'] === KeystoresAliasesKeyCertFile.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["alias"] = state?.alias;
            resourceInputs["cert"] = state?.cert;
            resourceInputs["certsInfos"] = state?.certsInfos;
            resourceInputs["environment"] = state?.environment;
            resourceInputs["key"] = state?.key;
            resourceInputs["keystore"] = state?.keystore;
            resourceInputs["orgId"] = state?.orgId;
            resourceInputs["password"] = state?.password;
            resourceInputs["timeouts"] = state?.timeouts;
            resourceInputs["type"] = state?.type;
        }
        else {
            const args = argsOrState;
            if (args?.alias === undefined && !opts.urn) {
                throw new Error("Missing required property 'alias'");
            }
            if (args?.cert === undefined && !opts.urn) {
                throw new Error("Missing required property 'cert'");
            }
            if (args?.environment === undefined && !opts.urn) {
                throw new Error("Missing required property 'environment'");
            }
            if (args?.keystore === undefined && !opts.urn) {
                throw new Error("Missing required property 'keystore'");
            }
            if (args?.orgId === undefined && !opts.urn) {
                throw new Error("Missing required property 'orgId'");
            }
            resourceInputs["alias"] = args?.alias;
            resourceInputs["cert"] = args?.cert;
            resourceInputs["environment"] = args?.environment;
            resourceInputs["key"] = args?.key ? pulumi.secret(args.key) : undefined;
            resourceInputs["keystore"] = args?.keystore;
            resourceInputs["orgId"] = args?.orgId;
            resourceInputs["password"] = args?.password ? pulumi.secret(args.password) : undefined;
            resourceInputs["timeouts"] = args?.timeouts;
            resourceInputs["certsInfos"] = undefined /*out*/;
            resourceInputs["type"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const secretOpts = { additionalSecretOutputs: ["key", "password"] };
        opts = pulumi.mergeOptions(opts, secretOpts);
        super(KeystoresAliasesKeyCertFile.__pulumiType, name, resourceInputs, opts);
    }
}
exports.KeystoresAliasesKeyCertFile = KeystoresAliasesKeyCertFile;
/** @internal */
KeystoresAliasesKeyCertFile.__pulumiType = 'gcp:apigee/keystoresAliasesKeyCertFile:KeystoresAliasesKeyCertFile';
//# sourceMappingURL=keystoresAliasesKeyCertFile.js.map