from enum import Enum
from typing import Literal


class Privilege(Enum):
    SELECT = "SELECT"
    READ_PRIVATE_FILES = "READ_PRIVATE_FILES"
    WRITE_PRIVATE_FILES = "WRITE_PRIVATE_FILES"
    CREATE = "CREATE"
    USAGE = "USAGE"
    USE_CATALOG = "USE_CATALOG"
    USE_SCHEMA = "USE_SCHEMA"
    CREATE_SCHEMA = "CREATE_SCHEMA"
    CREATE_VIEW = "CREATE_VIEW"
    CREATE_EXTERNAL_TABLE = "CREATE_EXTERNAL_TABLE"
    CREATE_MATERIALIZED_VIEW = "CREATE_MATERIALIZED_VIEW"
    CREATE_FUNCTION = "CREATE_FUNCTION"
    CREATE_MODEL = "CREATE_MODEL"
    CREATE_CATALOG = "CREATE_CATALOG"
    CREATE_MANAGED_STORAGE = "CREATE_MANAGED_STORAGE"
    CREATE_EXTERNAL_LOCATION = "CREATE_EXTERNAL_LOCATION"
    CREATE_STORAGE_CREDENTIAL = "CREATE_STORAGE_CREDENTIAL"
    CREATE_SERVICE_CREDENTIAL = "CREATE_SERVICE_CREDENTIAL"
    ACCESS = "ACCESS"
    CREATE_SHARE = "CREATE_SHARE"
    CREATE_RECIPIENT = "CREATE_RECIPIENT"
    CREATE_PROVIDER = "CREATE_PROVIDER"
    USE_SHARE = "USE_SHARE"
    USE_RECIPIENT = "USE_RECIPIENT"
    USE_PROVIDER = "USE_PROVIDER"
    USE_MARKETPLACE_ASSETS = "USE_MARKETPLACE_ASSETS"
    SET_SHARE_PERMISSION = "SET_SHARE_PERMISSION"
    MODIFY = "MODIFY"
    REFRESH = "REFRESH"
    EXECUTE = "EXECUTE"
    READ_FILES = "READ_FILES"
    WRITE_FILES = "WRITE_FILES"
    CREATE_TABLE = "CREATE_TABLE"
    ALL_PRIVILEGES = "ALL_PRIVILEGES"
    CREATE_CONNECTION = "CREATE_CONNECTION"
    USE_CONNECTION = "USE_CONNECTION"
    APPLY_TAG = "APPLY_TAG"
    CREATE_FOREIGN_CATALOG = "CREATE_FOREIGN_CATALOG"
    CREATE_FOREIGN_SECURABLE = "CREATE_FOREIGN_SECURABLE"
    MANAGE_ALLOWLIST = "MANAGE_ALLOWLIST"
    CREATE_VOLUME = "CREATE_VOLUME"
    CREATE_EXTERNAL_VOLUME = "CREATE_EXTERNAL_VOLUME"
    READ_VOLUME = "READ_VOLUME"
    WRITE_VOLUME = "WRITE_VOLUME"
    MANAGE = "MANAGE"
    BROWSE = "BROWSE"
    CREATE_CLEAN_ROOM = "CREATE_CLEAN_ROOM"
    MODIFY_CLEAN_ROOM = "MODIFY_CLEAN_ROOM"
    EXECUTE_CLEAN_ROOM_TASK = "EXECUTE_CLEAN_ROOM_TASK"
    EXTERNAL_USE_SCHEMA = "EXTERNAL_USE_SCHEMA"


PrivilegeParam = (
    Literal[
        "SELECT",
        "READ_PRIVATE_FILES",
        "WRITE_PRIVATE_FILES",
        "CREATE",
        "USAGE",
        "USE_CATALOG",
        "USE_SCHEMA",
        "CREATE_SCHEMA",
        "CREATE_VIEW",
        "CREATE_EXTERNAL_TABLE",
        "CREATE_MATERIALIZED_VIEW",
        "CREATE_FUNCTION",
        "CREATE_MODEL",
        "CREATE_CATALOG",
        "CREATE_MANAGED_STORAGE",
        "CREATE_EXTERNAL_LOCATION",
        "CREATE_STORAGE_CREDENTIAL",
        "CREATE_SERVICE_CREDENTIAL",
        "ACCESS",
        "CREATE_SHARE",
        "CREATE_RECIPIENT",
        "CREATE_PROVIDER",
        "USE_SHARE",
        "USE_RECIPIENT",
        "USE_PROVIDER",
        "USE_MARKETPLACE_ASSETS",
        "SET_SHARE_PERMISSION",
        "MODIFY",
        "REFRESH",
        "EXECUTE",
        "READ_FILES",
        "WRITE_FILES",
        "CREATE_TABLE",
        "ALL_PRIVILEGES",
        "CREATE_CONNECTION",
        "USE_CONNECTION",
        "APPLY_TAG",
        "CREATE_FOREIGN_CATALOG",
        "CREATE_FOREIGN_SECURABLE",
        "MANAGE_ALLOWLIST",
        "CREATE_VOLUME",
        "CREATE_EXTERNAL_VOLUME",
        "READ_VOLUME",
        "WRITE_VOLUME",
        "MANAGE",
        "BROWSE",
        "CREATE_CLEAN_ROOM",
        "MODIFY_CLEAN_ROOM",
        "EXECUTE_CLEAN_ROOM_TASK",
        "EXTERNAL_USE_SCHEMA",
    ]
    | Privilege
)
