# 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_config_pb2 as algorithm__config__pb2

GRPC_GENERATED_VERSION = '1.66.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_config_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 AlgorithmConfigApiStub(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.AlgorithmConfigApi/create',
                request_serializer=algorithm__config__pb2.AlgorithmConfigCreateRequest.SerializeToString,
                response_deserializer=algorithm__config__pb2.AlgorithmConfigCreateResponse.FromString,
                _registered_method=True)
        self.get = channel.unary_unary(
                '/oi.papi.AlgorithmConfigApi/get',
                request_serializer=algorithm__config__pb2.AlgorithmConfigGetRequest.SerializeToString,
                response_deserializer=algorithm__config__pb2.AlgorithmConfigGetResponse.FromString,
                _registered_method=True)
        self.list = channel.unary_unary(
                '/oi.papi.AlgorithmConfigApi/list',
                request_serializer=algorithm__config__pb2.AlgorithmConfigListRequest.SerializeToString,
                response_deserializer=algorithm__config__pb2.AlgorithmConfigListResponse.FromString,
                _registered_method=True)
        self.update = channel.unary_unary(
                '/oi.papi.AlgorithmConfigApi/update',
                request_serializer=algorithm__config__pb2.AlgorithmConfigUpdateRequest.SerializeToString,
                response_deserializer=algorithm__config__pb2.AlgorithmConfigUpdateResponse.FromString,
                _registered_method=True)
        self.deprecate = channel.unary_unary(
                '/oi.papi.AlgorithmConfigApi/deprecate',
                request_serializer=algorithm__config__pb2.AlgorithmConfigDeprecateRequest.SerializeToString,
                response_deserializer=algorithm__config__pb2.AlgorithmConfigDeprecateResponse.FromString,
                _registered_method=True)
        self.deactivate = channel.unary_unary(
                '/oi.papi.AlgorithmConfigApi/deactivate',
                request_serializer=algorithm__config__pb2.AlgorithmConfigDeactivateRequest.SerializeToString,
                response_deserializer=algorithm__config__pb2.AlgorithmConfigDeactivateResponse.FromString,
                _registered_method=True)
        self.delete = channel.unary_unary(
                '/oi.papi.AlgorithmConfigApi/delete',
                request_serializer=algorithm__config__pb2.AlgorithmConfigDeleteRequest.SerializeToString,
                response_deserializer=algorithm__config__pb2.AlgorithmConfigDeleteResponse.FromString,
                _registered_method=True)


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

    def create(self, request, context):
        """
        Creates a configuration of the specified AlgorithmVersion, including concrete values for all of the algorithm parameters.
        This configuration is stored in the system and the AlgorithmConfig is returned to the user.
        """
        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 AlgorithmConfig.
        """
        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 AlgorithmConfigs that this user has access to and that match the provided search filters.
        By default, deactivated AlgorithmConfig are not returned. Setting include_deactivated to true will also return any AlgorithmConfig that have been deactivated.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def update(self, request, context):
        """
        Update details of an AlgorithmConfig, so long as it has not been locked.
        Once the AlgorithmConfig is used in an AlgorithmComputation, it is permanently locked and the specific parameter values can no longer be updated.
        """
        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 configuration of an AlgorithmConfig.
        Deprecated AlgorithmConfig can still be searched for, metadata can be retrieved, and can still be used in new AlgorithmComputations, but they are no longer actively supported.
        """
        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 configuration of an AlgorithmConfig.
        Deactivated AlgorithmConfig will no longer show up in searches, but metadata can still be retrieved for deactivated AlgorithmConfigs via the get endpoint.
        Deactivated AlgorithmConfig cannot be used in any new AlgorithmComputations, but existing AlgorithmComputations will continue to function properly.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def delete(self, request, context):
        """
        Delete the specified AlgorithmConfig, if and only if it has not been used to create an AlgorithmComputation.
        Once an AlgorithmConfig has been used to create an AlgorithmComputation it can never be deleted.
        The user must have permission to access the specified Algorithm.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_AlgorithmConfigApiServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'create': grpc.unary_unary_rpc_method_handler(
                    servicer.create,
                    request_deserializer=algorithm__config__pb2.AlgorithmConfigCreateRequest.FromString,
                    response_serializer=algorithm__config__pb2.AlgorithmConfigCreateResponse.SerializeToString,
            ),
            'get': grpc.unary_unary_rpc_method_handler(
                    servicer.get,
                    request_deserializer=algorithm__config__pb2.AlgorithmConfigGetRequest.FromString,
                    response_serializer=algorithm__config__pb2.AlgorithmConfigGetResponse.SerializeToString,
            ),
            'list': grpc.unary_unary_rpc_method_handler(
                    servicer.list,
                    request_deserializer=algorithm__config__pb2.AlgorithmConfigListRequest.FromString,
                    response_serializer=algorithm__config__pb2.AlgorithmConfigListResponse.SerializeToString,
            ),
            'update': grpc.unary_unary_rpc_method_handler(
                    servicer.update,
                    request_deserializer=algorithm__config__pb2.AlgorithmConfigUpdateRequest.FromString,
                    response_serializer=algorithm__config__pb2.AlgorithmConfigUpdateResponse.SerializeToString,
            ),
            'deprecate': grpc.unary_unary_rpc_method_handler(
                    servicer.deprecate,
                    request_deserializer=algorithm__config__pb2.AlgorithmConfigDeprecateRequest.FromString,
                    response_serializer=algorithm__config__pb2.AlgorithmConfigDeprecateResponse.SerializeToString,
            ),
            'deactivate': grpc.unary_unary_rpc_method_handler(
                    servicer.deactivate,
                    request_deserializer=algorithm__config__pb2.AlgorithmConfigDeactivateRequest.FromString,
                    response_serializer=algorithm__config__pb2.AlgorithmConfigDeactivateResponse.SerializeToString,
            ),
            'delete': grpc.unary_unary_rpc_method_handler(
                    servicer.delete,
                    request_deserializer=algorithm__config__pb2.AlgorithmConfigDeleteRequest.FromString,
                    response_serializer=algorithm__config__pb2.AlgorithmConfigDeleteResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'oi.papi.AlgorithmConfigApi', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('oi.papi.AlgorithmConfigApi', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class AlgorithmConfigApi(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.AlgorithmConfigApi/create',
            algorithm__config__pb2.AlgorithmConfigCreateRequest.SerializeToString,
            algorithm__config__pb2.AlgorithmConfigCreateResponse.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.AlgorithmConfigApi/get',
            algorithm__config__pb2.AlgorithmConfigGetRequest.SerializeToString,
            algorithm__config__pb2.AlgorithmConfigGetResponse.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.AlgorithmConfigApi/list',
            algorithm__config__pb2.AlgorithmConfigListRequest.SerializeToString,
            algorithm__config__pb2.AlgorithmConfigListResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @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.AlgorithmConfigApi/update',
            algorithm__config__pb2.AlgorithmConfigUpdateRequest.SerializeToString,
            algorithm__config__pb2.AlgorithmConfigUpdateResponse.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.AlgorithmConfigApi/deprecate',
            algorithm__config__pb2.AlgorithmConfigDeprecateRequest.SerializeToString,
            algorithm__config__pb2.AlgorithmConfigDeprecateResponse.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.AlgorithmConfigApi/deactivate',
            algorithm__config__pb2.AlgorithmConfigDeactivateRequest.SerializeToString,
            algorithm__config__pb2.AlgorithmConfigDeactivateResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def delete(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.AlgorithmConfigApi/delete',
            algorithm__config__pb2.AlgorithmConfigDeleteRequest.SerializeToString,
            algorithm__config__pb2.AlgorithmConfigDeleteResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
