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

from cogment.api import common_pb2 as cogment_dot_api_dot_common__pb2
from cogment.api import model_registry_pb2 as cogment_dot_api_dot_model__registry__pb2


class ModelRegistrySPStub(object):
    """API for model registry, it stores versioned model data and their metadata
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.CreateOrUpdateModel = channel.unary_unary(
                '/cogmentAPI.ModelRegistrySP/CreateOrUpdateModel',
                request_serializer=cogment_dot_api_dot_model__registry__pb2.CreateOrUpdateModelRequest.SerializeToString,
                response_deserializer=cogment_dot_api_dot_model__registry__pb2.CreateOrUpdateModelReply.FromString,
                )
        self.DeleteModel = channel.unary_unary(
                '/cogmentAPI.ModelRegistrySP/DeleteModel',
                request_serializer=cogment_dot_api_dot_model__registry__pb2.DeleteModelRequest.SerializeToString,
                response_deserializer=cogment_dot_api_dot_model__registry__pb2.DeleteModelReply.FromString,
                )
        self.RetrieveModels = channel.unary_unary(
                '/cogmentAPI.ModelRegistrySP/RetrieveModels',
                request_serializer=cogment_dot_api_dot_model__registry__pb2.RetrieveModelsRequest.SerializeToString,
                response_deserializer=cogment_dot_api_dot_model__registry__pb2.RetrieveModelsReply.FromString,
                )
        self.CreateVersion = channel.stream_unary(
                '/cogmentAPI.ModelRegistrySP/CreateVersion',
                request_serializer=cogment_dot_api_dot_model__registry__pb2.CreateVersionRequestChunk.SerializeToString,
                response_deserializer=cogment_dot_api_dot_model__registry__pb2.CreateVersionReply.FromString,
                )
        self.RetrieveVersionInfos = channel.unary_unary(
                '/cogmentAPI.ModelRegistrySP/RetrieveVersionInfos',
                request_serializer=cogment_dot_api_dot_model__registry__pb2.RetrieveVersionInfosRequest.SerializeToString,
                response_deserializer=cogment_dot_api_dot_model__registry__pb2.RetrieveVersionInfosReply.FromString,
                )
        self.RetrieveVersionData = channel.unary_stream(
                '/cogmentAPI.ModelRegistrySP/RetrieveVersionData',
                request_serializer=cogment_dot_api_dot_model__registry__pb2.RetrieveVersionDataRequest.SerializeToString,
                response_deserializer=cogment_dot_api_dot_model__registry__pb2.RetrieveVersionDataReplyChunk.FromString,
                )
        self.Version = channel.unary_unary(
                '/cogmentAPI.ModelRegistrySP/Version',
                request_serializer=cogment_dot_api_dot_common__pb2.VersionRequest.SerializeToString,
                response_deserializer=cogment_dot_api_dot_common__pb2.VersionInfo.FromString,
                )


class ModelRegistrySPServicer(object):
    """API for model registry, it stores versioned model data and their metadata
    """

    def CreateOrUpdateModel(self, request, context):
        """Create or update a model
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def DeleteModel(self, request, context):
        """Delete a model and its versions
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def RetrieveModels(self, request, context):
        """Retrieve the the info of all or part of the models
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CreateVersion(self, request_iterator, context):
        """Create a model version and returns its information
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def RetrieveVersionInfos(self, request, context):
        """Retrieve the info of all or part of the versions of a model
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def RetrieveVersionData(self, request, context):
        """Retrieve the data of a model given or latest version
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Version(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_ModelRegistrySPServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'CreateOrUpdateModel': grpc.unary_unary_rpc_method_handler(
                    servicer.CreateOrUpdateModel,
                    request_deserializer=cogment_dot_api_dot_model__registry__pb2.CreateOrUpdateModelRequest.FromString,
                    response_serializer=cogment_dot_api_dot_model__registry__pb2.CreateOrUpdateModelReply.SerializeToString,
            ),
            'DeleteModel': grpc.unary_unary_rpc_method_handler(
                    servicer.DeleteModel,
                    request_deserializer=cogment_dot_api_dot_model__registry__pb2.DeleteModelRequest.FromString,
                    response_serializer=cogment_dot_api_dot_model__registry__pb2.DeleteModelReply.SerializeToString,
            ),
            'RetrieveModels': grpc.unary_unary_rpc_method_handler(
                    servicer.RetrieveModels,
                    request_deserializer=cogment_dot_api_dot_model__registry__pb2.RetrieveModelsRequest.FromString,
                    response_serializer=cogment_dot_api_dot_model__registry__pb2.RetrieveModelsReply.SerializeToString,
            ),
            'CreateVersion': grpc.stream_unary_rpc_method_handler(
                    servicer.CreateVersion,
                    request_deserializer=cogment_dot_api_dot_model__registry__pb2.CreateVersionRequestChunk.FromString,
                    response_serializer=cogment_dot_api_dot_model__registry__pb2.CreateVersionReply.SerializeToString,
            ),
            'RetrieveVersionInfos': grpc.unary_unary_rpc_method_handler(
                    servicer.RetrieveVersionInfos,
                    request_deserializer=cogment_dot_api_dot_model__registry__pb2.RetrieveVersionInfosRequest.FromString,
                    response_serializer=cogment_dot_api_dot_model__registry__pb2.RetrieveVersionInfosReply.SerializeToString,
            ),
            'RetrieveVersionData': grpc.unary_stream_rpc_method_handler(
                    servicer.RetrieveVersionData,
                    request_deserializer=cogment_dot_api_dot_model__registry__pb2.RetrieveVersionDataRequest.FromString,
                    response_serializer=cogment_dot_api_dot_model__registry__pb2.RetrieveVersionDataReplyChunk.SerializeToString,
            ),
            'Version': grpc.unary_unary_rpc_method_handler(
                    servicer.Version,
                    request_deserializer=cogment_dot_api_dot_common__pb2.VersionRequest.FromString,
                    response_serializer=cogment_dot_api_dot_common__pb2.VersionInfo.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'cogmentAPI.ModelRegistrySP', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class ModelRegistrySP(object):
    """API for model registry, it stores versioned model data and their metadata
    """

    @staticmethod
    def CreateOrUpdateModel(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, '/cogmentAPI.ModelRegistrySP/CreateOrUpdateModel',
            cogment_dot_api_dot_model__registry__pb2.CreateOrUpdateModelRequest.SerializeToString,
            cogment_dot_api_dot_model__registry__pb2.CreateOrUpdateModelReply.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def DeleteModel(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, '/cogmentAPI.ModelRegistrySP/DeleteModel',
            cogment_dot_api_dot_model__registry__pb2.DeleteModelRequest.SerializeToString,
            cogment_dot_api_dot_model__registry__pb2.DeleteModelReply.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def RetrieveModels(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, '/cogmentAPI.ModelRegistrySP/RetrieveModels',
            cogment_dot_api_dot_model__registry__pb2.RetrieveModelsRequest.SerializeToString,
            cogment_dot_api_dot_model__registry__pb2.RetrieveModelsReply.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def CreateVersion(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_unary(request_iterator, target, '/cogmentAPI.ModelRegistrySP/CreateVersion',
            cogment_dot_api_dot_model__registry__pb2.CreateVersionRequestChunk.SerializeToString,
            cogment_dot_api_dot_model__registry__pb2.CreateVersionReply.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def RetrieveVersionInfos(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, '/cogmentAPI.ModelRegistrySP/RetrieveVersionInfos',
            cogment_dot_api_dot_model__registry__pb2.RetrieveVersionInfosRequest.SerializeToString,
            cogment_dot_api_dot_model__registry__pb2.RetrieveVersionInfosReply.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def RetrieveVersionData(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, '/cogmentAPI.ModelRegistrySP/RetrieveVersionData',
            cogment_dot_api_dot_model__registry__pb2.RetrieveVersionDataRequest.SerializeToString,
            cogment_dot_api_dot_model__registry__pb2.RetrieveVersionDataReplyChunk.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Version(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, '/cogmentAPI.ModelRegistrySP/Version',
            cogment_dot_api_dot_common__pb2.VersionRequest.SerializeToString,
            cogment_dot_api_dot_common__pb2.VersionInfo.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
