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

from queryservice_client.protobuf.common import checks_pb2 as common_dot_checks__pb2


class OperationsStub(object):
    """The Operations Service contains endpoints that are used to verify and inspect the operation of the
    connector. These can include various service checks, health checks, operational stats,
    test endpoints etc.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.PreflightCheck = channel.unary_stream(
                '/ocf.common.Operations/PreflightCheck',
                request_serializer=common_dot_checks__pb2.CheckRequest.SerializeToString,
                response_deserializer=common_dot_checks__pb2.CheckResult.FromString,
                )


class OperationsServicer(object):
    """The Operations Service contains endpoints that are used to verify and inspect the operation of the
    connector. These can include various service checks, health checks, operational stats,
    test endpoints etc.
    """

    def PreflightCheck(self, request, context):
        """Is used to do various pre flight checks on features
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_OperationsServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'PreflightCheck': grpc.unary_stream_rpc_method_handler(
                    servicer.PreflightCheck,
                    request_deserializer=common_dot_checks__pb2.CheckRequest.FromString,
                    response_serializer=common_dot_checks__pb2.CheckResult.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'ocf.common.Operations', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class Operations(object):
    """The Operations Service contains endpoints that are used to verify and inspect the operation of the
    connector. These can include various service checks, health checks, operational stats,
    test endpoints etc.
    """

    @staticmethod
    def PreflightCheck(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, '/ocf.common.Operations/PreflightCheck',
            common_dot_checks__pb2.CheckRequest.SerializeToString,
            common_dot_checks__pb2.CheckResult.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
