# 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 terrascope_api.models import algorithm_version_pb2 as algorithm__version__pb2

GRPC_GENERATED_VERSION = '1.70.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},'
        + f' but the generated code in algorithm_version_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 AlgorithmVersionApiStub(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.AlgorithmVersionApi/create',
                request_serializer=algorithm__version__pb2.AlgorithmVersionCreateRequest.SerializeToString,
                response_deserializer=algorithm__version__pb2.AlgorithmVersionCreateResponse.FromString,
                _registered_method=True)
        self.get = channel.unary_unary(
                '/oi.papi.AlgorithmVersionApi/get',
                request_serializer=algorithm__version__pb2.AlgorithmVersionGetRequest.SerializeToString,
                response_deserializer=algorithm__version__pb2.AlgorithmVersionGetResponse.FromString,
                _registered_method=True)
        self.list = channel.unary_unary(
                '/oi.papi.AlgorithmVersionApi/list',
                request_serializer=algorithm__version__pb2.AlgorithmVersionListRequest.SerializeToString,
                response_deserializer=algorithm__version__pb2.AlgorithmVersionListResponse.FromString,
                _registered_method=True)
        self.deprecate = channel.unary_unary(
                '/oi.papi.AlgorithmVersionApi/deprecate',
                request_serializer=algorithm__version__pb2.AlgorithmVersionDeprecateRequest.SerializeToString,
                response_deserializer=algorithm__version__pb2.AlgorithmVersionDeprecateResponse.FromString,
                _registered_method=True)
        self.deactivate = channel.unary_unary(
                '/oi.papi.AlgorithmVersionApi/deactivate',
                request_serializer=algorithm__version__pb2.AlgorithmVersionDeactivateRequest.SerializeToString,
                response_deserializer=algorithm__version__pb2.AlgorithmVersionDeactivateResponse.FromString,
                _registered_method=True)
        self.activate = channel.unary_unary(
                '/oi.papi.AlgorithmVersionApi/activate',
                request_serializer=algorithm__version__pb2.AlgorithmVersionActivateRequest.SerializeToString,
                response_deserializer=algorithm__version__pb2.AlgorithmVersionActivateResponse.FromString,
                _registered_method=True)


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

    def create(self, request, context):
        """
        Given a top level Algorithm, create a new version, which must be semantically greater than the previously created version.
        Once an AlgorithmVersion has been created, it is immutable. Any changes require a new version to be created.
        Any semantically correct version supplied as part of the AlgorithmVersion manifest will be considered value and assigned to this AlgorithmVersion.
        New versions will be required to be semantically greater than this version.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def get(self, request, context):
        """
        Get the details for a specific AlgorithmVersion. By default it does include the AlgorithmVersion manifest.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def list(self, request, context):
        """
        List all the AlgorithmVersions that the user has access to.
        Search text will be applied to the entire manifest returning all AlgorithmVersions whose manifest contains the search text.
        Tags will be matched exactly with the tags on the manifest. By default, this method only returns the semantically latest version of each Algorithm that has not been deprecated.
        It does not include manifests in the response.
        If include_all_versions is set to true, all prior versions of an Algorithm including deprecated AlgorithmVersion will be returned, as well.
        If include_manifest is set to true, the corresponding manifest of each algorithm_version will also be returned.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def deprecate(self, request, context):
        """
        Deprecate the specific version of this Algorithm.
        Deprecated AlgorithmVersions can still be searched for, metadata can be retrieved, and can still be used to create new AlgorithmConfigs which can be used as part of AlgorithmComputations, but they are no longer actively supported. All AlgorithmConfigs created from this AlgorithmVersion are also deprecated, but can still be used in new AlgorithmComputations.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def deactivate(self, request, context):
        """
        Deactivate the specific version of this Algorithm. Metadata for deactivated AlgorithmVersions can still be retrieved directly, but they will no longer show up in search results from the list endpoint.
        Deactivated AlgorithmVersions cannot be used to create new AlgorithmConfigs.
        All AlgorithmConfigs created from this AlgorithmVersion are also deactivated and can no longer be used to create new AlgorithmComputations.
        Existing AlgorithmComputations that are already using AlgorithmConfigs created from this AlgorithmVersion will still continue to run.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def activate(self, request, context):
        """
        Activates the specific version of the Algorithm.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_AlgorithmVersionApiServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'create': grpc.unary_unary_rpc_method_handler(
                    servicer.create,
                    request_deserializer=algorithm__version__pb2.AlgorithmVersionCreateRequest.FromString,
                    response_serializer=algorithm__version__pb2.AlgorithmVersionCreateResponse.SerializeToString,
            ),
            'get': grpc.unary_unary_rpc_method_handler(
                    servicer.get,
                    request_deserializer=algorithm__version__pb2.AlgorithmVersionGetRequest.FromString,
                    response_serializer=algorithm__version__pb2.AlgorithmVersionGetResponse.SerializeToString,
            ),
            'list': grpc.unary_unary_rpc_method_handler(
                    servicer.list,
                    request_deserializer=algorithm__version__pb2.AlgorithmVersionListRequest.FromString,
                    response_serializer=algorithm__version__pb2.AlgorithmVersionListResponse.SerializeToString,
            ),
            'deprecate': grpc.unary_unary_rpc_method_handler(
                    servicer.deprecate,
                    request_deserializer=algorithm__version__pb2.AlgorithmVersionDeprecateRequest.FromString,
                    response_serializer=algorithm__version__pb2.AlgorithmVersionDeprecateResponse.SerializeToString,
            ),
            'deactivate': grpc.unary_unary_rpc_method_handler(
                    servicer.deactivate,
                    request_deserializer=algorithm__version__pb2.AlgorithmVersionDeactivateRequest.FromString,
                    response_serializer=algorithm__version__pb2.AlgorithmVersionDeactivateResponse.SerializeToString,
            ),
            'activate': grpc.unary_unary_rpc_method_handler(
                    servicer.activate,
                    request_deserializer=algorithm__version__pb2.AlgorithmVersionActivateRequest.FromString,
                    response_serializer=algorithm__version__pb2.AlgorithmVersionActivateResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'oi.papi.AlgorithmVersionApi', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('oi.papi.AlgorithmVersionApi', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class AlgorithmVersionApi(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.AlgorithmVersionApi/create',
            algorithm__version__pb2.AlgorithmVersionCreateRequest.SerializeToString,
            algorithm__version__pb2.AlgorithmVersionCreateResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @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.AlgorithmVersionApi/get',
            algorithm__version__pb2.AlgorithmVersionGetRequest.SerializeToString,
            algorithm__version__pb2.AlgorithmVersionGetResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @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.AlgorithmVersionApi/list',
            algorithm__version__pb2.AlgorithmVersionListRequest.SerializeToString,
            algorithm__version__pb2.AlgorithmVersionListResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def deprecate(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.AlgorithmVersionApi/deprecate',
            algorithm__version__pb2.AlgorithmVersionDeprecateRequest.SerializeToString,
            algorithm__version__pb2.AlgorithmVersionDeprecateResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def deactivate(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.AlgorithmVersionApi/deactivate',
            algorithm__version__pb2.AlgorithmVersionDeactivateRequest.SerializeToString,
            algorithm__version__pb2.AlgorithmVersionDeactivateResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def activate(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.AlgorithmVersionApi/activate',
            algorithm__version__pb2.AlgorithmVersionActivateRequest.SerializeToString,
            algorithm__version__pb2.AlgorithmVersionActivateResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
