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

from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
import domain.trout.model.trdaytimetable_pb2 as trdaytimetable__pb2
import domain.trout.model.trout_pb2 as trout__pb2
import domain.trout.model.trrealtime_pb2 as trrealtime__pb2
import domain.trout.model.tryeartimetable_pb2 as tryeartimetable__pb2


class TRTPublisherV1Stub(object):
    """Service for broadcasting timetable and realtime data to clients.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.GetDayTimetable = channel.unary_unary(
                '/nl.ovapi.routing.trout.TRTPublisherV1/GetDayTimetable',
                request_serializer=trout__pb2.TDayTimetableRequest.SerializeToString,
                response_deserializer=trdaytimetable__pb2.TDayTimetable.FromString,
                _registered_method=True)
        self.GetYearTimetable = channel.unary_unary(
                '/nl.ovapi.routing.trout.TRTPublisherV1/GetYearTimetable',
                request_serializer=trout__pb2.TYearTimetableRequest.SerializeToString,
                response_deserializer=tryeartimetable__pb2.TYearTimetable.FromString,
                _registered_method=True)
        self.AllRealtime = channel.unary_unary(
                '/nl.ovapi.routing.trout.TRTPublisherV1/AllRealtime',
                request_serializer=trout__pb2.TRRealtimeRequest.SerializeToString,
                response_deserializer=trrealtime__pb2.UpdateList.FromString,
                _registered_method=True)
        self.SubscribeUpdates = channel.unary_stream(
                '/nl.ovapi.routing.trout.TRTPublisherV1/SubscribeUpdates',
                request_serializer=trout__pb2.TRRealtimeSubscription.SerializeToString,
                response_deserializer=trrealtime__pb2.UpdateList.FromString,
                _registered_method=True)


class TRTPublisherV1Servicer(object):
    """Service for broadcasting timetable and realtime data to clients.
    """

    def GetDayTimetable(self, request, context):
        """Fetches a day timetable for a specific date.
        Requests a new timetable if the current one doesn't match the provided UUID
        or if it's older than the provided timestamp.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetYearTimetable(self, request, context):
        """Fetches the current year timetable.
        Requests a new timetable if the current one doesn't match the provided UUID
        or if it's older than the provided timestamp.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def AllRealtime(self, request, context):
        """Fetches all available realtime updates within a specified date range.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def SubscribeUpdates(self, request, context):
        """Subscribes a client to a stream of realtime updates.
        Updates are sent in batch intervals of 5 to 10 seconds.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_TRTPublisherV1Servicer_to_server(servicer, server):
    rpc_method_handlers = {
            'GetDayTimetable': grpc.unary_unary_rpc_method_handler(
                    servicer.GetDayTimetable,
                    request_deserializer=trout__pb2.TDayTimetableRequest.FromString,
                    response_serializer=trdaytimetable__pb2.TDayTimetable.SerializeToString,
            ),
            'GetYearTimetable': grpc.unary_unary_rpc_method_handler(
                    servicer.GetYearTimetable,
                    request_deserializer=trout__pb2.TYearTimetableRequest.FromString,
                    response_serializer=tryeartimetable__pb2.TYearTimetable.SerializeToString,
            ),
            'AllRealtime': grpc.unary_unary_rpc_method_handler(
                    servicer.AllRealtime,
                    request_deserializer=trout__pb2.TRRealtimeRequest.FromString,
                    response_serializer=trrealtime__pb2.UpdateList.SerializeToString,
            ),
            'SubscribeUpdates': grpc.unary_stream_rpc_method_handler(
                    servicer.SubscribeUpdates,
                    request_deserializer=trout__pb2.TRRealtimeSubscription.FromString,
                    response_serializer=trrealtime__pb2.UpdateList.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'nl.ovapi.routing.trout.TRTPublisherV1', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('nl.ovapi.routing.trout.TRTPublisherV1', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class TRTPublisherV1(object):
    """Service for broadcasting timetable and realtime data to clients.
    """

    @staticmethod
    def GetDayTimetable(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,
            '/nl.ovapi.routing.trout.TRTPublisherV1/GetDayTimetable',
            trout__pb2.TDayTimetableRequest.SerializeToString,
            trdaytimetable__pb2.TDayTimetable.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetYearTimetable(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,
            '/nl.ovapi.routing.trout.TRTPublisherV1/GetYearTimetable',
            trout__pb2.TYearTimetableRequest.SerializeToString,
            tryeartimetable__pb2.TYearTimetable.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def AllRealtime(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,
            '/nl.ovapi.routing.trout.TRTPublisherV1/AllRealtime',
            trout__pb2.TRRealtimeRequest.SerializeToString,
            trrealtime__pb2.UpdateList.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def SubscribeUpdates(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_stream(
            request,
            target,
            '/nl.ovapi.routing.trout.TRTPublisherV1/SubscribeUpdates',
            trout__pb2.TRRealtimeSubscription.SerializeToString,
            trrealtime__pb2.UpdateList.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)


class TRoutWorkerV1Stub(object):
    """Service for the Trout routing worker, handling routing requests and timetable management.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.SearchOptimalPaths = channel.unary_unary(
                '/nl.ovapi.routing.trout.TRoutWorkerV1/SearchOptimalPaths',
                request_serializer=trout__pb2.RouterRequest.SerializeToString,
                response_deserializer=trout__pb2.RouterResponse.FromString,
                _registered_method=True)
        self.StatusOfTimetables = channel.unary_unary(
                '/nl.ovapi.routing.trout.TRoutWorkerV1/StatusOfTimetables',
                request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
                response_deserializer=trout__pb2.TimetableStatusList.FromString,
                _registered_method=True)
        self.PutYearTimetable = channel.unary_unary(
                '/nl.ovapi.routing.trout.TRoutWorkerV1/PutYearTimetable',
                request_serializer=tryeartimetable__pb2.TYearTimetable.SerializeToString,
                response_deserializer=trout__pb2.TimetablePlacement.FromString,
                _registered_method=True)
        self.UpdateClient = channel.unary_unary(
                '/nl.ovapi.routing.trout.TRoutWorkerV1/UpdateClient',
                request_serializer=trrealtime__pb2.UpdateList.SerializeToString,
                response_deserializer=trout__pb2.TimetablePlacement.FromString,
                _registered_method=True)
        self.Stats = channel.unary_unary(
                '/nl.ovapi.routing.trout.TRoutWorkerV1/Stats',
                request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
                response_deserializer=trout__pb2.RouterStats.FromString,
                _registered_method=True)


