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

from terrascope_api.models import algorithm_pb2 as algorithm__pb2


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.create = channel.unary_unary(
                '/oi.papi.AlgorithmApi/create',
                request_serializer=algorithm__pb2.AlgorithmCreateRequest.SerializeToString,
                response_deserializer=algorithm__pb2.AlgorithmCreateResponse.FromString,
                )
        self.update = channel.unary_unary(
                '/oi.papi.AlgorithmApi/update',
                request_serializer=algorithm__pb2.AlgorithmUpdateRequest.SerializeToString,
                response_deserializer=algorithm__pb2.AlgorithmUpdateResponse.FromString,
                )
        self.get = channel.unary_unary(
                '/oi.papi.AlgorithmApi/get',
                request_serializer=algorithm__pb2.AlgorithmGetRequest.SerializeToString,
                response_deserializer=algorithm__pb2.AlgorithmGetResponse.FromString,
                )
        self.list = channel.unary_unary(
                '/oi.papi.AlgorithmApi/list',
                request_serializer=algorithm__pb2.AlgorithmListRequest.SerializeToString,
                response_deserializer=algorithm__pb2.AlgorithmListResponse.FromString,
                )


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

    def create(self, request, context):
        """
        Create a top level Algorithm object.
        This object is lightweight and is used to connect all versions of an Algorithm together.
        Once an Algorithm has been created, an AlgorithmVersion must be created using a manifest.
        Next an algorithm_config may be created to specify a particular configuration of an AlgorithmVersion,
        which can be used in an AlgorithmComputation.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def update(self, request, context):
        """
        Update the mutable fields of a top level algorithm.
        This should be done rarely and with caution as it will affect all algorithm_versions and algorithm_configs associated with this algorithm.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def get(self, request, context):
        """
        Retrieve the metadata of a particular Algorithm.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def list(self, request, context):
        """
        Retrieve the metadata for all Algorithms that this user has access to and that match the provided search filters, if any.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_AlgorithmApiServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'create': grpc.unary_unary_rpc_method_handler(
                    servicer.create,
                    request_deserializer=algorithm__pb2.AlgorithmCreateRequest.FromString,
                    response_serializer=algorithm__pb2.AlgorithmCreateResponse.SerializeToString,
            ),
            'update': grpc.unary_unary_rpc_method_handler(
                    servicer.update,
                    request_deserializer=algorithm__pb2.AlgorithmUpdateRequest.FromString,
                    response_serializer=algorithm__pb2.AlgorithmUpdateResponse.SerializeToString,
            ),
            'get': grpc.unary_unary_rpc_method_handler(
                    servicer.get,
                    request_deserializer=algorithm__pb2.AlgorithmGetRequest.FromString,
                    response_serializer=algorithm__pb2.AlgorithmGetResponse.SerializeToString,
            ),
            'list': grpc.unary_unary_rpc_method_handler(
                    servicer.list,
                    request_deserializer=algorithm__pb2.AlgorithmListRequest.FromString,
                    response_serializer=algorithm__pb2.AlgorithmListResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'oi.papi.AlgorithmApi', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


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

    @staticmethod
    def create(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, '/oi.papi.AlgorithmApi/create',
            algorithm__pb2.AlgorithmCreateRequest.SerializeToString,
            algorithm__pb2.AlgorithmCreateResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def update(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, '/oi.papi.AlgorithmApi/update',
            algorithm__pb2.AlgorithmUpdateRequest.SerializeToString,
            algorithm__pb2.AlgorithmUpdateResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def get(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, '/oi.papi.AlgorithmApi/get',
            algorithm__pb2.AlgorithmGetRequest.SerializeToString,
            algorithm__pb2.AlgorithmGetResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def list(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, '/oi.papi.AlgorithmApi/list',
            algorithm__pb2.AlgorithmListRequest.SerializeToString,
            algorithm__pb2.AlgorithmListResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
