# coding=utf-8
# *** 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! ***

import builtins
import copy
import warnings
import sys
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
if sys.version_info >= (3, 11):
    from typing import NotRequired, TypedDict, TypeAlias
else:
    from typing_extensions import NotRequired, TypedDict, TypeAlias
from .. import _utilities
from . import outputs
from ._inputs import *

__all__ = ['PermissionSetArgs', 'PermissionSet']

@pulumi.input_type
class PermissionSetArgs:
    def __init__(__self__, *,
                 name: pulumi.Input[builtins.str],
                 description: Optional[pulumi.Input[builtins.str]] = None,
                 permission_policies: Optional[pulumi.Input[Sequence[pulumi.Input['PermissionSetPermissionPolicyArgs']]]] = None,
                 relay_state: Optional[pulumi.Input[builtins.str]] = None,
                 session_duration: Optional[pulumi.Input[builtins.int]] = None):
        """
        The set of arguments for constructing a PermissionSet resource.
        :param pulumi.Input[builtins.str] name: 权限集名称。
        :param pulumi.Input[builtins.str] description: 权限集描述。
        :param pulumi.Input[builtins.str] relay_state: 跳转控制台 URL。
        :param pulumi.Input[builtins.int] session_duration: session 过期时间，单位秒。
        """
        pulumi.set(__self__, "name", name)
        if description is not None:
            pulumi.set(__self__, "description", description)
        if permission_policies is not None:
            pulumi.set(__self__, "permission_policies", permission_policies)
        if relay_state is not None:
            pulumi.set(__self__, "relay_state", relay_state)
        if session_duration is not None:
            pulumi.set(__self__, "session_duration", session_duration)

    @property
    @pulumi.getter
    def name(self) -> pulumi.Input[builtins.str]:
        """
        权限集名称。
        """
        return pulumi.get(self, "name")

    @name.setter
    def name(self, value: pulumi.Input[builtins.str]):
        pulumi.set(self, "name", value)

    @property
    @pulumi.getter
    def description(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        权限集描述。
        """
        return pulumi.get(self, "description")

    @description.setter
    def description(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "description", value)

    @property
    @pulumi.getter(name="permissionPolicies")
    def permission_policies(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['PermissionSetPermissionPolicyArgs']]]]:
        return pulumi.get(self, "permission_policies")

    @permission_policies.setter
    def permission_policies(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['PermissionSetPermissionPolicyArgs']]]]):
        pulumi.set(self, "permission_policies", value)

    @property
    @pulumi.getter(name="relayState")
    def relay_state(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        跳转控制台 URL。
        """
        return pulumi.get(self, "relay_state")

    @relay_state.setter
    def relay_state(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "relay_state", value)

    @property
    @pulumi.getter(name="sessionDuration")
    def session_duration(self) -> Optional[pulumi.Input[builtins.int]]:
        """
        session 过期时间，单位秒。
        """
        return pulumi.get(self, "session_duration")

    @session_duration.setter
    def session_duration(self, value: Optional[pulumi.Input[builtins.int]]):
        pulumi.set(self, "session_duration", value)


@pulumi.input_type
class _PermissionSetState:
    def __init__(__self__, *,
                 created_time: Optional[pulumi.Input[builtins.str]] = None,
                 description: Optional[pulumi.Input[builtins.str]] = None,
                 name: Optional[pulumi.Input[builtins.str]] = None,
                 permission_policies: Optional[pulumi.Input[Sequence[pulumi.Input['PermissionSetPermissionPolicyArgs']]]] = None,
                 permission_set_id: Optional[pulumi.Input[builtins.str]] = None,
                 relay_state: Optional[pulumi.Input[builtins.str]] = None,
                 session_duration: Optional[pulumi.Input[builtins.int]] = None,
                 status_notifications: Optional[pulumi.Input[Sequence[pulumi.Input[builtins.str]]]] = None,
                 updated_time: Optional[pulumi.Input[builtins.str]] = None):
        """
        Input properties used for looking up and filtering PermissionSet resources.
        :param pulumi.Input[builtins.str] created_time: 创建时间。
        :param pulumi.Input[builtins.str] description: 权限集描述。
        :param pulumi.Input[builtins.str] name: 权限集名称。
        :param pulumi.Input[builtins.str] permission_set_id: 权限集 ID。
        :param pulumi.Input[builtins.str] relay_state: 跳转控制台 URL。
        :param pulumi.Input[builtins.int] session_duration: session 过期时间，单位秒。
        :param pulumi.Input[Sequence[pulumi.Input[builtins.str]]] status_notifications: 状态通知配置。
        :param pulumi.Input[builtins.str] updated_time: 更新时间。
        """
        if created_time is not None:
            pulumi.set(__self__, "created_time", created_time)
        if description is not None:
            pulumi.set(__self__, "description", description)
        if name is not None:
            pulumi.set(__self__, "name", name)
        if permission_policies is not None:
            pulumi.set(__self__, "permission_policies", permission_policies)
        if permission_set_id is not None:
            pulumi.set(__self__, "permission_set_id", permission_set_id)
        if relay_state is not None:
            pulumi.set(__self__, "relay_state", relay_state)
        if session_duration is not None:
            pulumi.set(__self__, "session_duration", session_duration)
        if status_notifications is not None:
            pulumi.set(__self__, "status_notifications", status_notifications)
        if updated_time is not None:
            pulumi.set(__self__, "updated_time", updated_time)

    @property
    @pulumi.getter(name="createdTime")
    def created_time(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        创建时间。
        """
        return pulumi.get(self, "created_time")

    @created_time.setter
    def created_time(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "created_time", value)

    @property
    @pulumi.getter
    def description(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        权限集描述。
        """
        return pulumi.get(self, "description")

    @description.setter
    def description(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "description", value)

    @property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        权限集名称。
        """
        return pulumi.get(self, "name")

    @name.setter
    def name(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "name", value)

    @property
    @pulumi.getter(name="permissionPolicies")
    def permission_policies(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['PermissionSetPermissionPolicyArgs']]]]:
        return pulumi.get(self, "permission_policies")

    @permission_policies.setter
    def permission_policies(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['PermissionSetPermissionPolicyArgs']]]]):
        pulumi.set(self, "permission_policies", value)

    @property
    @pulumi.getter(name="permissionSetId")
    def permission_set_id(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        权限集 ID。
        """
        return pulumi.get(self, "permission_set_id")

    @permission_set_id.setter
    def permission_set_id(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "permission_set_id", value)

    @property
    @pulumi.getter(name="relayState")
    def relay_state(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        跳转控制台 URL。
        """
        return pulumi.get(self, "relay_state")

    @relay_state.setter
    def relay_state(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "relay_state", value)

    @property
    @pulumi.getter(name="sessionDuration")
    def session_duration(self) -> Optional[pulumi.Input[builtins.int]]:
        """
        session 过期时间，单位秒。
        """
        return pulumi.get(self, "session_duration")

    @session_duration.setter
    def session_duration(self, value: Optional[pulumi.Input[builtins.int]]):
        pulumi.set(self, "session_duration", value)

    @property
    @pulumi.getter(name="statusNotifications")
    def status_notifications(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[builtins.str]]]]:
        """
        状态通知配置。
        """
        return pulumi.get(self, "status_notifications")

    @status_notifications.setter
    def status_notifications(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[builtins.str]]]]):
        pulumi.set(self, "status_notifications", value)

    @property
    @pulumi.getter(name="updatedTime")
    def updated_time(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        更新时间。
        """
        return pulumi.get(self, "updated_time")

    @updated_time.setter
    def updated_time(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "updated_time", value)


@pulumi.type_token("bytepluscc:cloudidentity/permissionSet:PermissionSet")
class PermissionSet(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 description: Optional[pulumi.Input[builtins.str]] = None,
                 name: Optional[pulumi.Input[builtins.str]] = None,
                 permission_policies: Optional[pulumi.Input[Sequence[pulumi.Input[Union['PermissionSetPermissionPolicyArgs', 'PermissionSetPermissionPolicyArgsDict']]]]] = None,
                 relay_state: Optional[pulumi.Input[builtins.str]] = None,
                 session_duration: Optional[pulumi.Input[builtins.int]] = None,
                 __props__=None):
        """
        当您创建好云身份中心用户后，需要授予用户访问到各账号的登录访问权限。当用户访问火山引擎云资源的权限访问具备可抽象的共性时，如：网络运维权限、安全管理权限等，您可以在云身份中心预置访问权限集作为权限模版，最终基于访问权限集来实现中心化授权。云身份中心将会为您同步分发访问权限集到各个账号，减少企业权限的运维成本。

        ## Import

        ```sh
        $ pulumi import bytepluscc:cloudidentity/permissionSet:PermissionSet example "permission_set_id"
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[builtins.str] description: 权限集描述。
        :param pulumi.Input[builtins.str] name: 权限集名称。
        :param pulumi.Input[builtins.str] relay_state: 跳转控制台 URL。
        :param pulumi.Input[builtins.int] session_duration: session 过期时间，单位秒。
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: PermissionSetArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        当您创建好云身份中心用户后，需要授予用户访问到各账号的登录访问权限。当用户访问火山引擎云资源的权限访问具备可抽象的共性时，如：网络运维权限、安全管理权限等，您可以在云身份中心预置访问权限集作为权限模版，最终基于访问权限集来实现中心化授权。云身份中心将会为您同步分发访问权限集到各个账号，减少企业权限的运维成本。

        ## Import

        ```sh
        $ pulumi import bytepluscc:cloudidentity/permissionSet:PermissionSet example "permission_set_id"
        ```

        :param str resource_name: The name of the resource.
        :param PermissionSetArgs args: The arguments to use to populate this resource's properties.
        :param pulumi.ResourceOptions opts: Options for the resource.
        """
        ...
    def __init__(__self__, resource_name: str, *args, **kwargs):
        resource_args, opts = _utilities.get_resource_args_opts(PermissionSetArgs, pulumi.ResourceOptions, *args, **kwargs)
        if resource_args is not None:
            __self__._internal_init(resource_name, opts, **resource_args.__dict__)
        else:
            __self__._internal_init(resource_name, *args, **kwargs)

    def _internal_init(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 description: Optional[pulumi.Input[builtins.str]] = None,
                 name: Optional[pulumi.Input[builtins.str]] = None,
                 permission_policies: Optional[pulumi.Input[Sequence[pulumi.Input[Union['PermissionSetPermissionPolicyArgs', 'PermissionSetPermissionPolicyArgsDict']]]]] = None,
                 relay_state: Optional[pulumi.Input[builtins.str]] = None,
                 session_duration: Optional[pulumi.Input[builtins.int]] = None,
                 __props__=None):
        opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.id is None:
            if __props__ is not None:
                raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
            __props__ = PermissionSetArgs.__new__(PermissionSetArgs)

            __props__.__dict__["description"] = description
            if name is None and not opts.urn:
                raise TypeError("Missing required property 'name'")
            __props__.__dict__["name"] = name
            __props__.__dict__["permission_policies"] = permission_policies
            __props__.__dict__["relay_state"] = relay_state
            __props__.__dict__["session_duration"] = session_duration
            __props__.__dict__["created_time"] = None
            __props__.__dict__["permission_set_id"] = None
            __props__.__dict__["status_notifications"] = None
            __props__.__dict__["updated_time"] = None
        super(PermissionSet, __self__).__init__(
            'bytepluscc:cloudidentity/permissionSet:PermissionSet',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            created_time: Optional[pulumi.Input[builtins.str]] = None,
            description: Optional[pulumi.Input[builtins.str]] = None,
            name: Optional[pulumi.Input[builtins.str]] = None,
            permission_policies: Optional[pulumi.Input[Sequence[pulumi.Input[Union['PermissionSetPermissionPolicyArgs', 'PermissionSetPermissionPolicyArgsDict']]]]] = None,
            permission_set_id: Optional[pulumi.Input[builtins.str]] = None,
            relay_state: Optional[pulumi.Input[builtins.str]] = None,
            session_duration: Optional[pulumi.Input[builtins.int]] = None,
            status_notifications: Optional[pulumi.Input[Sequence[pulumi.Input[builtins.str]]]] = None,
            updated_time: Optional[pulumi.Input[builtins.str]] = None) -> 'PermissionSet':
        """
        Get an existing PermissionSet resource's state with the given name, id, and optional extra
        properties used to qualify the lookup.

        :param str resource_name: The unique name of the resulting resource.
        :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[builtins.str] created_time: 创建时间。
        :param pulumi.Input[builtins.str] description: 权限集描述。
        :param pulumi.Input[builtins.str] name: 权限集名称。
        :param pulumi.Input[builtins.str] permission_set_id: 权限集 ID。
        :param pulumi.Input[builtins.str] relay_state: 跳转控制台 URL。
        :param pulumi.Input[builtins.int] session_duration: session 过期时间，单位秒。
        :param pulumi.Input[Sequence[pulumi.Input[builtins.str]]] status_notifications: 状态通知配置。
        :param pulumi.Input[builtins.str] updated_time: 更新时间。
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _PermissionSetState.__new__(_PermissionSetState)

        __props__.__dict__["created_time"] = created_time
        __props__.__dict__["description"] = description
        __props__.__dict__["name"] = name
        __props__.__dict__["permission_policies"] = permission_policies
        __props__.__dict__["permission_set_id"] = permission_set_id
        __props__.__dict__["relay_state"] = relay_state
        __props__.__dict__["session_duration"] = session_duration
        __props__.__dict__["status_notifications"] = status_notifications
        __props__.__dict__["updated_time"] = updated_time
        return PermissionSet(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter(name="createdTime")
    def created_time(self) -> pulumi.Output[builtins.str]:
        """
        创建时间。
        """
        return pulumi.get(self, "created_time")

    @property
    @pulumi.getter
    def description(self) -> pulumi.Output[builtins.str]:
        """
        权限集描述。
        """
        return pulumi.get(self, "description")

    @property
    @pulumi.getter
    def name(self) -> pulumi.Output[builtins.str]:
        """
        权限集名称。
        """
        return pulumi.get(self, "name")

    @property
    @pulumi.getter(name="permissionPolicies")
    def permission_policies(self) -> pulumi.Output[Sequence['outputs.PermissionSetPermissionPolicy']]:
        return pulumi.get(self, "permission_policies")

    @property
    @pulumi.getter(name="permissionSetId")
    def permission_set_id(self) -> pulumi.Output[builtins.str]:
        """
        权限集 ID。
        """
        return pulumi.get(self, "permission_set_id")

    @property
    @pulumi.getter(name="relayState")
    def relay_state(self) -> pulumi.Output[builtins.str]:
        """
        跳转控制台 URL。
        """
        return pulumi.get(self, "relay_state")

    @property
    @pulumi.getter(name="sessionDuration")
    def session_duration(self) -> pulumi.Output[builtins.int]:
        """
        session 过期时间，单位秒。
        """
        return pulumi.get(self, "session_duration")

    @property
    @pulumi.getter(name="statusNotifications")
    def status_notifications(self) -> pulumi.Output[Sequence[builtins.str]]:
        """
        状态通知配置。
        """
        return pulumi.get(self, "status_notifications")

    @property
    @pulumi.getter(name="updatedTime")
    def updated_time(self) -> pulumi.Output[builtins.str]:
        """
        更新时间。
        """
        return pulumi.get(self, "updated_time")