class TRoutWorkerV1Servicer(object):
    """Service for the Trout routing worker, handling routing requests and timetable management.
    """

    def SearchOptimalPaths(self, request, context):
        """Finds optimal paths based on the criteria specified in RouterRequest.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def StatusOfTimetables(self, request, context):
        """Retrieves the status of all loaded timetables.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def PutYearTimetable(self, request, context):
        """Uploads and processes a new year timetable.
        Returns the status of the placement process.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def UpdateClient(self, request, context):
        """Processes a list of realtime updates received from a client or source.
        Returns the status of the update placement process (though often processed differently than full timetables).
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Stats(self, request, context):
        """Returns the request-response statistics of the Router
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_TRoutWorkerV1Servicer_to_server(servicer, server):
    rpc_method_handlers = {
            'SearchOptimalPaths': grpc.unary_unary_rpc_method_handler(
                    servicer.SearchOptimalPaths,
                    request_deserializer=trout__pb2.RouterRequest.FromString,
                    response_serializer=trout__pb2.RouterResponse.SerializeToString,
            ),
            'StatusOfTimetables': grpc.unary_unary_rpc_method_handler(
                    servicer.StatusOfTimetables,
                    request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                    response_serializer=trout__pb2.TimetableStatusList.SerializeToString,
            ),
            'PutYearTimetable': grpc.unary_unary_rpc_method_handler(
                    servicer.PutYearTimetable,
                    request_deserializer=tryeartimetable__pb2.TYearTimetable.FromString,
                    response_serializer=trout__pb2.TimetablePlacement.SerializeToString,
            ),
            'UpdateClient': grpc.unary_unary_rpc_method_handler(
                    servicer.UpdateClient,
                    request_deserializer=trrealtime__pb2.UpdateList.FromString,
                    response_serializer=trout__pb2.TimetablePlacement.SerializeToString,
            ),
            'Stats': grpc.unary_unary_rpc_method_handler(
                    servicer.Stats,
                    request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                    response_serializer=trout__pb2.RouterStats.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'nl.ovapi.routing.trout.TRoutWorkerV1', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('nl.ovapi.routing.trout.TRoutWorkerV1', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class TRoutWorkerV1(object):
    """Service for the Trout routing worker, handling routing requests and timetable management.
    """

    @staticmethod
    def SearchOptimalPaths(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,
            '/nl.ovapi.routing.trout.TRoutWorkerV1/SearchOptimalPaths',
            trout__pb2.RouterRequest.SerializeToString,
            trout__pb2.RouterResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def StatusOfTimetables(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,
            '/nl.ovapi.routing.trout.TRoutWorkerV1/StatusOfTimetables',
            google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            trout__pb2.TimetableStatusList.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def PutYearTimetable(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,
            '/nl.ovapi.routing.trout.TRoutWorkerV1/PutYearTimetable',
            tryeartimetable__pb2.TYearTimetable.SerializeToString,
            trout__pb2.TimetablePlacement.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def UpdateClient(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,
            '/nl.ovapi.routing.trout.TRoutWorkerV1/UpdateClient',
            trrealtime__pb2.UpdateList.SerializeToString,
            trout__pb2.TimetablePlacement.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Stats(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,
            '/nl.ovapi.routing.trout.TRoutWorkerV1/Stats',
            google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            trout__pb2.RouterStats.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
