"use strict";
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.PermissionSetAssignment = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Provides a resource to manage cloud identity permission set assignment
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as volcengine from "@volcengine/pulumi";
 *
 * const fooPermissionSet = new volcengine.cloud_identity.PermissionSet("fooPermissionSet", {
 *     description: "tf",
 *     sessionDuration: 5000,
 *     permissionPolicies: [
 *         {
 *             permissionPolicyType: "System",
 *             permissionPolicyName: "AdministratorAccess",
 *             inlinePolicyDocument: "",
 *         },
 *         {
 *             permissionPolicyType: "System",
 *             permissionPolicyName: "ReadOnlyAccess",
 *             inlinePolicyDocument: "",
 *         },
 *         {
 *             permissionPolicyType: "Inline",
 *             inlinePolicyDocument: "{\"Statement\":[{\"Effect\":\"Allow\",\"Action\":[\"auto_scaling:DescribeScalingGroups\"],\"Resource\":[\"*\"]}]}",
 *         },
 *     ],
 * });
 * const fooUser = new volcengine.cloud_identity.User("fooUser", {
 *     userName: "acc-test-user",
 *     displayName: "tf-test-user",
 *     description: "tf",
 *     email: "88@qq.com",
 *     phone: "181",
 * });
 * const fooPermissionSetAssignment = new volcengine.cloud_identity.PermissionSetAssignment("fooPermissionSetAssignment", {
 *     permissionSetId: fooPermissionSet.id,
 *     targetId: "210026****",
 *     principalType: "User",
 *     principalId: fooUser.id,
 * });
 * ```
 *
 * ## Import
 *
 * CloudIdentityPermissionSetAssignment can be imported using the permission_set_id:target_id:principal_type:principal_id, e.g.
 *
 * ```sh
 * $ pulumi import volcengine:cloud_identity/permissionSetAssignment:PermissionSetAssignment default resource_id
 * ```
 */
class PermissionSetAssignment extends pulumi.CustomResource {
    /**
     * Get an existing PermissionSetAssignment 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 PermissionSetAssignment(name, state, Object.assign(Object.assign({}, opts), { id: id }));
    }
    /**
     * Returns true if the given object is an instance of PermissionSetAssignment.  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'] === PermissionSetAssignment.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["deprovisionStrategy"] = state ? state.deprovisionStrategy : undefined;
            resourceInputs["permissionSetId"] = state ? state.permissionSetId : undefined;
            resourceInputs["principalId"] = state ? state.principalId : undefined;
            resourceInputs["principalType"] = state ? state.principalType : undefined;
            resourceInputs["targetId"] = state ? state.targetId : undefined;
        }
        else {
            const args = argsOrState;
            if ((!args || args.permissionSetId === undefined) && !opts.urn) {
                throw new Error("Missing required property 'permissionSetId'");
            }
            if ((!args || args.principalId === undefined) && !opts.urn) {
                throw new Error("Missing required property 'principalId'");
            }
            if ((!args || args.principalType === undefined) && !opts.urn) {
                throw new Error("Missing required property 'principalType'");
            }
            if ((!args || args.targetId === undefined) && !opts.urn) {
                throw new Error("Missing required property 'targetId'");
            }
            resourceInputs["deprovisionStrategy"] = args ? args.deprovisionStrategy : undefined;
            resourceInputs["permissionSetId"] = args ? args.permissionSetId : undefined;
            resourceInputs["principalId"] = args ? args.principalId : undefined;
            resourceInputs["principalType"] = args ? args.principalType : undefined;
            resourceInputs["targetId"] = args ? args.targetId : undefined;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(PermissionSetAssignment.__pulumiType, name, resourceInputs, opts);
    }
}
exports.PermissionSetAssignment = PermissionSetAssignment;
/** @internal */
PermissionSetAssignment.__pulumiType = 'volcengine:cloud_identity/permissionSetAssignment:PermissionSetAssignment';
//# sourceMappingURL=permissionSetAssignment.js.map