# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
import warnings

from . import shard_runtime_pb2 as shard__runtime__pb2

GRPC_GENERATED_VERSION = '1.82.1'
GRPC_VERSION = grpc.__version__
_version_not_supported = False

try:
    from grpc._utilities import first_version_is_lower
    _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
except ImportError:
    _version_not_supported = True

if _version_not_supported:
    raise RuntimeError(
        f'The grpc package installed is at version {GRPC_VERSION},'
        + ' but the generated code in shard_runtime_pb2_grpc.py depends on'
        + f' grpcio>={GRPC_GENERATED_VERSION}.'
        + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
        + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
    )


class ShardRuntimeStub:
    """---------------------------------------------------------------------------
    Service
    ---------------------------------------------------------------------------

    """

    def __init__(self, channel):
        """Constructor.

        Args:
            channel: A grpc.Channel.
        """
        self.GetCapability = channel.unary_unary(
                '/meshnet.shard.v1.ShardRuntime/GetCapability',
                request_serializer=shard__runtime__pb2.CapabilityRequest.SerializeToString,
                response_deserializer=shard__runtime__pb2.CapabilityReport.FromString,
                _registered_method=True)
        self.Health = channel.unary_unary(
                '/meshnet.shard.v1.ShardRuntime/Health',
                request_serializer=shard__runtime__pb2.HealthRequest.SerializeToString,
                response_deserializer=shard__runtime__pb2.HealthReport.FromString,
                _registered_method=True)
        self.Session = channel.stream_stream(
                '/meshnet.shard.v1.ShardRuntime/Session',
                request_serializer=shard__runtime__pb2.SessionRequest.SerializeToString,
                response_deserializer=shard__runtime__pb2.SessionResponse.FromString,
                _registered_method=True)
        self.Release = channel.unary_unary(
                '/meshnet.shard.v1.ShardRuntime/Release',
                request_serializer=shard__runtime__pb2.ReleaseRequest.SerializeToString,
                response_deserializer=shard__runtime__pb2.ReleaseResponse.FromString,
                _registered_method=True)
        self.Cancel = channel.unary_unary(
                '/meshnet.shard.v1.ShardRuntime/Cancel',
                request_serializer=shard__runtime__pb2.CancelRequest.SerializeToString,
                response_deserializer=shard__runtime__pb2.CancelResponse.FromString,
                _registered_method=True)


class ShardRuntimeServicer:
    """---------------------------------------------------------------------------
    Service
    ---------------------------------------------------------------------------

    """

    def GetCapability(self, request, context):
        """What this worker can execute. Read before a route is built.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Health(self, request, context):
        """Live load and serving state.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Session(self, request_iterator, context):
        """One long-lived bidirectional stream per Route Session Activation Seam.

        The stream opens with SessionOpen/SessionAccepted, then carries bounded
        prefill chunks and decode steps in both directions for the life of the
        session. Per-token channel creation is a non-goal: the handshake cost is
        paid once and the hot path carries only what changes.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Release(self, request, context):
        """Drop session state out of band. Idempotent.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Cancel(self, request, context):
        """Cancel out of band, on a fresh call.

        In-band CancelSignal is preferred, but a sender that is blocked on flow
        control cannot write one — a cancel that can only travel down a wedged
        stream is not a cancel. This RPC always has a path to the worker.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_ShardRuntimeServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'GetCapability': grpc.unary_unary_rpc_method_handler(
                    servicer.GetCapability,
                    request_deserializer=shard__runtime__pb2.CapabilityRequest.FromString,
                    response_serializer=shard__runtime__pb2.CapabilityReport.SerializeToString,
            ),
            'Health': grpc.unary_unary_rpc_method_handler(
                    servicer.Health,
                    request_deserializer=shard__runtime__pb2.HealthRequest.FromString,
                    response_serializer=shard__runtime__pb2.HealthReport.SerializeToString,
            ),
            'Session': grpc.stream_stream_rpc_method_handler(
                    servicer.Session,
                    request_deserializer=shard__runtime__pb2.SessionRequest.FromString,
                    response_serializer=shard__runtime__pb2.SessionResponse.SerializeToString,
            ),
            'Release': grpc.unary_unary_rpc_method_handler(
                    servicer.Release,
                    request_deserializer=shard__runtime__pb2.ReleaseRequest.FromString,
                    response_serializer=shard__runtime__pb2.ReleaseResponse.SerializeToString,
            ),
            'Cancel': grpc.unary_unary_rpc_method_handler(
                    servicer.Cancel,
                    request_deserializer=shard__runtime__pb2.CancelRequest.FromString,
                    response_serializer=shard__runtime__pb2.CancelResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'meshnet.shard.v1.ShardRuntime', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('meshnet.shard.v1.ShardRuntime', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class ShardRuntime:
    """---------------------------------------------------------------------------
    Service
    ---------------------------------------------------------------------------

    """

    @staticmethod
    def GetCapability(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/meshnet.shard.v1.ShardRuntime/GetCapability',
            shard__runtime__pb2.CapabilityRequest.SerializeToString,
            shard__runtime__pb2.CapabilityReport.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Health(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/meshnet.shard.v1.ShardRuntime/Health',
            shard__runtime__pb2.HealthRequest.SerializeToString,
            shard__runtime__pb2.HealthReport.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Session(request_iterator,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.stream_stream(
            request_iterator,
            target,
            '/meshnet.shard.v1.ShardRuntime/Session',
            shard__runtime__pb2.SessionRequest.SerializeToString,
            shard__runtime__pb2.SessionResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Release(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/meshnet.shard.v1.ShardRuntime/Release',
            shard__runtime__pb2.ReleaseRequest.SerializeToString,
            shard__runtime__pb2.ReleaseResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Cancel(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/meshnet.shard.v1.ShardRuntime/Cancel',
            shard__runtime__pb2.CancelRequest.SerializeToString,
            shard__runtime__pb2.CancelResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
