"""
@generated by mypy-protobuf.  Do not edit manually!
isort:skip_file
"""

import abc
import collections.abc
import sys
import typing

import grpc
import grpc.aio

from proto import messages_pb2

if sys.version_info >= (3, 13):
    import typing as typing_extensions
else:
    import typing_extensions

_T = typing.TypeVar("_T")

class _MaybeAsyncIterator(
    collections.abc.AsyncIterator[_T], collections.abc.Iterator[_T], metaclass=abc.ABCMeta
): ...
class _ServicerContext(grpc.ServicerContext, grpc.aio.ServicerContext):  # type: ignore[misc, type-arg]
    ...

GRPC_GENERATED_VERSION: str
GRPC_VERSION: str
_WorkflowServiceRegisterWorkflowType = typing_extensions.TypeVar(
    "_WorkflowServiceRegisterWorkflowType",
    grpc.UnaryUnaryMultiCallable[
        messages_pb2.RegisterWorkflowRequest,
        messages_pb2.RegisterWorkflowResponse,
    ],
    grpc.aio.UnaryUnaryMultiCallable[
        messages_pb2.RegisterWorkflowRequest,
        messages_pb2.RegisterWorkflowResponse,
    ],
    default=grpc.UnaryUnaryMultiCallable[
        messages_pb2.RegisterWorkflowRequest,
        messages_pb2.RegisterWorkflowResponse,
    ],
)

_WorkflowServiceWaitForInstanceType = typing_extensions.TypeVar(
    "_WorkflowServiceWaitForInstanceType",
    grpc.UnaryUnaryMultiCallable[
        messages_pb2.WaitForInstanceRequest,
        messages_pb2.WaitForInstanceResponse,
    ],
    grpc.aio.UnaryUnaryMultiCallable[
        messages_pb2.WaitForInstanceRequest,
        messages_pb2.WaitForInstanceResponse,
    ],
    default=grpc.UnaryUnaryMultiCallable[
        messages_pb2.WaitForInstanceRequest,
        messages_pb2.WaitForInstanceResponse,
    ],
)

class WorkflowServiceStub(
    typing.Generic[_WorkflowServiceRegisterWorkflowType, _WorkflowServiceWaitForInstanceType]
):
    @typing.overload
    def __init__(
        self: WorkflowServiceStub[
            grpc.UnaryUnaryMultiCallable[
                messages_pb2.RegisterWorkflowRequest,
                messages_pb2.RegisterWorkflowResponse,
            ],
            grpc.UnaryUnaryMultiCallable[
                messages_pb2.WaitForInstanceRequest,
                messages_pb2.WaitForInstanceResponse,
            ],
        ],
        channel: grpc.Channel,
    ) -> None: ...
    @typing.overload
    def __init__(
        self: WorkflowServiceStub[
            grpc.aio.UnaryUnaryMultiCallable[
                messages_pb2.RegisterWorkflowRequest,
                messages_pb2.RegisterWorkflowResponse,
            ],
            grpc.aio.UnaryUnaryMultiCallable[
                messages_pb2.WaitForInstanceRequest,
                messages_pb2.WaitForInstanceResponse,
            ],
        ],
        channel: grpc.aio.Channel,
    ) -> None: ...

    RegisterWorkflow: _WorkflowServiceRegisterWorkflowType

    WaitForInstance: _WorkflowServiceWaitForInstanceType

WorkflowServiceAsyncStub: typing_extensions.TypeAlias = WorkflowServiceStub[
    grpc.aio.UnaryUnaryMultiCallable[
        messages_pb2.RegisterWorkflowRequest,
        messages_pb2.RegisterWorkflowResponse,
    ],
    grpc.aio.UnaryUnaryMultiCallable[
        messages_pb2.WaitForInstanceRequest,
        messages_pb2.WaitForInstanceResponse,
    ],
]

class WorkflowServiceServicer(metaclass=abc.ABCMeta):
    @abc.abstractmethod
    def RegisterWorkflow(
        self,
        request: messages_pb2.RegisterWorkflowRequest,
        context: _ServicerContext,
    ) -> typing.Union[
        messages_pb2.RegisterWorkflowResponse,
        collections.abc.Awaitable[messages_pb2.RegisterWorkflowResponse],
    ]: ...
    @abc.abstractmethod
    def WaitForInstance(
        self,
        request: messages_pb2.WaitForInstanceRequest,
        context: _ServicerContext,
    ) -> typing.Union[
        messages_pb2.WaitForInstanceResponse,
        collections.abc.Awaitable[messages_pb2.WaitForInstanceResponse],
    ]: ...

def add_WorkflowServiceServicer_to_server(
    servicer: WorkflowServiceServicer, server: typing.Union[grpc.Server, grpc.aio.Server]
) -> None: ...

_WorkerBridgeAttachType = typing_extensions.TypeVar(
    "_WorkerBridgeAttachType",
    grpc.StreamStreamMultiCallable[
        messages_pb2.Envelope,
        messages_pb2.Envelope,
    ],
    grpc.aio.StreamStreamMultiCallable[
        messages_pb2.Envelope,
        messages_pb2.Envelope,
    ],
    default=grpc.StreamStreamMultiCallable[
        messages_pb2.Envelope,
        messages_pb2.Envelope,
    ],
)

class WorkerBridgeStub(typing.Generic[_WorkerBridgeAttachType]):
    @typing.overload
    def __init__(
        self: WorkerBridgeStub[
            grpc.StreamStreamMultiCallable[
                messages_pb2.Envelope,
                messages_pb2.Envelope,
            ],
        ],
        channel: grpc.Channel,
    ) -> None: ...
    @typing.overload
    def __init__(
        self: WorkerBridgeStub[
            grpc.aio.StreamStreamMultiCallable[
                messages_pb2.Envelope,
                messages_pb2.Envelope,
            ],
        ],
        channel: grpc.aio.Channel,
    ) -> None: ...

    Attach: _WorkerBridgeAttachType

WorkerBridgeAsyncStub: typing_extensions.TypeAlias = WorkerBridgeStub[
    grpc.aio.StreamStreamMultiCallable[
        messages_pb2.Envelope,
        messages_pb2.Envelope,
    ],
]

class WorkerBridgeServicer(metaclass=abc.ABCMeta):
    @abc.abstractmethod
    def Attach(
        self,
        request_iterator: _MaybeAsyncIterator[messages_pb2.Envelope],
        context: _ServicerContext,
    ) -> typing.Union[
        collections.abc.Iterator[messages_pb2.Envelope],
        collections.abc.AsyncIterator[messages_pb2.Envelope],
    ]: ...

def add_WorkerBridgeServicer_to_server(
    servicer: WorkerBridgeServicer, server: typing.Union[grpc.Server, grpc.aio.Server]
) -> None: ...
