"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.PolicyGrant = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Policy Grant in AWS DataZone is an explicit authorization assignment that allows a specific principal (user, group, or project) to perform particular actions (such as creating glossary terms, managing projects, or accessing resources) on governed resources within a certain scope (like a Domain Unit or Project). Policy Grants are essentially the mechanism by which DataZone enforces fine-grained, role-based access control beyond what is possible through AWS IAM alone.
 */
class PolicyGrant extends pulumi.CustomResource {
    /**
     * Get an existing PolicyGrant 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 opts Optional settings to control the behavior of the CustomResource.
     */
    static get(name, id, opts) {
        return new PolicyGrant(name, undefined, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of PolicyGrant.  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'] === PolicyGrant.__pulumiType;
    }
    /**
     * Create a PolicyGrant resource with the given unique name, arguments, and options.
     *
     * @param name The _unique_ name of the resource.
     * @param args The arguments to use to populate this resource's properties.
     * @param opts A bag of options that control this resource's behavior.
     */
    constructor(name, args, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (!opts.id) {
            if (args?.domainIdentifier === undefined && !opts.urn) {
                throw new Error("Missing required property 'domainIdentifier'");
            }
            if (args?.entityIdentifier === undefined && !opts.urn) {
                throw new Error("Missing required property 'entityIdentifier'");
            }
            if (args?.entityType === undefined && !opts.urn) {
                throw new Error("Missing required property 'entityType'");
            }
            if (args?.policyType === undefined && !opts.urn) {
                throw new Error("Missing required property 'policyType'");
            }
            resourceInputs["detail"] = args?.detail;
            resourceInputs["domainIdentifier"] = args?.domainIdentifier;
            resourceInputs["entityIdentifier"] = args?.entityIdentifier;
            resourceInputs["entityType"] = args?.entityType;
            resourceInputs["policyType"] = args?.policyType;
            resourceInputs["principal"] = args?.principal;
            resourceInputs["createdAt"] = undefined /*out*/;
            resourceInputs["createdBy"] = undefined /*out*/;
            resourceInputs["grantId"] = undefined /*out*/;
        }
        else {
            resourceInputs["createdAt"] = undefined /*out*/;
            resourceInputs["createdBy"] = undefined /*out*/;
            resourceInputs["detail"] = undefined /*out*/;
            resourceInputs["domainIdentifier"] = undefined /*out*/;
            resourceInputs["entityIdentifier"] = undefined /*out*/;
            resourceInputs["entityType"] = undefined /*out*/;
            resourceInputs["grantId"] = undefined /*out*/;
            resourceInputs["policyType"] = undefined /*out*/;
            resourceInputs["principal"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const replaceOnChanges = { replaceOnChanges: ["detail", "domainIdentifier", "entityIdentifier", "entityType", "policyType", "principal"] };
        opts = pulumi.mergeOptions(opts, replaceOnChanges);
        super(PolicyGrant.__pulumiType, name, resourceInputs, opts);
    }
}
exports.PolicyGrant = PolicyGrant;
/** @internal */
PolicyGrant.__pulumiType = 'aws-native:datazone:PolicyGrant';
//# sourceMappingURL=policyGrant.js.map