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

from angzarr_client.proto.angzarr import upcaster_pb2 as angzarr_dot_upcaster__pb2


class UpcasterServiceStub(object):
    """UpcasterService: transforms old event versions to current versions
    Implemented by the client alongside AggregateService on the same gRPC server.
    Optionally can be deployed as a separate binary for testing or complex migrations.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.Upcast = channel.unary_unary(
                '/angzarr.UpcasterService/Upcast',
                request_serializer=angzarr_dot_upcaster__pb2.UpcastRequest.SerializeToString,
                response_deserializer=angzarr_dot_upcaster__pb2.UpcastResponse.FromString,
                _registered_method=True)


class UpcasterServiceServicer(object):
    """UpcasterService: transforms old event versions to current versions
    Implemented by the client alongside AggregateService on the same gRPC server.
    Optionally can be deployed as a separate binary for testing or complex migrations.
    """

    def Upcast(self, request, context):
        """Transform events to current version
        Returns events in same order, transformed where applicable
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_UpcasterServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'Upcast': grpc.unary_unary_rpc_method_handler(
                    servicer.Upcast,
                    request_deserializer=angzarr_dot_upcaster__pb2.UpcastRequest.FromString,
                    response_serializer=angzarr_dot_upcaster__pb2.UpcastResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'angzarr.UpcasterService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('angzarr.UpcasterService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class UpcasterService(object):
    """UpcasterService: transforms old event versions to current versions
    Implemented by the client alongside AggregateService on the same gRPC server.
    Optionally can be deployed as a separate binary for testing or complex migrations.
    """

    @staticmethod
    def Upcast(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,
            '/angzarr.UpcasterService/Upcast',
            angzarr_dot_upcaster__pb2.UpcastRequest.SerializeToString,
            angzarr_dot_upcaster__pb2.UpcastResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
