# 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.engine.v1 import (
    plan_server_pb2 as chalk_dot_engine_dot_v1_dot_plan__server__pb2,
)


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.GetPlan = channel.unary_unary(
            "/chalk.engine.v1.PlanService/GetPlan",
            request_serializer=chalk_dot_engine_dot_v1_dot_plan__server__pb2.GetPlanRequest.SerializeToString,
            response_deserializer=chalk_dot_engine_dot_v1_dot_plan__server__pb2.GetPlanResponse.FromString,
        )
        self.ExecuteQuery = channel.unary_unary(
            "/chalk.engine.v1.PlanService/ExecuteQuery",
            request_serializer=chalk_dot_engine_dot_v1_dot_plan__server__pb2.ExecuteQueryRequest.SerializeToString,
            response_deserializer=chalk_dot_engine_dot_v1_dot_plan__server__pb2.ExecuteQueryResponse.FromString,
        )


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

    def GetPlan(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 ExecuteQuery(self, request, context):
        """Fall-back for executing queries on the python engine"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")


def add_PlanServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
        "GetPlan": grpc.unary_unary_rpc_method_handler(
            servicer.GetPlan,
            request_deserializer=chalk_dot_engine_dot_v1_dot_plan__server__pb2.GetPlanRequest.FromString,
            response_serializer=chalk_dot_engine_dot_v1_dot_plan__server__pb2.GetPlanResponse.SerializeToString,
        ),
        "ExecuteQuery": grpc.unary_unary_rpc_method_handler(
            servicer.ExecuteQuery,
            request_deserializer=chalk_dot_engine_dot_v1_dot_plan__server__pb2.ExecuteQueryRequest.FromString,
            response_serializer=chalk_dot_engine_dot_v1_dot_plan__server__pb2.ExecuteQueryResponse.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        "chalk.engine.v1.PlanService", rpc_method_handlers
    )
    server.add_generic_rpc_handlers((generic_handler,))


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

    @staticmethod
    def GetPlan(
        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.engine.v1.PlanService/GetPlan",
            chalk_dot_engine_dot_v1_dot_plan__server__pb2.GetPlanRequest.SerializeToString,
            chalk_dot_engine_dot_v1_dot_plan__server__pb2.GetPlanResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def ExecuteQuery(
        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.engine.v1.PlanService/ExecuteQuery",
            chalk_dot_engine_dot_v1_dot_plan__server__pb2.ExecuteQueryRequest.SerializeToString,
            chalk_dot_engine_dot_v1_dot_plan__server__pb2.ExecuteQueryResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )
