"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.PermissionSetProvisioning = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Provides a resource to manage cloud identity permission set provisioning
 * ## 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: "210005****",
 *     principalType: "User",
 *     principalId: fooUser.id,
 *     deprovisionStrategy: "None",
 * });
 * // It is not recommended to use this resource to provision the permission_set.
 * // When the `volcengine_cloud_identity_permission_set` is updated, you can use this resource to provision the permission set.
 * // When deleting this resource, resource `volcengine_cloud_identity_permission_set_assignment` must be deleted first, and the `deprovision_strategy` of `volcengine_cloud_identity_permission_set_assignment` should be set as `None`.
 * const fooPermissionSetProvisioning = new volcengine.cloud_identity.PermissionSetProvisioning("fooPermissionSetProvisioning", {
 *     permissionSetId: fooPermissionSet.id,
 *     targetId: "210005****",
 *     provisioningStatus: "Provisioned",
 * });
 * ```
 *
 * ## Import
 *
 * CloudIdentityPermissionSetProvisioning can be imported using the permission_set_id:target_id, e.g.
 *
 * ```sh
 * $ pulumi import volcengine:cloud_identity/permissionSetProvisioning:PermissionSetProvisioning default resource_id
 * ```
 */
class PermissionSetProvisioning extends pulumi.CustomResource {
    /**
     * Get an existing PermissionSetProvisioning 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 PermissionSetProvisioning(name, state, Object.assign(Object.assign({}, opts), { id: id }));
    }
    /**
     * Returns true if the given object is an instance of PermissionSetProvisioning.  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'] === PermissionSetProvisioning.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["permissionSetId"] = state ? state.permissionSetId : undefined;
            resourceInputs["provisioningStatus"] = state ? state.provisioningStatus : 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.provisioningStatus === undefined) && !opts.urn) {
                throw new Error("Missing required property 'provisioningStatus'");
            }
            if ((!args || args.targetId === undefined) && !opts.urn) {
                throw new Error("Missing required property 'targetId'");
            }
            resourceInputs["permissionSetId"] = args ? args.permissionSetId : undefined;
            resourceInputs["provisioningStatus"] = args ? args.provisioningStatus : undefined;
            resourceInputs["targetId"] = args ? args.targetId : undefined;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(PermissionSetProvisioning.__pulumiType, name, resourceInputs, opts);
    }
}
exports.PermissionSetProvisioning = PermissionSetProvisioning;
/** @internal */
PermissionSetProvisioning.__pulumiType = 'volcengine:cloud_identity/permissionSetProvisioning:PermissionSetProvisioning';
//# sourceMappingURL=permissionSetProvisioning.js.map