from typing import Any, Literal
from octostar_streamlit.core.method_call import MethodCall


DesktopApiMethod = Literal[
    "refresh",
    "openWorkspace",
    "getActiveWorkspace",
    "setActiveWorkspace",
    "closeWorkspace",
    "copy",
    "listAllWorkspaces",
    "getOpenWorkspaces",
    "getOpenWorkspaceIds",
    "setOpenWorkspaceIds",
    "onWorkspaceChanged",
    "onWorkspaceItemChanged",
    "getAttachment",
    "getStylerOptions",
    "getStyler",
    "getWorkspace",
    "getWorkspaceItems",
    "applyTag",
    "removeTag",
    "updateTag",
    "getItem",
    "getItems",
    "getTags",
    "getAvailableTags",
    "getTemplates",
    "getTemplate",
    "getSchemaItems",
    "createWorkspace",
    "connect",
    "save",
    "saveFile",
    "import",
    "importZip",
    "export",
    "getFilesTree",
    "open",
    "delete",
    "searchXperience",
    "getSearchResults",
    "showTab",
    "closeTab",
    "callAppService",
    "showContextMenu",
    "showToast",
    "clearToast",
    "showProgress",
    "withProgressBar",
    "showConfirm",
    "showFileUpload",
    "showCreateEntityForm",
    "getPasteContext",
    "showModalTemplate",
    "addComment",
    "removeComment",
    "addWatchIntent",
    "removeWatchIntent",
    "getWorkspacePermission",
    "getUser",
    "deployApp",
    "undeployApp",
    "whoami",
]


class DesktopMethodCall(MethodCall):
    service: Literal["desktop"] = "desktop"
    method: DesktopApiMethod
    params: Any
