"""
@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 collections import abc as _abc
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf.internal import containers as _containers
from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper
from streamlit.proto import AuthRedirect_pb2 as _AuthRedirect_pb2
from streamlit.proto import AutoRerun_pb2 as _AutoRerun_pb2
from streamlit.proto import Common_pb2 as _Common_pb2
from streamlit.proto import Delta_pb2 as _Delta_pb2
from streamlit.proto import GitInfo_pb2 as _GitInfo_pb2
from streamlit.proto import Logo_pb2 as _Logo_pb2
from streamlit.proto import Navigation_pb2 as _Navigation_pb2
from streamlit.proto import NewSession_pb2 as _NewSession_pb2
from streamlit.proto import PageConfig_pb2 as _PageConfig_pb2
from streamlit.proto import PageInfo_pb2 as _PageInfo_pb2
from streamlit.proto import PageNotFound_pb2 as _PageNotFound_pb2
from streamlit.proto import PageProfile_pb2 as _PageProfile_pb2
from streamlit.proto import ParentMessage_pb2 as _ParentMessage_pb2
from streamlit.proto import SessionEvent_pb2 as _SessionEvent_pb2
from streamlit.proto import SessionStatus_pb2 as _SessionStatus_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 ForwardMsg(_message.Message):
    """A message sent from Proxy to the browser"""

    DESCRIPTOR: _descriptor.Descriptor

    class _ScriptFinishedStatus:
        ValueType = _typing.NewType("ValueType", _builtins.int)
        V: _TypeAlias = ValueType  # noqa: Y015

    class _ScriptFinishedStatusEnumTypeWrapper(_enum_type_wrapper._EnumTypeWrapper[ForwardMsg._ScriptFinishedStatus.ValueType], _builtins.type):
        DESCRIPTOR: _descriptor.EnumDescriptor
        FINISHED_SUCCESSFULLY: ForwardMsg._ScriptFinishedStatus.ValueType  # 0
        """The script compiled and ran."""
        FINISHED_WITH_COMPILE_ERROR: ForwardMsg._ScriptFinishedStatus.ValueType  # 1
        """The script failed to compile"""
        FINISHED_EARLY_FOR_RERUN: ForwardMsg._ScriptFinishedStatus.ValueType  # 2
        """Script was interrupted by rerun"""
        FINISHED_FRAGMENT_RUN_SUCCESSFULLY: ForwardMsg._ScriptFinishedStatus.ValueType  # 3
        """A fragment of the script ran successfully."""

    class ScriptFinishedStatus(_ScriptFinishedStatus, metaclass=_ScriptFinishedStatusEnumTypeWrapper):
        """Values for the 'script_finished` type"""

    FINISHED_SUCCESSFULLY: ForwardMsg.ScriptFinishedStatus.ValueType  # 0
    """The script compiled and ran."""
    FINISHED_WITH_COMPILE_ERROR: ForwardMsg.ScriptFinishedStatus.ValueType  # 1
    """The script failed to compile"""
    FINISHED_EARLY_FOR_RERUN: ForwardMsg.ScriptFinishedStatus.ValueType  # 2
    """Script was interrupted by rerun"""
    FINISHED_FRAGMENT_RUN_SUCCESSFULLY: ForwardMsg.ScriptFinishedStatus.ValueType  # 3
    """A fragment of the script ran successfully."""

    HASH_FIELD_NUMBER: _builtins.int
    METADATA_FIELD_NUMBER: _builtins.int
    NEW_SESSION_FIELD_NUMBER: _builtins.int
    DELTA_FIELD_NUMBER: _builtins.int
    PAGE_INFO_CHANGED_FIELD_NUMBER: _builtins.int
    PAGE_CONFIG_CHANGED_FIELD_NUMBER: _builtins.int
    SCRIPT_FINISHED_FIELD_NUMBER: _builtins.int
    GIT_INFO_CHANGED_FIELD_NUMBER: _builtins.int
    PAGE_PROFILE_FIELD_NUMBER: _builtins.int
    SESSION_STATUS_CHANGED_FIELD_NUMBER: _builtins.int
    SESSION_EVENT_FIELD_NUMBER: _builtins.int
    NAVIGATION_FIELD_NUMBER: _builtins.int
    PAGE_NOT_FOUND_FIELD_NUMBER: _builtins.int
    FILE_URLS_RESPONSE_FIELD_NUMBER: _builtins.int
    AUTO_RERUN_FIELD_NUMBER: _builtins.int
    LOGO_FIELD_NUMBER: _builtins.int
    AUTH_REDIRECT_FIELD_NUMBER: _builtins.int
    PARENT_MESSAGE_FIELD_NUMBER: _builtins.int
    REF_HASH_FIELD_NUMBER: _builtins.int
    DEFERRED_FILE_RESPONSE_FIELD_NUMBER: _builtins.int
    HEARTBEAT_ACK_FIELD_NUMBER: _builtins.int
    DEBUG_LAST_BACKMSG_ID_FIELD_NUMBER: _builtins.int
    hash: _builtins.str
    """A hash that uniquely identifies this ForwardMsg, for caching."""
    script_finished: Global___ForwardMsg.ScriptFinishedStatus.ValueType
    ref_hash: _builtins.str
    """A reference to a ForwardMsg that has already been delivered
    and cached in the frontend. The client should substitute the message
    with the given hash for this one.
    """
    heartbeat_ack: _builtins.bool
    """Acknowledgment of app_heartbeat BackMsg, used for connection health
    monitoring. When the frontend sends an app_heartbeat, the server
    responds with this ack so the frontend can verify the connection is
    healthy.
    """
    debug_last_backmsg_id: _builtins.str
    """The ID of the last BackMsg that we received before sending this
    ForwardMsg. As its name suggests, this field should only be used for
    testing.
    """
    @_builtins.property
    def metadata(self) -> Global___ForwardMsgMetadata:
        """Contains 'non-payload' ForwardMsg data that isn't cached for the purposes
        of ForwardMsg de-duping.
        """

    @_builtins.property
    def new_session(self) -> _NewSession_pb2.NewSession:
        """App lifecycle messages."""

    @_builtins.property
    def delta(self) -> _Delta_pb2.Delta: ...
    @_builtins.property
    def page_info_changed(self) -> _PageInfo_pb2.PageInfo: ...
    @_builtins.property
    def page_config_changed(self) -> _PageConfig_pb2.PageConfig: ...
    @_builtins.property
    def git_info_changed(self) -> _GitInfo_pb2.GitInfo: ...
    @_builtins.property
    def page_profile(self) -> _PageProfile_pb2.PageProfile: ...
    @_builtins.property
    def session_status_changed(self) -> _SessionStatus_pb2.SessionStatus:
        """Status change and event messages."""

    @_builtins.property
    def session_event(self) -> _SessionEvent_pb2.SessionEvent: ...
    @_builtins.property
    def navigation(self) -> _Navigation_pb2.Navigation:
        """Other messages."""

    @_builtins.property
    def page_not_found(self) -> _PageNotFound_pb2.PageNotFound: ...
    @_builtins.property
    def file_urls_response(self) -> _Common_pb2.FileURLsResponse: ...
    @_builtins.property
    def auto_rerun(self) -> _AutoRerun_pb2.AutoRerun: ...
    @_builtins.property
    def logo(self) -> _Logo_pb2.Logo:
        """App logo message"""

    @_builtins.property
    def auth_redirect(self) -> _AuthRedirect_pb2.AuthRedirect:
        """Auth redirect message"""

    @_builtins.property
    def parent_message(self) -> _ParentMessage_pb2.ParentMessage:
        """Platform - message to host"""

    @_builtins.property
    def deferred_file_response(self) -> Global___DeferredFileResponse:
        """Response for a deferred file request"""

    def __init__(
        self,
        *,
        hash: _builtins.str = ...,
        metadata: Global___ForwardMsgMetadata | None = ...,
        new_session: _NewSession_pb2.NewSession | None = ...,
        delta: _Delta_pb2.Delta | None = ...,
        page_info_changed: _PageInfo_pb2.PageInfo | None = ...,
        page_config_changed: _PageConfig_pb2.PageConfig | None = ...,
        script_finished: Global___ForwardMsg.ScriptFinishedStatus.ValueType = ...,
        git_info_changed: _GitInfo_pb2.GitInfo | None = ...,
        page_profile: _PageProfile_pb2.PageProfile | None = ...,
        session_status_changed: _SessionStatus_pb2.SessionStatus | None = ...,
        session_event: _SessionEvent_pb2.SessionEvent | None = ...,
        navigation: _Navigation_pb2.Navigation | None = ...,
        page_not_found: _PageNotFound_pb2.PageNotFound | None = ...,
        file_urls_response: _Common_pb2.FileURLsResponse | None = ...,
        auto_rerun: _AutoRerun_pb2.AutoRerun | None = ...,
        logo: _Logo_pb2.Logo | None = ...,
        auth_redirect: _AuthRedirect_pb2.AuthRedirect | None = ...,
        parent_message: _ParentMessage_pb2.ParentMessage | None = ...,
        ref_hash: _builtins.str = ...,
        deferred_file_response: Global___DeferredFileResponse | None = ...,
        heartbeat_ack: _builtins.bool = ...,
        debug_last_backmsg_id: _builtins.str = ...,
    ) -> None: ...
    _HasFieldArgType: _TypeAlias = _typing.Literal["auth_redirect", b"auth_redirect", "auto_rerun", b"auto_rerun", "deferred_file_response", b"deferred_file_response", "delta", b"delta", "file_urls_response", b"file_urls_response", "git_info_changed", b"git_info_changed", "heartbeat_ack", b"heartbeat_ack", "logo", b"logo", "metadata", b"metadata", "navigation", b"navigation", "new_session", b"new_session", "page_config_changed", b"page_config_changed", "page_info_changed", b"page_info_changed", "page_not_found", b"page_not_found", "page_profile", b"page_profile", "parent_message", b"parent_message", "ref_hash", b"ref_hash", "script_finished", b"script_finished", "session_event", b"session_event", "session_status_changed", b"session_status_changed", "type", b"type"]  # noqa: Y015
    def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
    _ClearFieldArgType: _TypeAlias = _typing.Literal["auth_redirect", b"auth_redirect", "auto_rerun", b"auto_rerun", "debug_last_backmsg_id", b"debug_last_backmsg_id", "deferred_file_response", b"deferred_file_response", "delta", b"delta", "file_urls_response", b"file_urls_response", "git_info_changed", b"git_info_changed", "hash", b"hash", "heartbeat_ack", b"heartbeat_ack", "logo", b"logo", "metadata", b"metadata", "navigation", b"navigation", "new_session", b"new_session", "page_config_changed", b"page_config_changed", "page_info_changed", b"page_info_changed", "page_not_found", b"page_not_found", "page_profile", b"page_profile", "parent_message", b"parent_message", "ref_hash", b"ref_hash", "script_finished", b"script_finished", "session_event", b"session_event", "session_status_changed", b"session_status_changed", "type", b"type"]  # noqa: Y015
    def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
    _WhichOneofReturnType_type: _TypeAlias = _typing.Literal["new_session", "delta", "page_info_changed", "page_config_changed", "script_finished", "git_info_changed", "page_profile", "session_status_changed", "session_event", "navigation", "page_not_found", "file_urls_response", "auto_rerun", "logo", "auth_redirect", "parent_message", "ref_hash", "deferred_file_response", "heartbeat_ack"]  # noqa: Y015
    _WhichOneofArgType_type: _TypeAlias = _typing.Literal["type", b"type"]  # noqa: Y015
    def WhichOneof(self, oneof_group: _WhichOneofArgType_type) -> _WhichOneofReturnType_type | None: ...

