# 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 analysis_version_pb2 as analysis__version__pb2

GRPC_GENERATED_VERSION = '1.65.4'
GRPC_VERSION = grpc.__version__
EXPECTED_ERROR_RELEASE = '1.66.0'
SCHEDULED_RELEASE_DATE = 'August 6, 2024'
_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:
    warnings.warn(
        f'The grpc package installed is at version {GRPC_VERSION},'
        + f' but the generated code in analysis_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}.'
        + f' This warning will become an error in {EXPECTED_ERROR_RELEASE},'
        + f' scheduled for release on {SCHEDULED_RELEASE_DATE}.',
        RuntimeWarning
    )


class AnalysisVersionApiStub(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.AnalysisVersionApi/create',
                request_serializer=analysis__version__pb2.AnalysisVersionCreateRequest.SerializeToString,
                response_deserializer=analysis__version__pb2.AnalysisVersionCreateResponse.FromString,
                _registered_method=True)
        self.get = channel.unary_unary(
                '/oi.papi.AnalysisVersionApi/get',
                request_serializer=analysis__version__pb2.AnalysisVersionGetRequest.SerializeToString,
                response_deserializer=analysis__version__pb2.AnalysisVersionGetResponse.FromString,
                _registered_method=True)
        self.list = channel.unary_unary(
                '/oi.papi.AnalysisVersionApi/list',
                request_serializer=analysis__version__pb2.AnalysisVersionListRequest.SerializeToString,
                response_deserializer=analysis__version__pb2.AnalysisVersionListResponse.FromString,
                _registered_method=True)


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

    def create(self, request, context):
        """
        Given a top level Analysis, create a new version, which must be semantically greater than the previously created version.
        Once an AnalysisVersion has been created, it is immutable. Any changes require a new version to be created.
        The purpose of this is to either upgrade the structure of the Analysis DAG OR update the versions of the algorithms assigned to the Analysis.
        """
        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 AnalysisVersion. By default it does not include the analysis_manifest.
        Setting include_manifest to true, will also include the manifest in the response for each requested AnalysisVersion.
        """
        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 AnalysisVersions that the user has access to.
        Search text will be applied to the entire manifest returning all AnalysisVersions 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 Analysis 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 Analysis including deprecated AnalysisVersions will be returned, as well.
        If include_manifest is set to true, the corresponding manifest of each AnalysisVersion will also be returned.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_AnalysisVersionApiServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'create': grpc.unary_unary_rpc_method_handler(
                    servicer.create,
                    request_deserializer=analysis__version__pb2.AnalysisVersionCreateRequest.FromString,
                    response_serializer=analysis__version__pb2.AnalysisVersionCreateResponse.SerializeToString,
            ),
            'get': grpc.unary_unary_rpc_method_handler(
                    servicer.get,
                    request_deserializer=analysis__version__pb2.AnalysisVersionGetRequest.FromString,
                    response_serializer=analysis__version__pb2.AnalysisVersionGetResponse.SerializeToString,
            ),
            'list': grpc.unary_unary_rpc_method_handler(
                    servicer.list,
                    request_deserializer=analysis__version__pb2.AnalysisVersionListRequest.FromString,
                    response_serializer=analysis__version__pb2.AnalysisVersionListResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'oi.papi.AnalysisVersionApi', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('oi.papi.AnalysisVersionApi', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class AnalysisVersionApi(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.AnalysisVersionApi/create',
            analysis__version__pb2.AnalysisVersionCreateRequest.SerializeToString,
            analysis__version__pb2.AnalysisVersionCreateResponse.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.AnalysisVersionApi/get',
            analysis__version__pb2.AnalysisVersionGetRequest.SerializeToString,
            analysis__version__pb2.AnalysisVersionGetResponse.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.AnalysisVersionApi/list',
            analysis__version__pb2.AnalysisVersionListRequest.SerializeToString,
            analysis__version__pb2.AnalysisVersionListResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
