"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.AccessApprovalSettings = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Access Approval enables you to require your explicit approval whenever Google support and engineering need to access your customer content.
 *
 * To get more information about OrganizationSettings, see:
 *
 * * [API documentation](https://cloud.google.com/access-approval/docs/reference/rest/v1/organizations)
 *
 * ## Example Usage
 *
 * ### Organization Access Approval Full
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const organizationAccessApproval = new gcp.organizations.AccessApprovalSettings("organization_access_approval", {
 *     organizationId: "123456789",
 *     notificationEmails: [
 *         "testuser@example.com",
 *         "example.user@example.com",
 *     ],
 *     enrolledServices: [
 *         {
 *             cloudProduct: "appengine.googleapis.com",
 *         },
 *         {
 *             cloudProduct: "dataflow.googleapis.com",
 *             enrollmentLevel: "BLOCK_ALL",
 *         },
 *     ],
 * });
 * ```
 * ### Organization Access Approval Active Key Version
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const myProject = new gcp.organizations.Project("my_project", {
 *     name: "My Project",
 *     projectId: "your-project-id",
 *     orgId: "123456789",
 *     deletionPolicy: "DELETE",
 * });
 * const keyRing = new gcp.kms.KeyRing("key_ring", {
 *     name: "key-ring",
 *     location: "global",
 *     project: myProject.projectId,
 * });
 * const cryptoKey = new gcp.kms.CryptoKey("crypto_key", {
 *     name: "crypto-key",
 *     keyRing: keyRing.id,
 *     purpose: "ASYMMETRIC_SIGN",
 *     versionTemplate: {
 *         algorithm: "EC_SIGN_P384_SHA384",
 *     },
 * });
 * const serviceAccount = gcp.accessapproval.getOrganizationServiceAccount({
 *     organizationId: "123456789",
 * });
 * const iam = new gcp.kms.CryptoKeyIAMMember("iam", {
 *     cryptoKeyId: cryptoKey.id,
 *     role: "roles/cloudkms.signerVerifier",
 *     member: serviceAccount.then(serviceAccount => `serviceAccount:${serviceAccount.accountEmail}`),
 * });
 * const cryptoKeyVersion = gcp.kms.getKMSCryptoKeyVersionOutput({
 *     cryptoKey: cryptoKey.id,
 * });
 * const organizationAccessApproval = new gcp.organizations.AccessApprovalSettings("organization_access_approval", {
 *     organizationId: "123456789",
 *     activeKeyVersion: cryptoKeyVersion.apply(cryptoKeyVersion => cryptoKeyVersion.name),
 *     enrolledServices: [{
 *         cloudProduct: "all",
 *     }],
 * }, {
 *     dependsOn: [iam],
 * });
 * ```
 *
 * ## Import
 *
 * OrganizationSettings can be imported using any of these accepted formats:
 *
 * * `organizations/{{organization_id}}/accessApprovalSettings`
 *
 * * `{{organization_id}}`
 *
 * When using the `pulumi import` command, OrganizationSettings can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:organizations/accessApprovalSettings:AccessApprovalSettings default organizations/{{organization_id}}/accessApprovalSettings
 * ```
 *
 * ```sh
 * $ pulumi import gcp:organizations/accessApprovalSettings:AccessApprovalSettings default {{organization_id}}
 * ```
 */
class AccessApprovalSettings extends pulumi.CustomResource {
    /**
     * Get an existing AccessApprovalSettings 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 AccessApprovalSettings(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of AccessApprovalSettings.  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'] === AccessApprovalSettings.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["activeKeyVersion"] = state?.activeKeyVersion;
            resourceInputs["ancestorHasActiveKeyVersion"] = state?.ancestorHasActiveKeyVersion;
            resourceInputs["enrolledAncestor"] = state?.enrolledAncestor;
            resourceInputs["enrolledServices"] = state?.enrolledServices;
            resourceInputs["invalidKeyVersion"] = state?.invalidKeyVersion;
            resourceInputs["name"] = state?.name;
            resourceInputs["notificationEmails"] = state?.notificationEmails;
            resourceInputs["organizationId"] = state?.organizationId;
        }
        else {
            const args = argsOrState;
            if (args?.enrolledServices === undefined && !opts.urn) {
                throw new Error("Missing required property 'enrolledServices'");
            }
            if (args?.organizationId === undefined && !opts.urn) {
                throw new Error("Missing required property 'organizationId'");
            }
            resourceInputs["activeKeyVersion"] = args?.activeKeyVersion;
            resourceInputs["enrolledServices"] = args?.enrolledServices;
            resourceInputs["notificationEmails"] = args?.notificationEmails;
            resourceInputs["organizationId"] = args?.organizationId;
            resourceInputs["ancestorHasActiveKeyVersion"] = undefined /*out*/;
            resourceInputs["enrolledAncestor"] = undefined /*out*/;
            resourceInputs["invalidKeyVersion"] = undefined /*out*/;
            resourceInputs["name"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(AccessApprovalSettings.__pulumiType, name, resourceInputs, opts);
    }
}
exports.AccessApprovalSettings = AccessApprovalSettings;
/** @internal */
AccessApprovalSettings.__pulumiType = 'gcp:organizations/accessApprovalSettings:AccessApprovalSettings';
//# sourceMappingURL=accessApprovalSettings.js.map