"""
@generated by mypy-protobuf.  Do not edit manually!
isort:skip_file
*!
Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2026)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""

from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from streamlit.proto import ClientState_pb2 as _ClientState_pb2
from streamlit.proto import Common_pb2 as _Common_pb2
from streamlit.proto import Dataframe_pb2 as _Dataframe_pb2
import builtins as _builtins
import sys
import typing as _typing

if sys.version_info >= (3, 11):
    from typing import TypeAlias as _TypeAlias, Never as _Never
else:
    from typing_extensions import TypeAlias as _TypeAlias, Never as _Never

DESCRIPTOR: _descriptor.FileDescriptor

@_typing.final
class BackMsg(_message.Message):
    """A message from the browser to the server."""

    DESCRIPTOR: _descriptor.Descriptor

    CLEAR_CACHE_FIELD_NUMBER: _builtins.int
    SET_RUN_ON_SAVE_FIELD_NUMBER: _builtins.int
    STOP_SCRIPT_FIELD_NUMBER: _builtins.int
    RERUN_SCRIPT_FIELD_NUMBER: _builtins.int
    LOAD_GIT_INFO_FIELD_NUMBER: _builtins.int
    DEBUG_DISCONNECT_WEBSOCKET_FIELD_NUMBER: _builtins.int
    DEBUG_SHUTDOWN_RUNTIME_FIELD_NUMBER: _builtins.int
    FILE_URLS_REQUEST_FIELD_NUMBER: _builtins.int
    APP_HEARTBEAT_FIELD_NUMBER: _builtins.int
    BACKEND_OPERATION_REQUEST_FIELD_NUMBER: _builtins.int
    DEBUG_LAST_BACKMSG_ID_FIELD_NUMBER: _builtins.int
    clear_cache: _builtins.bool
    """Requests that the app's cached data and resources be cleared"""
    set_run_on_save: _builtins.bool
    """Requests that the runOnSave behavior for this app be set
    to the given value
    """
    stop_script: _builtins.bool
    """Requests that the script's execution be stopped"""
    load_git_info: _builtins.bool
    debug_disconnect_websocket: _builtins.bool
    """Test and dev-mode only field used to ask the server to disconnect the
    client's websocket connection. This message is IGNORED unless the
    runtime is configured with global.developmentMode = True.
    """
    debug_shutdown_runtime: _builtins.bool
    """Test and dev-mode only field used to ask the server to shut down the
    runtime. This message is IGNORED unless the runtime is configured with
    global.developmentMode = True.
    """
    app_heartbeat: _builtins.bool
    """Sends an app heartbeat message through the websocket"""
    debug_last_backmsg_id: _builtins.str
    """An ID used to associate this BackMsg with the corresponding ForwardMsgs
    that are sent to the client due to it. As its name suggests, this field
    should only be used for testing.
    """
    @_builtins.property
    def rerun_script(self) -> _ClientState_pb2.ClientState: ...
    @_builtins.property
    def file_urls_request(self) -> _Common_pb2.FileURLsRequest:
        """Requests that the server generate URLs for getting/uploading/deleting
        files for the `st.file_uploader` widget
        """

    @_builtins.property
    def backend_operation_request(self) -> Global___BackendOperationRequest:
        """Generic backend operation request for server-side operations without script rerun.
        Used for server-side operations like deferred downloads, lazy dataframe loading, server-side validation, autocompletion, etc.
        """

    def __init__(
        self,
        *,
        clear_cache: _builtins.bool = ...,
        set_run_on_save: _builtins.bool = ...,
        stop_script: _builtins.bool = ...,
        rerun_script: _ClientState_pb2.ClientState | None = ...,
        load_git_info: _builtins.bool = ...,
        debug_disconnect_websocket: _builtins.bool = ...,
        debug_shutdown_runtime: _builtins.bool = ...,
        file_urls_request: _Common_pb2.FileURLsRequest | None = ...,
        app_heartbeat: _builtins.bool = ...,
        backend_operation_request: Global___BackendOperationRequest | None = ...,
        debug_last_backmsg_id: _builtins.str = ...,
    ) -> None: ...
    _HasFieldArgType: _TypeAlias = _typing.Literal["app_heartbeat", b"app_heartbeat", "backend_operation_request", b"backend_operation_request", "clear_cache", b"clear_cache", "debug_disconnect_websocket", b"debug_disconnect_websocket", "debug_shutdown_runtime", b"debug_shutdown_runtime", "file_urls_request", b"file_urls_request", "load_git_info", b"load_git_info", "rerun_script", b"rerun_script", "set_run_on_save", b"set_run_on_save", "stop_script", b"stop_script", "type", b"type"]  # noqa: Y015
    def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
    _ClearFieldArgType: _TypeAlias = _typing.Literal["app_heartbeat", b"app_heartbeat", "backend_operation_request", b"backend_operation_request", "clear_cache", b"clear_cache", "debug_disconnect_websocket", b"debug_disconnect_websocket", "debug_last_backmsg_id", b"debug_last_backmsg_id", "debug_shutdown_runtime", b"debug_shutdown_runtime", "file_urls_request", b"file_urls_request", "load_git_info", b"load_git_info", "rerun_script", b"rerun_script", "set_run_on_save", b"set_run_on_save", "stop_script", b"stop_script", "type", b"type"]  # noqa: Y015
    def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
    _WhichOneofReturnType_type: _TypeAlias = _typing.Literal["clear_cache", "set_run_on_save", "stop_script", "rerun_script", "load_git_info", "debug_disconnect_websocket", "debug_shutdown_runtime", "file_urls_request", "app_heartbeat", "backend_operation_request"]  # noqa: Y015
    _WhichOneofArgType_type: _TypeAlias = _typing.Literal["type", b"type"]  # noqa: Y015
    def WhichOneof(self, oneof_group: _WhichOneofArgType_type) -> _WhichOneofReturnType_type | None: ...

