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

import grpc

from chalk._gen.chalk.server.v1 import queries_pb2 as chalk_dot_server_dot_v1_dot_queries__pb2


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.GetQueryPerformanceSummary = channel.unary_unary(
            "/chalk.server.v1.QueriesService/GetQueryPerformanceSummary",
            request_serializer=chalk_dot_server_dot_v1_dot_queries__pb2.GetQueryPerformanceSummaryRequest.SerializeToString,
            response_deserializer=chalk_dot_server_dot_v1_dot_queries__pb2.GetQueryPerformanceSummaryResponse.FromString,
        )
        self.ListQueryErrors = channel.unary_unary(
            "/chalk.server.v1.QueriesService/ListQueryErrors",
            request_serializer=chalk_dot_server_dot_v1_dot_queries__pb2.ListQueryErrorsRequest.SerializeToString,
            response_deserializer=chalk_dot_server_dot_v1_dot_queries__pb2.ListQueryErrorsResponse.FromString,
        )
        self.GetQueryErrorsChart = channel.unary_unary(
            "/chalk.server.v1.QueriesService/GetQueryErrorsChart",
            request_serializer=chalk_dot_server_dot_v1_dot_queries__pb2.GetQueryErrorsChartRequest.SerializeToString,
            response_deserializer=chalk_dot_server_dot_v1_dot_queries__pb2.GetQueryErrorsChartResponse.FromString,
        )


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

    def GetQueryPerformanceSummary(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def ListQueryErrors(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def GetQueryErrorsChart(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")


def add_QueriesServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
        "GetQueryPerformanceSummary": grpc.unary_unary_rpc_method_handler(
            servicer.GetQueryPerformanceSummary,
            request_deserializer=chalk_dot_server_dot_v1_dot_queries__pb2.GetQueryPerformanceSummaryRequest.FromString,
            response_serializer=chalk_dot_server_dot_v1_dot_queries__pb2.GetQueryPerformanceSummaryResponse.SerializeToString,
        ),
        "ListQueryErrors": grpc.unary_unary_rpc_method_handler(
            servicer.ListQueryErrors,
            request_deserializer=chalk_dot_server_dot_v1_dot_queries__pb2.ListQueryErrorsRequest.FromString,
            response_serializer=chalk_dot_server_dot_v1_dot_queries__pb2.ListQueryErrorsResponse.SerializeToString,
        ),
        "GetQueryErrorsChart": grpc.unary_unary_rpc_method_handler(
            servicer.GetQueryErrorsChart,
            request_deserializer=chalk_dot_server_dot_v1_dot_queries__pb2.GetQueryErrorsChartRequest.FromString,
            response_serializer=chalk_dot_server_dot_v1_dot_queries__pb2.GetQueryErrorsChartResponse.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler("chalk.server.v1.QueriesService", rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


# This class is part of an EXPERIMENTAL API.
class QueriesService(object):
    """Missing associated documentation comment in .proto file."""

    @staticmethod
    def GetQueryPerformanceSummary(
        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,
            "/chalk.server.v1.QueriesService/GetQueryPerformanceSummary",
            chalk_dot_server_dot_v1_dot_queries__pb2.GetQueryPerformanceSummaryRequest.SerializeToString,
            chalk_dot_server_dot_v1_dot_queries__pb2.GetQueryPerformanceSummaryResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def ListQueryErrors(
        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,
            "/chalk.server.v1.QueriesService/ListQueryErrors",
            chalk_dot_server_dot_v1_dot_queries__pb2.ListQueryErrorsRequest.SerializeToString,
            chalk_dot_server_dot_v1_dot_queries__pb2.ListQueryErrorsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def GetQueryErrorsChart(
        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,
            "/chalk.server.v1.QueriesService/GetQueryErrorsChart",
            chalk_dot_server_dot_v1_dot_queries__pb2.GetQueryErrorsChartRequest.SerializeToString,
            chalk_dot_server_dot_v1_dot_queries__pb2.GetQueryErrorsChartResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )
