"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.IamAuditConfig = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Allows management of audit logging config for a given service for a Google Cloud Platform Organization.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const config = new gcp.organizations.IamAuditConfig("config", {
 *     orgId: "your-organization-id",
 *     service: "allServices",
 *     auditLogConfigs: [{
 *         logType: "DATA_READ",
 *         exemptedMembers: ["user:joebloggs@example.com"],
 *     }],
 * });
 * ```
 *
 * ## Import
 *
 * IAM audit config imports use the identifier of the resource in question and the service, e.g.
 *
 * ```sh
 * $ pulumi import gcp:organizations/iamAuditConfig:IamAuditConfig config "your-organization-id foo.googleapis.com"
 * ```
 */
class IamAuditConfig extends pulumi.CustomResource {
    /**
     * Get an existing IamAuditConfig 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 IamAuditConfig(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of IamAuditConfig.  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'] === IamAuditConfig.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["auditLogConfigs"] = state?.auditLogConfigs;
            resourceInputs["etag"] = state?.etag;
            resourceInputs["orgId"] = state?.orgId;
            resourceInputs["service"] = state?.service;
        }
        else {
            const args = argsOrState;
            if (args?.auditLogConfigs === undefined && !opts.urn) {
                throw new Error("Missing required property 'auditLogConfigs'");
            }
            if (args?.orgId === undefined && !opts.urn) {
                throw new Error("Missing required property 'orgId'");
            }
            if (args?.service === undefined && !opts.urn) {
                throw new Error("Missing required property 'service'");
            }
            resourceInputs["auditLogConfigs"] = args?.auditLogConfigs;
            resourceInputs["orgId"] = args?.orgId;
            resourceInputs["service"] = args?.service;
            resourceInputs["etag"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(IamAuditConfig.__pulumiType, name, resourceInputs, opts);
    }
}
exports.IamAuditConfig = IamAuditConfig;
/** @internal */
IamAuditConfig.__pulumiType = 'gcp:organizations/iamAuditConfig:IamAuditConfig';
//# sourceMappingURL=iamAuditConfig.js.map