Global___BackMsg: _TypeAlias = BackMsg  # noqa: Y015

@_typing.final
class BackendOperationRequest(_message.Message):
    """Generic backend operation request for server-side operations without script rerun."""

    DESCRIPTOR: _descriptor.Descriptor

    REQUEST_ID_FIELD_NUMBER: _builtins.int
    SESSION_ID_FIELD_NUMBER: _builtins.int
    DEFERRED_FILE_FIELD_NUMBER: _builtins.int
    INSTALL_SKILLS_FIELD_NUMBER: _builtins.int
    DISMISS_SKILLS_NUDGE_FIELD_NUMBER: _builtins.int
    DATAFRAME_CHUNK_FIELD_NUMBER: _builtins.int
    request_id: _builtins.str
    """Unique request ID (UUID) generated by the frontend"""
    session_id: _builtins.str
    """Session ID validated against the WebSocket's AppSession before dispatch"""
    @_builtins.property
    def deferred_file(self) -> Global___DeferredFileRequestPayload:
        """Deferred file download request"""

    @_builtins.property
    def install_skills(self) -> Global___InstallSkillsRequestPayload:
        """One-click install of the bundled Streamlit agent skills"""

    @_builtins.property
    def dismiss_skills_nudge(self) -> Global___DismissSkillsNudgeRequestPayload:
        """Permanently dismiss the "install skills" nudge (writes a server-side
        marker so it is not shown again)
        """

    @_builtins.property
    def dataframe_chunk(self) -> Global___DataframeChunkRequestPayload:
        """Lazy dataframe row chunk request"""

    def __init__(
        self,
        *,
        request_id: _builtins.str = ...,
        session_id: _builtins.str = ...,
        deferred_file: Global___DeferredFileRequestPayload | None = ...,
        install_skills: Global___InstallSkillsRequestPayload | None = ...,
        dismiss_skills_nudge: Global___DismissSkillsNudgeRequestPayload | None = ...,
        dataframe_chunk: Global___DataframeChunkRequestPayload | None = ...,
    ) -> None: ...
    _HasFieldArgType: _TypeAlias = _typing.Literal["dataframe_chunk", b"dataframe_chunk", "deferred_file", b"deferred_file", "dismiss_skills_nudge", b"dismiss_skills_nudge", "install_skills", b"install_skills", "payload", b"payload"]  # noqa: Y015
    def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
    _ClearFieldArgType: _TypeAlias = _typing.Literal["dataframe_chunk", b"dataframe_chunk", "deferred_file", b"deferred_file", "dismiss_skills_nudge", b"dismiss_skills_nudge", "install_skills", b"install_skills", "payload", b"payload", "request_id", b"request_id", "session_id", b"session_id"]  # noqa: Y015
    def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
    _WhichOneofReturnType_payload: _TypeAlias = _typing.Literal["deferred_file", "install_skills", "dismiss_skills_nudge", "dataframe_chunk"]  # noqa: Y015
    _WhichOneofArgType_payload: _TypeAlias = _typing.Literal["payload", b"payload"]  # noqa: Y015
    def WhichOneof(self, oneof_group: _WhichOneofArgType_payload) -> _WhichOneofReturnType_payload | None: ...

