"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.ProjectsPolicyBinding = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * ## Example Usage
 *
 * ### Iam Projects Policy Binding
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * import * as time from "@pulumiverse/time";
 *
 * const project = gcp.organizations.getProject({});
 * const pabPolicy = new gcp.iam.PrincipalAccessBoundaryPolicy("pab_policy", {
 *     organization: "123456789",
 *     location: "global",
 *     displayName: "binding for all principals in the project",
 *     principalAccessBoundaryPolicyId: "my-pab-policy",
 * });
 * const wait60Seconds = new time.Sleep("wait_60_seconds", {createDuration: "60s"}, {
 *     dependsOn: [pabPolicy],
 * });
 * const binding_for_all_project_principals = new gcp.iam.ProjectsPolicyBinding("binding-for-all-project-principals", {
 *     project: project.then(project => project.projectId),
 *     location: "global",
 *     displayName: "binding for all principals in the project",
 *     policyKind: "PRINCIPAL_ACCESS_BOUNDARY",
 *     policyBindingId: "binding-for-all-project-principals",
 *     policy: pulumi.interpolate`organizations/123456789/locations/global/principalAccessBoundaryPolicies/${pabPolicy.principalAccessBoundaryPolicyId}`,
 *     target: {
 *         principalSet: project.then(project => `//cloudresourcemanager.googleapis.com/projects/${project.projectId}`),
 *     },
 * }, {
 *     dependsOn: [wait60Seconds],
 * });
 * ```
 *
 * ## Import
 *
 * ProjectsPolicyBinding can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/locations/{{location}}/policyBindings/{{policy_binding_id}}`
 *
 * * `{{project}}/{{location}}/{{policy_binding_id}}`
 *
 * * `{{location}}/{{policy_binding_id}}`
 *
 * When using the `pulumi import` command, ProjectsPolicyBinding can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:iam/projectsPolicyBinding:ProjectsPolicyBinding default projects/{{project}}/locations/{{location}}/policyBindings/{{policy_binding_id}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:iam/projectsPolicyBinding:ProjectsPolicyBinding default {{project}}/{{location}}/{{policy_binding_id}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:iam/projectsPolicyBinding:ProjectsPolicyBinding default {{location}}/{{policy_binding_id}}
 * ```
 */
class ProjectsPolicyBinding extends pulumi.CustomResource {
    /**
     * Get an existing ProjectsPolicyBinding 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 ProjectsPolicyBinding(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of ProjectsPolicyBinding.  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'] === ProjectsPolicyBinding.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["annotations"] = state?.annotations;
            resourceInputs["condition"] = state?.condition;
            resourceInputs["createTime"] = state?.createTime;
            resourceInputs["displayName"] = state?.displayName;
            resourceInputs["effectiveAnnotations"] = state?.effectiveAnnotations;
            resourceInputs["etag"] = state?.etag;
            resourceInputs["location"] = state?.location;
            resourceInputs["name"] = state?.name;
            resourceInputs["policy"] = state?.policy;
            resourceInputs["policyBindingId"] = state?.policyBindingId;
            resourceInputs["policyKind"] = state?.policyKind;
            resourceInputs["policyUid"] = state?.policyUid;
            resourceInputs["project"] = state?.project;
            resourceInputs["target"] = state?.target;
            resourceInputs["uid"] = state?.uid;
            resourceInputs["updateTime"] = state?.updateTime;
        }
        else {
            const args = argsOrState;
            if (args?.location === undefined && !opts.urn) {
                throw new Error("Missing required property 'location'");
            }
            if (args?.policy === undefined && !opts.urn) {
                throw new Error("Missing required property 'policy'");
            }
            if (args?.policyBindingId === undefined && !opts.urn) {
                throw new Error("Missing required property 'policyBindingId'");
            }
            if (args?.target === undefined && !opts.urn) {
                throw new Error("Missing required property 'target'");
            }
            resourceInputs["annotations"] = args?.annotations;
            resourceInputs["condition"] = args?.condition;
            resourceInputs["displayName"] = args?.displayName;
            resourceInputs["location"] = args?.location;
            resourceInputs["policy"] = args?.policy;
            resourceInputs["policyBindingId"] = args?.policyBindingId;
            resourceInputs["policyKind"] = args?.policyKind;
            resourceInputs["project"] = args?.project;
            resourceInputs["target"] = args?.target;
            resourceInputs["createTime"] = undefined /*out*/;
            resourceInputs["effectiveAnnotations"] = undefined /*out*/;
            resourceInputs["etag"] = undefined /*out*/;
            resourceInputs["name"] = undefined /*out*/;
            resourceInputs["policyUid"] = undefined /*out*/;
            resourceInputs["uid"] = undefined /*out*/;
            resourceInputs["updateTime"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(ProjectsPolicyBinding.__pulumiType, name, resourceInputs, opts);
    }
}
exports.ProjectsPolicyBinding = ProjectsPolicyBinding;
/** @internal */
ProjectsPolicyBinding.__pulumiType = 'gcp:iam/projectsPolicyBinding:ProjectsPolicyBinding';
//# sourceMappingURL=projectsPolicyBinding.js.map