# 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 offline_queries_pb2 as chalk_dot_server_dot_v1_dot_offline__queries__pb2
from chalk._gen.chalk.server.v1 import performance_summary_pb2 as chalk_dot_server_dot_v1_dot_performance__summary__pb2


class OfflineQueryMetadataServiceStub(object):
    """message GetOfflineQueryShardsRequest {
    string offline_query_id = 1;
    }

    message GetOfflineQueryShardsResponse {
    repeated OfflineQueryShard offline_query_shards = 1;
    }

    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.ListOfflineQueries = channel.unary_unary(
            "/chalk.server.v1.OfflineQueryMetadataService/ListOfflineQueries",
            request_serializer=chalk_dot_server_dot_v1_dot_offline__queries__pb2.ListOfflineQueriesRequest.SerializeToString,
            response_deserializer=chalk_dot_server_dot_v1_dot_offline__queries__pb2.ListOfflineQueriesResponse.FromString,
        )
        self.GetOfflineQuery = channel.unary_unary(
            "/chalk.server.v1.OfflineQueryMetadataService/GetOfflineQuery",
            request_serializer=chalk_dot_server_dot_v1_dot_offline__queries__pb2.GetOfflineQueryRequest.SerializeToString,
            response_deserializer=chalk_dot_server_dot_v1_dot_offline__queries__pb2.GetOfflineQueryResponse.FromString,
        )
        self.ListOfflineQueryShardPerformanceSummaries = channel.unary_unary(
            "/chalk.server.v1.OfflineQueryMetadataService/ListOfflineQueryShardPerformanceSummaries",
            request_serializer=chalk_dot_server_dot_v1_dot_performance__summary__pb2.ListOfflineQueryShardPerformanceSummariesRequest.SerializeToString,
            response_deserializer=chalk_dot_server_dot_v1_dot_performance__summary__pb2.ListOfflineQueryShardPerformanceSummariesResponse.FromString,
        )


class OfflineQueryMetadataServiceServicer(object):
    """message GetOfflineQueryShardsRequest {
    string offline_query_id = 1;
    }

    message GetOfflineQueryShardsResponse {
    repeated OfflineQueryShard offline_query_shards = 1;
    }

    """

    def ListOfflineQueries(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 GetOfflineQuery(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 ListOfflineQueryShardPerformanceSummaries(self, request, context):
        """rpc GetOfflineQueryShards(GetOfflineQueryShardsRequest) returns (GetOfflineQueryShardsResponse) {
        option(chalk.auth.v1.permission) = PERMISSION_DEPLOY_READ;
        option idempotency_level = NO_SIDE_EFFECTS;
        }

        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")


def add_OfflineQueryMetadataServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
        "ListOfflineQueries": grpc.unary_unary_rpc_method_handler(
            servicer.ListOfflineQueries,
            request_deserializer=chalk_dot_server_dot_v1_dot_offline__queries__pb2.ListOfflineQueriesRequest.FromString,
            response_serializer=chalk_dot_server_dot_v1_dot_offline__queries__pb2.ListOfflineQueriesResponse.SerializeToString,
        ),
        "GetOfflineQuery": grpc.unary_unary_rpc_method_handler(
            servicer.GetOfflineQuery,
            request_deserializer=chalk_dot_server_dot_v1_dot_offline__queries__pb2.GetOfflineQueryRequest.FromString,
            response_serializer=chalk_dot_server_dot_v1_dot_offline__queries__pb2.GetOfflineQueryResponse.SerializeToString,
        ),
        "ListOfflineQueryShardPerformanceSummaries": grpc.unary_unary_rpc_method_handler(
            servicer.ListOfflineQueryShardPerformanceSummaries,
            request_deserializer=chalk_dot_server_dot_v1_dot_performance__summary__pb2.ListOfflineQueryShardPerformanceSummariesRequest.FromString,
            response_serializer=chalk_dot_server_dot_v1_dot_performance__summary__pb2.ListOfflineQueryShardPerformanceSummariesResponse.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        "chalk.server.v1.OfflineQueryMetadataService", rpc_method_handlers
    )
    server.add_generic_rpc_handlers((generic_handler,))


# This class is part of an EXPERIMENTAL API.
class OfflineQueryMetadataService(object):
    """message GetOfflineQueryShardsRequest {
    string offline_query_id = 1;
    }

    message GetOfflineQueryShardsResponse {
    repeated OfflineQueryShard offline_query_shards = 1;
    }

    """

    @staticmethod
    def ListOfflineQueries(
        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.OfflineQueryMetadataService/ListOfflineQueries",
            chalk_dot_server_dot_v1_dot_offline__queries__pb2.ListOfflineQueriesRequest.SerializeToString,
            chalk_dot_server_dot_v1_dot_offline__queries__pb2.ListOfflineQueriesResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def GetOfflineQuery(
        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.OfflineQueryMetadataService/GetOfflineQuery",
            chalk_dot_server_dot_v1_dot_offline__queries__pb2.GetOfflineQueryRequest.SerializeToString,
            chalk_dot_server_dot_v1_dot_offline__queries__pb2.GetOfflineQueryResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def ListOfflineQueryShardPerformanceSummaries(
        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.OfflineQueryMetadataService/ListOfflineQueryShardPerformanceSummaries",
            chalk_dot_server_dot_v1_dot_performance__summary__pb2.ListOfflineQueryShardPerformanceSummariesRequest.SerializeToString,
            chalk_dot_server_dot_v1_dot_performance__summary__pb2.ListOfflineQueryShardPerformanceSummariesResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )
