# Generated by the protocol buffer compiler.  DO NOT EDIT!
# sources: bot.proto
# plugin: python-betterproto
# This file has been @generated

from dataclasses import dataclass
from typing import (
    TYPE_CHECKING,
    Dict,
    List,
    Optional,
)

import betterproto
import grpc
from betterproto.grpcstub.grpcio_client import SyncServiceStub
from betterproto.grpcstub.grpclib_server import ServiceBase


if TYPE_CHECKING:
    import grpclib.server
    from betterproto.grpcstub.grpclib_client import MetadataLike
    from grpclib.metadata import Deadline


@dataclass(eq=False, repr=False)
class PopBotTaskRequest(betterproto.Message):
    stub_id: str = betterproto.string_field(1)
    session_id: str = betterproto.string_field(2)
    transition_name: str = betterproto.string_field(3)
    task_id: str = betterproto.string_field(4)


@dataclass(eq=False, repr=False)
class PopBotTaskResponse(betterproto.Message):
    ok: bool = betterproto.bool_field(1)
    markers: Dict[str, "PopBotTaskResponseMarkerList"] = betterproto.map_field(
        2, betterproto.TYPE_STRING, betterproto.TYPE_MESSAGE
    )


@dataclass(eq=False, repr=False)
class PopBotTaskResponseMarkerList(betterproto.Message):
    markers: List["Marker"] = betterproto.message_field(1)


@dataclass(eq=False, repr=False)
class MarkerField(betterproto.Message):
    field_name: str = betterproto.string_field(1)
    field_value: str = betterproto.string_field(2)


@dataclass(eq=False, repr=False)
class Marker(betterproto.Message):
    location_name: str = betterproto.string_field(1)
    fields: List["MarkerField"] = betterproto.message_field(2)
    source_task_id: str = betterproto.string_field(3)


@dataclass(eq=False, repr=False)
class PushBotMarkersRequest(betterproto.Message):
    stub_id: str = betterproto.string_field(1)
    session_id: str = betterproto.string_field(2)
    markers: Dict[str, "PushBotMarkersRequestMarkerList"] = betterproto.map_field(
        3, betterproto.TYPE_STRING, betterproto.TYPE_MESSAGE
    )
    source_task_id: str = betterproto.string_field(5)


@dataclass(eq=False, repr=False)
class PushBotMarkersRequestMarkerList(betterproto.Message):
    markers: List["Marker"] = betterproto.message_field(4)


@dataclass(eq=False, repr=False)
class PushBotMarkersResponse(betterproto.Message):
    ok: bool = betterproto.bool_field(1)


@dataclass(eq=False, repr=False)
class PushBotEventRequest(betterproto.Message):
    stub_id: str = betterproto.string_field(1)
    session_id: str = betterproto.string_field(2)
    event_type: str = betterproto.string_field(3)
    event_value: str = betterproto.string_field(4)
    metadata: Dict[str, str] = betterproto.map_field(
        5, betterproto.TYPE_STRING, betterproto.TYPE_STRING
    )


@dataclass(eq=False, repr=False)
class PushBotEventResponse(betterproto.Message):
    ok: bool = betterproto.bool_field(1)
    event_id: str = betterproto.string_field(2)


@dataclass(eq=False, repr=False)
class PushBotEventBlockingRequest(betterproto.Message):
    stub_id: str = betterproto.string_field(1)
    session_id: str = betterproto.string_field(2)
    event_type: str = betterproto.string_field(3)
    event_value: str = betterproto.string_field(4)
    metadata: Dict[str, str] = betterproto.map_field(
        5, betterproto.TYPE_STRING, betterproto.TYPE_STRING
    )
    timeout_seconds: int = betterproto.int32_field(6)


@dataclass(eq=False, repr=False)
class PushBotEventBlockingResponse(betterproto.Message):
    ok: bool = betterproto.bool_field(1)
    event: "BotEvent" = betterproto.message_field(2)


@dataclass(eq=False, repr=False)
class BotEvent(betterproto.Message):
    type: str = betterproto.string_field(1)
    value: str = betterproto.string_field(2)
    metadata: Dict[str, str] = betterproto.map_field(
        3, betterproto.TYPE_STRING, betterproto.TYPE_STRING
    )


class BotServiceStub(SyncServiceStub):
    def pop_bot_task(
        self, pop_bot_task_request: "PopBotTaskRequest"
    ) -> "PopBotTaskResponse":
        return self._unary_unary(
            "/bot.BotService/PopBotTask",
            PopBotTaskRequest,
            PopBotTaskResponse,
        )(pop_bot_task_request)

    def push_bot_markers(
        self, push_bot_markers_request: "PushBotMarkersRequest"
    ) -> "PushBotMarkersResponse":
        return self._unary_unary(
            "/bot.BotService/PushBotMarkers",
            PushBotMarkersRequest,
            PushBotMarkersResponse,
        )(push_bot_markers_request)

    def push_bot_event(
        self, push_bot_event_request: "PushBotEventRequest"
    ) -> "PushBotEventResponse":
        return self._unary_unary(
            "/bot.BotService/PushBotEvent",
            PushBotEventRequest,
            PushBotEventResponse,
        )(push_bot_event_request)

    def push_bot_event_blocking(
        self, push_bot_event_blocking_request: "PushBotEventBlockingRequest"
    ) -> "PushBotEventBlockingResponse":
        return self._unary_unary(
            "/bot.BotService/PushBotEventBlocking",
            PushBotEventBlockingRequest,
            PushBotEventBlockingResponse,
        )(push_bot_event_blocking_request)
