"""
@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
import builtins as _builtins
import sys
import typing as _typing

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

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
    DEFERRED_FILE_REQUEST_FIELD_NUMBER: _builtins.int
    DEBUG_LAST_BACKMSG_ID_FIELD_NUMBER: _builtins.int
    clear_cache: _builtins.bool
    """DEPRECATED. Asks the server to run the script with this object
    ReRun rerun = 4;

    Requests that the app's @st_cache 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:
        """DEPRECATED. Set to true to ask the server to close the connection
        bool close_connection = 10;
        """

    @_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 deferred_file_request(self) -> Global___DeferredFileRequest:
        """Requests that the server execute a deferred callable and return the URL"""

    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 = ...,
        deferred_file_request: Global___DeferredFileRequest | None = ...,
        debug_last_backmsg_id: _builtins.str = ...,
    ) -> None: ...
    _HasFieldArgType: _TypeAlias = _typing.Literal["app_heartbeat", b"app_heartbeat", "clear_cache", b"clear_cache", "debug_disconnect_websocket", b"debug_disconnect_websocket", "debug_shutdown_runtime", b"debug_shutdown_runtime", "deferred_file_request", b"deferred_file_request", "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", "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", "deferred_file_request", b"deferred_file_request", "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", "deferred_file_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 DeferredFileRequest(_message.Message):
    DESCRIPTOR: _descriptor.Descriptor

    FILE_ID_FIELD_NUMBER: _builtins.int
    SESSION_ID_FIELD_NUMBER: _builtins.int
    file_id: _builtins.str
    session_id: _builtins.str
    def __init__(
        self,
        *,
        file_id: _builtins.str = ...,
        session_id: _builtins.str = ...,
    ) -> None: ...
    _ClearFieldArgType: _TypeAlias = _typing.Literal["file_id", b"file_id", "session_id", b"session_id"]  # noqa: Y015
    def ClearField(self, field_name: _ClearFieldArgType) -> None: ...

Global___DeferredFileRequest: _TypeAlias = DeferredFileRequest  # noqa: Y015
