# 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

__all__ = [
    'GetPermissionResult',
    'AwaitableGetPermissionResult',
    'get_permission',
    'get_permission_output',
]

@pulumi.output_type
class GetPermissionResult:
    """
    A collection of values returned by getPermission.
    """
    def __init__(__self__, authorized_at=None, authorizer_id=None, authorizer_name=None, authorizer_type=None, cluster_id=None, created_time=None, grantee_id=None, grantee_type=None, id=None, is_custom_role=None, kube_role_binding_name=None, message=None, namespace=None, permission_id=None, project_selector=None, revoked_at=None, role_domain=None, role_name=None, status=None):
        if authorized_at and not isinstance(authorized_at, str):
            raise TypeError("Expected argument 'authorized_at' to be a str")
        pulumi.set(__self__, "authorized_at", authorized_at)
        if authorizer_id and not isinstance(authorizer_id, int):
            raise TypeError("Expected argument 'authorizer_id' to be a int")
        pulumi.set(__self__, "authorizer_id", authorizer_id)
        if authorizer_name and not isinstance(authorizer_name, str):
            raise TypeError("Expected argument 'authorizer_name' to be a str")
        pulumi.set(__self__, "authorizer_name", authorizer_name)
        if authorizer_type and not isinstance(authorizer_type, str):
            raise TypeError("Expected argument 'authorizer_type' to be a str")
        pulumi.set(__self__, "authorizer_type", authorizer_type)
        if cluster_id and not isinstance(cluster_id, str):
            raise TypeError("Expected argument 'cluster_id' to be a str")
        pulumi.set(__self__, "cluster_id", cluster_id)
        if created_time and not isinstance(created_time, str):
            raise TypeError("Expected argument 'created_time' to be a str")
        pulumi.set(__self__, "created_time", created_time)
        if grantee_id and not isinstance(grantee_id, int):
            raise TypeError("Expected argument 'grantee_id' to be a int")
        pulumi.set(__self__, "grantee_id", grantee_id)
        if grantee_type and not isinstance(grantee_type, str):
            raise TypeError("Expected argument 'grantee_type' to be a str")
        pulumi.set(__self__, "grantee_type", grantee_type)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if is_custom_role and not isinstance(is_custom_role, bool):
            raise TypeError("Expected argument 'is_custom_role' to be a bool")
        pulumi.set(__self__, "is_custom_role", is_custom_role)
        if kube_role_binding_name and not isinstance(kube_role_binding_name, str):
            raise TypeError("Expected argument 'kube_role_binding_name' to be a str")
        pulumi.set(__self__, "kube_role_binding_name", kube_role_binding_name)
        if message and not isinstance(message, str):
            raise TypeError("Expected argument 'message' to be a str")
        pulumi.set(__self__, "message", message)
        if namespace and not isinstance(namespace, str):
            raise TypeError("Expected argument 'namespace' to be a str")
        pulumi.set(__self__, "namespace", namespace)
        if permission_id and not isinstance(permission_id, str):
            raise TypeError("Expected argument 'permission_id' to be a str")
        pulumi.set(__self__, "permission_id", permission_id)
        if project_selector and not isinstance(project_selector, str):
            raise TypeError("Expected argument 'project_selector' to be a str")
        pulumi.set(__self__, "project_selector", project_selector)
        if revoked_at and not isinstance(revoked_at, str):
            raise TypeError("Expected argument 'revoked_at' to be a str")
        pulumi.set(__self__, "revoked_at", revoked_at)
        if role_domain and not isinstance(role_domain, str):
            raise TypeError("Expected argument 'role_domain' to be a str")
        pulumi.set(__self__, "role_domain", role_domain)
        if role_name and not isinstance(role_name, str):
            raise TypeError("Expected argument 'role_name' to be a str")
        pulumi.set(__self__, "role_name", role_name)
        if status and not isinstance(status, str):
            raise TypeError("Expected argument 'status' to be a str")
        pulumi.set(__self__, "status", status)

    @property
    @pulumi.getter(name="authorizedAt")
    def authorized_at(self) -> builtins.str:
        """
        RBAC 权限策略资源被授权的时间。
        """
        return pulumi.get(self, "authorized_at")

    @property
    @pulumi.getter(name="authorizerId")
    def authorizer_id(self) -> builtins.int:
        """
        授权者的 ID。可以是 IAM 用户 ID，也可以是 IAM 角色 ID。
        """
        return pulumi.get(self, "authorizer_id")

    @property
    @pulumi.getter(name="authorizerName")
    def authorizer_name(self) -> builtins.str:
        """
        授权者名称
        """
        return pulumi.get(self, "authorizer_name")

    @property
    @pulumi.getter(name="authorizerType")
    def authorizer_type(self) -> builtins.str:
        """
        授权者的类型，取值如下：User：IAM 用户。Role：IAM 角色。Account：账号。
        """
        return pulumi.get(self, "authorizer_type")

    @property
    @pulumi.getter(name="clusterId")
    def cluster_id(self) -> builtins.str:
        """
        需要授权给 IAM 用户或角色的集群 ID。roleDomain为namespace或cluster时必须填写该参数值。
        """
        return pulumi.get(self, "cluster_id")

    @property
    @pulumi.getter(name="createdTime")
    def created_time(self) -> builtins.str:
        """
        RBAC 权限策略资源创建的时间。
        """
        return pulumi.get(self, "created_time")

    @property
    @pulumi.getter(name="granteeId")
    def grantee_id(self) -> builtins.int:
        """
        被授权者的 ID。可以是 IAM 用户 ID，也可以是 IAM 角色 ID。
        """
        return pulumi.get(self, "grantee_id")

    @property
    @pulumi.getter(name="granteeType")
    def grantee_type(self) -> builtins.str:
        """
        被授权者的类型，取值如下：User：IAM 用户。Role：IAM 角色。Account：账号。
        """
        return pulumi.get(self, "grantee_type")

    @property
    @pulumi.getter
    def id(self) -> builtins.str:
        """
        Uniquely identifies the resource.
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter(name="isCustomRole")
    def is_custom_role(self) -> builtins.bool:
        """
        给被授权者授予的 RBAC 角色是否为自定义角色，取值如下：true：自定义角色。false：（默认值）系统预置的角色。
        """
        return pulumi.get(self, "is_custom_role")

    @property
    @pulumi.getter(name="kubeRoleBindingName")
    def kube_role_binding_name(self) -> builtins.str:
        """
        RBAC 权限策略资源在 Kubernetes 中的对象名称。
        """
        return pulumi.get(self, "kube_role_binding_name")

    @property
    @pulumi.getter
    def message(self) -> builtins.str:
        """
        授权详细消息。
        """
        return pulumi.get(self, "message")

    @property
    @pulumi.getter
    def namespace(self) -> builtins.str:
        """
        需要授权给 IAM 用户或角色的名空间名称。roleDomain等于namespace时必须填写该参数值。roleDomain不等于namespace时，填写该参数值不生效。
        """
        return pulumi.get(self, "namespace")

    @property
    @pulumi.getter(name="permissionId")
    def permission_id(self) -> builtins.str:
        """
        RBAC 权限策略资源 ID。
        """
        return pulumi.get(self, "permission_id")

    @property
    @pulumi.getter(name="projectSelector")
    def project_selector(self) -> builtins.str:
        """
        项目选择器
        """
        return pulumi.get(self, "project_selector")

    @property
    @pulumi.getter(name="revokedAt")
    def revoked_at(self) -> builtins.str:
        """
        撤销授权的时间。
        """
        return pulumi.get(self, "revoked_at")

    @property
    @pulumi.getter(name="roleDomain")
    def role_domain(self) -> builtins.str:
        """
        为 IAM 用户或角色授予的权限类型，取值如下：namespace：授予命名空间级别的权限。cluster：授予集群级别的权限。all_clusters：授予当前账号下全部集群级别的权限。
        """
        return pulumi.get(self, "role_domain")

    @property
    @pulumi.getter(name="roleName")
    def role_name(self) -> builtins.str:
        """
        给被授权者授予的 RBAC 角色名称。目前必须填写该参数。当roleDomain为all_clusters时，不可以自定义角色名称。
        """
        return pulumi.get(self, "role_name")

    @property
    @pulumi.getter
    def status(self) -> builtins.str:
        """
        RBAC 权限访问策略资源的状态，取值如下：Success：授权成功。Failed：授权失败。Pending：授权中。PartialSuccess：部分授权成功。
        """
        return pulumi.get(self, "status")


class AwaitableGetPermissionResult(GetPermissionResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetPermissionResult(
            authorized_at=self.authorized_at,
            authorizer_id=self.authorizer_id,
            authorizer_name=self.authorizer_name,
            authorizer_type=self.authorizer_type,
            cluster_id=self.cluster_id,
            created_time=self.created_time,
            grantee_id=self.grantee_id,
            grantee_type=self.grantee_type,
            id=self.id,
            is_custom_role=self.is_custom_role,
            kube_role_binding_name=self.kube_role_binding_name,
            message=self.message,
            namespace=self.namespace,
            permission_id=self.permission_id,
            project_selector=self.project_selector,
            revoked_at=self.revoked_at,
            role_domain=self.role_domain,
            role_name=self.role_name,
            status=self.status)


def get_permission(id: Optional[builtins.str] = None,
                   opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetPermissionResult:
    """
    Data Source schema for Byteplus::VKE::Permission


    :param builtins.str id: Uniquely identifies the resource.
    """
    __args__ = dict()
    __args__['id'] = id
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('bytepluscc:vke/getPermission:getPermission', __args__, opts=opts, typ=GetPermissionResult).value

    return AwaitableGetPermissionResult(
        authorized_at=pulumi.get(__ret__, 'authorized_at'),
        authorizer_id=pulumi.get(__ret__, 'authorizer_id'),
        authorizer_name=pulumi.get(__ret__, 'authorizer_name'),
        authorizer_type=pulumi.get(__ret__, 'authorizer_type'),
        cluster_id=pulumi.get(__ret__, 'cluster_id'),
        created_time=pulumi.get(__ret__, 'created_time'),
        grantee_id=pulumi.get(__ret__, 'grantee_id'),
        grantee_type=pulumi.get(__ret__, 'grantee_type'),
        id=pulumi.get(__ret__, 'id'),
        is_custom_role=pulumi.get(__ret__, 'is_custom_role'),
        kube_role_binding_name=pulumi.get(__ret__, 'kube_role_binding_name'),
        message=pulumi.get(__ret__, 'message'),
        namespace=pulumi.get(__ret__, 'namespace'),
        permission_id=pulumi.get(__ret__, 'permission_id'),
        project_selector=pulumi.get(__ret__, 'project_selector'),
        revoked_at=pulumi.get(__ret__, 'revoked_at'),
        role_domain=pulumi.get(__ret__, 'role_domain'),
        role_name=pulumi.get(__ret__, 'role_name'),
        status=pulumi.get(__ret__, 'status'))
def get_permission_output(id: Optional[pulumi.Input[builtins.str]] = None,
                          opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetPermissionResult]:
    """
    Data Source schema for Byteplus::VKE::Permission


    :param builtins.str id: Uniquely identifies the resource.
    """
    __args__ = dict()
    __args__['id'] = id
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('bytepluscc:vke/getPermission:getPermission', __args__, opts=opts, typ=GetPermissionResult)
    return __ret__.apply(lambda __response__: GetPermissionResult(
        authorized_at=pulumi.get(__response__, 'authorized_at'),
        authorizer_id=pulumi.get(__response__, 'authorizer_id'),
        authorizer_name=pulumi.get(__response__, 'authorizer_name'),
        authorizer_type=pulumi.get(__response__, 'authorizer_type'),
        cluster_id=pulumi.get(__response__, 'cluster_id'),
        created_time=pulumi.get(__response__, 'created_time'),
        grantee_id=pulumi.get(__response__, 'grantee_id'),
        grantee_type=pulumi.get(__response__, 'grantee_type'),
        id=pulumi.get(__response__, 'id'),
        is_custom_role=pulumi.get(__response__, 'is_custom_role'),
        kube_role_binding_name=pulumi.get(__response__, 'kube_role_binding_name'),
        message=pulumi.get(__response__, 'message'),
        namespace=pulumi.get(__response__, 'namespace'),
        permission_id=pulumi.get(__response__, 'permission_id'),
        project_selector=pulumi.get(__response__, 'project_selector'),
        revoked_at=pulumi.get(__response__, 'revoked_at'),
        role_domain=pulumi.get(__response__, 'role_domain'),
        role_name=pulumi.get(__response__, 'role_name'),
        status=pulumi.get(__response__, 'status')))
