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

from mlrunx.v1 import query_pb2 as mlrunx_dot_v1_dot_query__pb2


class QueryServiceStub(object):
    """=============================================================================
    Query Service
    =============================================================================

    QueryService provides read access to experiment data.
    See: /docs/spec/query.md
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.ListRuns = channel.unary_unary(
                '/mlrunx.v1.QueryService/ListRuns',
                request_serializer=mlrunx_dot_v1_dot_query__pb2.ListRunsRequest.SerializeToString,
                response_deserializer=mlrunx_dot_v1_dot_query__pb2.ListRunsResponse.FromString,
                _registered_method=True)
        self.GetRun = channel.unary_unary(
                '/mlrunx.v1.QueryService/GetRun',
                request_serializer=mlrunx_dot_v1_dot_query__pb2.GetRunRequest.SerializeToString,
                response_deserializer=mlrunx_dot_v1_dot_query__pb2.GetRunResponse.FromString,
                _registered_method=True)
        self.GetMetrics = channel.unary_unary(
                '/mlrunx.v1.QueryService/GetMetrics',
                request_serializer=mlrunx_dot_v1_dot_query__pb2.GetMetricsRequest.SerializeToString,
                response_deserializer=mlrunx_dot_v1_dot_query__pb2.GetMetricsResponse.FromString,
                _registered_method=True)
        self.CompareRuns = channel.unary_unary(
                '/mlrunx.v1.QueryService/CompareRuns',
                request_serializer=mlrunx_dot_v1_dot_query__pb2.CompareRunsRequest.SerializeToString,
                response_deserializer=mlrunx_dot_v1_dot_query__pb2.CompareRunsResponse.FromString,
                _registered_method=True)
        self.ListArtifacts = channel.unary_unary(
                '/mlrunx.v1.QueryService/ListArtifacts',
                request_serializer=mlrunx_dot_v1_dot_query__pb2.ListArtifactsRequest.SerializeToString,
                response_deserializer=mlrunx_dot_v1_dot_query__pb2.ListArtifactsResponse.FromString,
                _registered_method=True)
        self.GetArtifactDownloadUrl = channel.unary_unary(
                '/mlrunx.v1.QueryService/GetArtifactDownloadUrl',
                request_serializer=mlrunx_dot_v1_dot_query__pb2.GetArtifactDownloadUrlRequest.SerializeToString,
                response_deserializer=mlrunx_dot_v1_dot_query__pb2.GetArtifactDownloadUrlResponse.FromString,
                _registered_method=True)
        self.GetProjectStats = channel.unary_unary(
                '/mlrunx.v1.QueryService/GetProjectStats',
                request_serializer=mlrunx_dot_v1_dot_query__pb2.GetProjectStatsRequest.SerializeToString,
                response_deserializer=mlrunx_dot_v1_dot_query__pb2.GetProjectStatsResponse.FromString,
                _registered_method=True)
        self.SearchRuns = channel.unary_unary(
                '/mlrunx.v1.QueryService/SearchRuns',
                request_serializer=mlrunx_dot_v1_dot_query__pb2.SearchRunsRequest.SerializeToString,
                response_deserializer=mlrunx_dot_v1_dot_query__pb2.SearchRunsResponse.FromString,
                _registered_method=True)


class QueryServiceServicer(object):
    """=============================================================================
    Query Service
    =============================================================================

    QueryService provides read access to experiment data.
    See: /docs/spec/query.md
    """

    def ListRuns(self, request, context):
        """List runs with filtering and pagination.
        See: /docs/spec/query.md#runs-list-filtering
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetRun(self, request, context):
        """Get a single run by ID.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetMetrics(self, request, context):
        """Get metrics for one or more runs.
        See: /docs/spec/query.md#metric-fetch-contract
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CompareRuns(self, request, context):
        """Compare metrics across multiple runs with alignment.
        See: /docs/spec/query.md#compare-runs-alignment
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ListArtifacts(self, request, context):
        """Get artifacts for a run.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetArtifactDownloadUrl(self, request, context):
        """Get a presigned download URL for an artifact.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetProjectStats(self, request, context):
        """Get summary statistics for a project.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def SearchRuns(self, request, context):
        """Search runs by text query (name, tags, params).
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_QueryServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'ListRuns': grpc.unary_unary_rpc_method_handler(
                    servicer.ListRuns,
                    request_deserializer=mlrunx_dot_v1_dot_query__pb2.ListRunsRequest.FromString,
                    response_serializer=mlrunx_dot_v1_dot_query__pb2.ListRunsResponse.SerializeToString,
            ),
            'GetRun': grpc.unary_unary_rpc_method_handler(
                    servicer.GetRun,
                    request_deserializer=mlrunx_dot_v1_dot_query__pb2.GetRunRequest.FromString,
                    response_serializer=mlrunx_dot_v1_dot_query__pb2.GetRunResponse.SerializeToString,
            ),
            'GetMetrics': grpc.unary_unary_rpc_method_handler(
                    servicer.GetMetrics,
                    request_deserializer=mlrunx_dot_v1_dot_query__pb2.GetMetricsRequest.FromString,
                    response_serializer=mlrunx_dot_v1_dot_query__pb2.GetMetricsResponse.SerializeToString,
            ),
            'CompareRuns': grpc.unary_unary_rpc_method_handler(
                    servicer.CompareRuns,
                    request_deserializer=mlrunx_dot_v1_dot_query__pb2.CompareRunsRequest.FromString,
                    response_serializer=mlrunx_dot_v1_dot_query__pb2.CompareRunsResponse.SerializeToString,
            ),
            'ListArtifacts': grpc.unary_unary_rpc_method_handler(
                    servicer.ListArtifacts,
                    request_deserializer=mlrunx_dot_v1_dot_query__pb2.ListArtifactsRequest.FromString,
                    response_serializer=mlrunx_dot_v1_dot_query__pb2.ListArtifactsResponse.SerializeToString,
            ),
            'GetArtifactDownloadUrl': grpc.unary_unary_rpc_method_handler(
                    servicer.GetArtifactDownloadUrl,
                    request_deserializer=mlrunx_dot_v1_dot_query__pb2.GetArtifactDownloadUrlRequest.FromString,
                    response_serializer=mlrunx_dot_v1_dot_query__pb2.GetArtifactDownloadUrlResponse.SerializeToString,
            ),
            'GetProjectStats': grpc.unary_unary_rpc_method_handler(
                    servicer.GetProjectStats,
                    request_deserializer=mlrunx_dot_v1_dot_query__pb2.GetProjectStatsRequest.FromString,
                    response_serializer=mlrunx_dot_v1_dot_query__pb2.GetProjectStatsResponse.SerializeToString,
            ),
            'SearchRuns': grpc.unary_unary_rpc_method_handler(
                    servicer.SearchRuns,
                    request_deserializer=mlrunx_dot_v1_dot_query__pb2.SearchRunsRequest.FromString,
                    response_serializer=mlrunx_dot_v1_dot_query__pb2.SearchRunsResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'mlrunx.v1.QueryService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('mlrunx.v1.QueryService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class QueryService(object):
    """=============================================================================
    Query Service
    =============================================================================

    QueryService provides read access to experiment data.
    See: /docs/spec/query.md
    """

    @staticmethod
    def ListRuns(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,
            '/mlrunx.v1.QueryService/ListRuns',
            mlrunx_dot_v1_dot_query__pb2.ListRunsRequest.SerializeToString,
            mlrunx_dot_v1_dot_query__pb2.ListRunsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetRun(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,
            '/mlrunx.v1.QueryService/GetRun',
            mlrunx_dot_v1_dot_query__pb2.GetRunRequest.SerializeToString,
            mlrunx_dot_v1_dot_query__pb2.GetRunResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetMetrics(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,
            '/mlrunx.v1.QueryService/GetMetrics',
            mlrunx_dot_v1_dot_query__pb2.GetMetricsRequest.SerializeToString,
            mlrunx_dot_v1_dot_query__pb2.GetMetricsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def CompareRuns(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,
            '/mlrunx.v1.QueryService/CompareRuns',
            mlrunx_dot_v1_dot_query__pb2.CompareRunsRequest.SerializeToString,
            mlrunx_dot_v1_dot_query__pb2.CompareRunsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ListArtifacts(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,
            '/mlrunx.v1.QueryService/ListArtifacts',
            mlrunx_dot_v1_dot_query__pb2.ListArtifactsRequest.SerializeToString,
            mlrunx_dot_v1_dot_query__pb2.ListArtifactsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetArtifactDownloadUrl(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,
            '/mlrunx.v1.QueryService/GetArtifactDownloadUrl',
            mlrunx_dot_v1_dot_query__pb2.GetArtifactDownloadUrlRequest.SerializeToString,
            mlrunx_dot_v1_dot_query__pb2.GetArtifactDownloadUrlResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetProjectStats(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,
            '/mlrunx.v1.QueryService/GetProjectStats',
            mlrunx_dot_v1_dot_query__pb2.GetProjectStatsRequest.SerializeToString,
            mlrunx_dot_v1_dot_query__pb2.GetProjectStatsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def SearchRuns(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,
            '/mlrunx.v1.QueryService/SearchRuns',
            mlrunx_dot_v1_dot_query__pb2.SearchRunsRequest.SerializeToString,
            mlrunx_dot_v1_dot_query__pb2.SearchRunsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
