# 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 cell_pb2 as cell__pb2
from . import conflict_zones_pb2 as conflict__zones__pb2
from . import session_pb2 as session__pb2
from . import step_pb2 as step__pb2
from . import tls_pb2 as tls__pb2
from . import trip_pb2 as trip__pb2
from . import uuid_pb2 as uuid__pb2

GRPC_GENERATED_VERSION = '1.76.0'
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 service_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 ServiceStub(object):
    """Missing associated documentation comment in .proto file."""

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

        Args:
            channel: A grpc.Channel.
        """
        self.NewSession = channel.unary_unary(
                '/micro_traffic_sim.Service/NewSession',
                request_serializer=session__pb2.SessionReq.SerializeToString,
                response_deserializer=session__pb2.NewSessionResponse.FromString,
                _registered_method=True)
        self.InfoSession = channel.unary_unary(
                '/micro_traffic_sim.Service/InfoSession',
                request_serializer=uuid__pb2.UUIDv4.SerializeToString,
                response_deserializer=session__pb2.InfoSessionResponse.FromString,
                _registered_method=True)
        self.PushSessionGrid = channel.stream_stream(
                '/micro_traffic_sim.Service/PushSessionGrid',
                request_serializer=cell__pb2.SessionGrid.SerializeToString,
                response_deserializer=cell__pb2.SessionGridResponse.FromString,
                _registered_method=True)
        self.PushSessionTrip = channel.stream_stream(
                '/micro_traffic_sim.Service/PushSessionTrip',
                request_serializer=trip__pb2.SessionTrip.SerializeToString,
                response_deserializer=trip__pb2.SessionTripResponse.FromString,
                _registered_method=True)
        self.SimulationStepSession = channel.stream_stream(
                '/micro_traffic_sim.Service/SimulationStepSession',
                request_serializer=step__pb2.SessionStep.SerializeToString,
                response_deserializer=step__pb2.SessionStepResponse.FromString,
                _registered_method=True)
        self.PushSessionTLS = channel.stream_stream(
                '/micro_traffic_sim.Service/PushSessionTLS',
                request_serializer=tls__pb2.SessionTLS.SerializeToString,
                response_deserializer=tls__pb2.SessionTLSResponse.FromString,
                _registered_method=True)
        self.PushSessionConflictZones = channel.stream_stream(
                '/micro_traffic_sim.Service/PushSessionConflictZones',
                request_serializer=conflict__zones__pb2.SessionConflictZones.SerializeToString,
                response_deserializer=conflict__zones__pb2.SessionConflictZonesResponse.FromString,
                _registered_method=True)


class ServiceServicer(object):
    """Missing associated documentation comment in .proto file."""

    def NewSession(self, request, context):
        """Create a new computation session
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def InfoSession(self, request, context):
        """Get session info
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def PushSessionGrid(self, request_iterator, context):
        """Set grid cell data for the given session (bidirectional streaming)
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def PushSessionTrip(self, request_iterator, context):
        """Set trip data for the given session (bidirectional streaming)
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def SimulationStepSession(self, request_iterator, context):
        """Run one simulation step for the given session (bidirectional streaming)
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def PushSessionTLS(self, request_iterator, context):
        """Set traffic light data for the given session (bidirectional streaming)
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def PushSessionConflictZones(self, request_iterator, context):
        """Set conflict zones for the given session (bidirectional streaming)
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_ServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'NewSession': grpc.unary_unary_rpc_method_handler(
                    servicer.NewSession,
                    request_deserializer=session__pb2.SessionReq.FromString,
                    response_serializer=session__pb2.NewSessionResponse.SerializeToString,
            ),
            'InfoSession': grpc.unary_unary_rpc_method_handler(
                    servicer.InfoSession,
                    request_deserializer=uuid__pb2.UUIDv4.FromString,
                    response_serializer=session__pb2.InfoSessionResponse.SerializeToString,
            ),
            'PushSessionGrid': grpc.stream_stream_rpc_method_handler(
                    servicer.PushSessionGrid,
                    request_deserializer=cell__pb2.SessionGrid.FromString,
                    response_serializer=cell__pb2.SessionGridResponse.SerializeToString,
            ),
            'PushSessionTrip': grpc.stream_stream_rpc_method_handler(
                    servicer.PushSessionTrip,
                    request_deserializer=trip__pb2.SessionTrip.FromString,
                    response_serializer=trip__pb2.SessionTripResponse.SerializeToString,
            ),
            'SimulationStepSession': grpc.stream_stream_rpc_method_handler(
                    servicer.SimulationStepSession,
                    request_deserializer=step__pb2.SessionStep.FromString,
                    response_serializer=step__pb2.SessionStepResponse.SerializeToString,
            ),
            'PushSessionTLS': grpc.stream_stream_rpc_method_handler(
                    servicer.PushSessionTLS,
                    request_deserializer=tls__pb2.SessionTLS.FromString,
                    response_serializer=tls__pb2.SessionTLSResponse.SerializeToString,
            ),
            'PushSessionConflictZones': grpc.stream_stream_rpc_method_handler(
                    servicer.PushSessionConflictZones,
                    request_deserializer=conflict__zones__pb2.SessionConflictZones.FromString,
                    response_serializer=conflict__zones__pb2.SessionConflictZonesResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'micro_traffic_sim.Service', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('micro_traffic_sim.Service', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class Service(object):
    """Missing associated documentation comment in .proto file."""

    @staticmethod
    def NewSession(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,
            '/micro_traffic_sim.Service/NewSession',
            session__pb2.SessionReq.SerializeToString,
            session__pb2.NewSessionResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def InfoSession(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,
            '/micro_traffic_sim.Service/InfoSession',
            uuid__pb2.UUIDv4.SerializeToString,
            session__pb2.InfoSessionResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def PushSessionGrid(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,
            '/micro_traffic_sim.Service/PushSessionGrid',
            cell__pb2.SessionGrid.SerializeToString,
            cell__pb2.SessionGridResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def PushSessionTrip(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,
            '/micro_traffic_sim.Service/PushSessionTrip',
            trip__pb2.SessionTrip.SerializeToString,
            trip__pb2.SessionTripResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def SimulationStepSession(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,
            '/micro_traffic_sim.Service/SimulationStepSession',
            step__pb2.SessionStep.SerializeToString,
            step__pb2.SessionStepResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def PushSessionTLS(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,
            '/micro_traffic_sim.Service/PushSessionTLS',
            tls__pb2.SessionTLS.SerializeToString,
            tls__pb2.SessionTLSResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def PushSessionConflictZones(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,
            '/micro_traffic_sim.Service/PushSessionConflictZones',
            conflict__zones__pb2.SessionConflictZones.SerializeToString,
            conflict__zones__pb2.SessionConflictZonesResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