Global___ForwardMsg: _TypeAlias = ForwardMsg  # noqa: Y015

@_typing.final
class DeferredFileResponse(_message.Message):
    DESCRIPTOR: _descriptor.Descriptor

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

Global___DeferredFileResponse: _TypeAlias = DeferredFileResponse  # noqa: Y015

@_typing.final
class ForwardMsgMetadata(_message.Message):
    """ForwardMsgMetadata contains all data that does _not_ get hashed (or cached)
    in our ForwardMsgCache. (That is, when we cache a ForwardMsg, we clear its
    metadata field first.) This allows us to, e.g., have a large unchanging
    dataframe appear in different places across multiple reruns - or even appear
    multiple times in a single run - and only send its dataframe bytes once.
    """

    DESCRIPTOR: _descriptor.Descriptor

    CACHEABLE_FIELD_NUMBER: _builtins.int
    DELTA_PATH_FIELD_NUMBER: _builtins.int
    ACTIVE_SCRIPT_HASH_FIELD_NUMBER: _builtins.int
    cacheable: _builtins.bool
    """Marks a message as cacheable for the frontend."""
    active_script_hash: _builtins.str
    """active_script_hash the forward message is associated from.
    For multipage apps v1, this will always be the page file running
    For multipage apps v2, this can be the main script or the page script
    """
    @_builtins.property
    def delta_path(self) -> _containers.RepeatedScalarFieldContainer[_builtins.int]:
        """The path that identifies a delta's location in the report tree.
        Only set for Delta messages.
        """

    def __init__(
        self,
        *,
        cacheable: _builtins.bool = ...,
        delta_path: _abc.Iterable[_builtins.int] | None = ...,
        active_script_hash: _builtins.str = ...,
    ) -> None: ...
    _ClearFieldArgType: _TypeAlias = _typing.Literal["active_script_hash", b"active_script_hash", "cacheable", b"cacheable", "delta_path", b"delta_path"]  # noqa: Y015
    def ClearField(self, field_name: _ClearFieldArgType) -> None: ...

Global___ForwardMsgMetadata: _TypeAlias = ForwardMsgMetadata  # noqa: Y015

@_typing.final
class ForwardMsgList(_message.Message):
    """This is a list of ForwardMessages used to have a single protobuf message
    that encapsulates multiple ForwardMessages. This is used in static streamlit app
    generation in replaying all of the protobuf messages of a streamlit app. The
    ForwardMsgList allows us to leverage the built-ins of protobuf in delimiting the ForwardMsgs
    instead of needing to do that ourselves.
    """

    DESCRIPTOR: _descriptor.Descriptor

    MESSAGES_FIELD_NUMBER: _builtins.int
    @_builtins.property
    def messages(self) -> _containers.RepeatedCompositeFieldContainer[Global___ForwardMsg]: ...
    def __init__(
        self,
        *,
        messages: _abc.Iterable[Global___ForwardMsg] | None = ...,
    ) -> None: ...
    _ClearFieldArgType: _TypeAlias = _typing.Literal["messages", b"messages"]  # noqa: Y015
    def ClearField(self, field_name: _ClearFieldArgType) -> None: ...

Global___ForwardMsgList: _TypeAlias = ForwardMsgList  # noqa: Y015
