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

from fsai_grpc_api.protos import query_api_pb2 as fsai__grpc__api_dot_protos_dot_query__api__pb2


class QueryApiStub(object):
    """Service that interacts with the query api.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.GetDetectionsWithinBoundingBox = channel.unary_unary(
                '/QueryApi/GetDetectionsWithinBoundingBox',
                request_serializer=fsai__grpc__api_dot_protos_dot_query__api__pb2.DetectionsWithinBoundingBoxRequest.SerializeToString,
                response_deserializer=fsai__grpc__api_dot_protos_dot_query__api__pb2.QueryResponses.FromString,
                )
        self.GetDetectionsAggregated = channel.unary_stream(
                '/QueryApi/GetDetectionsAggregated',
                request_serializer=fsai__grpc__api_dot_protos_dot_query__api__pb2.DetectionsAggregatedRequest.SerializeToString,
                response_deserializer=fsai__grpc__api_dot_protos_dot_query__api__pb2.DetectionsAggregatedResponse.FromString,
                )


class QueryApiServicer(object):
    """Service that interacts with the query api.
    """

    def GetDetectionsWithinBoundingBox(self, request, context):
        """Get the detections within a bounding box.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetDetectionsAggregated(self, request, context):
        """Get the detections aggregated within a bounding box. 
        Used by the manifest storage workflow step.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_QueryApiServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'GetDetectionsWithinBoundingBox': grpc.unary_unary_rpc_method_handler(
                    servicer.GetDetectionsWithinBoundingBox,
                    request_deserializer=fsai__grpc__api_dot_protos_dot_query__api__pb2.DetectionsWithinBoundingBoxRequest.FromString,
                    response_serializer=fsai__grpc__api_dot_protos_dot_query__api__pb2.QueryResponses.SerializeToString,
            ),
            'GetDetectionsAggregated': grpc.unary_stream_rpc_method_handler(
                    servicer.GetDetectionsAggregated,
                    request_deserializer=fsai__grpc__api_dot_protos_dot_query__api__pb2.DetectionsAggregatedRequest.FromString,
                    response_serializer=fsai__grpc__api_dot_protos_dot_query__api__pb2.DetectionsAggregatedResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'QueryApi', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class QueryApi(object):
    """Service that interacts with the query api.
    """

    @staticmethod
    def GetDetectionsWithinBoundingBox(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, '/QueryApi/GetDetectionsWithinBoundingBox',
            fsai__grpc__api_dot_protos_dot_query__api__pb2.DetectionsWithinBoundingBoxRequest.SerializeToString,
            fsai__grpc__api_dot_protos_dot_query__api__pb2.QueryResponses.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetDetectionsAggregated(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_stream(request, target, '/QueryApi/GetDetectionsAggregated',
            fsai__grpc__api_dot_protos_dot_query__api__pb2.DetectionsAggregatedRequest.SerializeToString,
            fsai__grpc__api_dot_protos_dot_query__api__pb2.DetectionsAggregatedResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