Global___BackendOperationRequest: _TypeAlias = BackendOperationRequest  # noqa: Y015

@_typing.final
class DeferredFileRequestPayload(_message.Message):
    """Payload for deferred file requests"""

    DESCRIPTOR: _descriptor.Descriptor

    FILE_ID_FIELD_NUMBER: _builtins.int
    file_id: _builtins.str
    def __init__(
        self,
        *,
        file_id: _builtins.str = ...,
    ) -> None: ...
    _HasFieldArgType: _TypeAlias = _Never  # noqa: Y015
    def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
    _ClearFieldArgType: _TypeAlias = _typing.Literal["file_id", b"file_id"]  # noqa: Y015
    def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
    def WhichOneof(self, oneof_group: _Never) -> None: ...

Global___DeferredFileRequestPayload: _TypeAlias = DeferredFileRequestPayload  # noqa: Y015

@_typing.final
class InstallSkillsRequestPayload(_message.Message):
    """Payload for one-click skills install. Currently carries no options; the
    server installs in project mode by default.
    """

    DESCRIPTOR: _descriptor.Descriptor

    def __init__(
        self,
    ) -> None: ...
    _HasFieldArgType: _TypeAlias = _Never  # noqa: Y015
    def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
    _ClearFieldArgType: _TypeAlias = _Never  # noqa: Y015
    def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
    def WhichOneof(self, oneof_group: _Never) -> None: ...

Global___InstallSkillsRequestPayload: _TypeAlias = InstallSkillsRequestPayload  # noqa: Y015

@_typing.final
class DismissSkillsNudgeRequestPayload(_message.Message):
    """Payload to permanently dismiss the "install skills" nudge."""

    DESCRIPTOR: _descriptor.Descriptor

    def __init__(
        self,
    ) -> None: ...
    _HasFieldArgType: _TypeAlias = _Never  # noqa: Y015
    def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
    _ClearFieldArgType: _TypeAlias = _Never  # noqa: Y015
    def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
    def WhichOneof(self, oneof_group: _Never) -> None: ...

Global___DismissSkillsNudgeRequestPayload: _TypeAlias = DismissSkillsNudgeRequestPayload  # noqa: Y015

@_typing.final
class DataframeChunkRequestPayload(_message.Message):
    """Payload for lazy dataframe row chunk requests. Asks the backend to return a
    range of rows for a registered lazy dataframe source without a script rerun.
    """

    DESCRIPTOR: _descriptor.Descriptor

    SOURCE_ID_FIELD_NUMBER: _builtins.int
    OFFSET_FIELD_NUMBER: _builtins.int
    LIMIT_FIELD_NUMBER: _builtins.int
    SORT_FIELD_NUMBER: _builtins.int
    source_id: _builtins.str
    """Session-scoped id of the lazy dataframe source."""
    offset: _builtins.int
    """Row offset of the first requested row."""
    limit: _builtins.int
    """Maximum number of rows to return (the server enforces an upper bound)."""
    @_builtins.property
    def sort(self) -> _Dataframe_pb2.SortState:
        """Optional server-side sort state to apply before slicing."""

    def __init__(
        self,
        *,
        source_id: _builtins.str = ...,
        offset: _builtins.int = ...,
        limit: _builtins.int = ...,
        sort: _Dataframe_pb2.SortState | None = ...,
    ) -> None: ...
    _HasFieldArgType: _TypeAlias = _typing.Literal["_sort", b"_sort", "sort", b"sort"]  # noqa: Y015
    def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
    _ClearFieldArgType: _TypeAlias = _typing.Literal["_sort", b"_sort", "limit", b"limit", "offset", b"offset", "sort", b"sort", "source_id", b"source_id"]  # noqa: Y015
    def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
    _WhichOneofReturnType__sort: _TypeAlias = _typing.Literal["sort"]  # noqa: Y015
    _WhichOneofArgType__sort: _TypeAlias = _typing.Literal["_sort", b"_sort"]  # noqa: Y015
    def WhichOneof(self, oneof_group: _WhichOneofArgType__sort) -> _WhichOneofReturnType__sort | None: ...

Global___DataframeChunkRequestPayload: _TypeAlias = DataframeChunkRequestPayload  # noqa: Y015
