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

from ydb._grpc.v4.protos import ydb_coordination_pb2 as protos_dot_ydb__coordination__pb2


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.Session = channel.stream_stream(
                '/Ydb.Coordination.V1.CoordinationService/Session',
                request_serializer=protos_dot_ydb__coordination__pb2.SessionRequest.SerializeToString,
                response_deserializer=protos_dot_ydb__coordination__pb2.SessionResponse.FromString,
                )
        self.CreateNode = channel.unary_unary(
                '/Ydb.Coordination.V1.CoordinationService/CreateNode',
                request_serializer=protos_dot_ydb__coordination__pb2.CreateNodeRequest.SerializeToString,
                response_deserializer=protos_dot_ydb__coordination__pb2.CreateNodeResponse.FromString,
                )
        self.AlterNode = channel.unary_unary(
                '/Ydb.Coordination.V1.CoordinationService/AlterNode',
                request_serializer=protos_dot_ydb__coordination__pb2.AlterNodeRequest.SerializeToString,
                response_deserializer=protos_dot_ydb__coordination__pb2.AlterNodeResponse.FromString,
                )
        self.DropNode = channel.unary_unary(
                '/Ydb.Coordination.V1.CoordinationService/DropNode',
                request_serializer=protos_dot_ydb__coordination__pb2.DropNodeRequest.SerializeToString,
                response_deserializer=protos_dot_ydb__coordination__pb2.DropNodeResponse.FromString,
                )
        self.DescribeNode = channel.unary_unary(
                '/Ydb.Coordination.V1.CoordinationService/DescribeNode',
                request_serializer=protos_dot_ydb__coordination__pb2.DescribeNodeRequest.SerializeToString,
                response_deserializer=protos_dot_ydb__coordination__pb2.DescribeNodeResponse.FromString,
                )


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

    def Session(self, request_iterator, context):
        """*
        Bidirectional stream used to establish a session with a coordination node

        Relevant APIs for managing semaphores, distributed locking, creating or
        restoring a previously established session are described using nested
        messages in SessionRequest and SessionResponse. Session is established
        with a specific coordination node (previously created using CreateNode
        below) and semaphores are local to that coordination node.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CreateNode(self, request, context):
        """Creates a new coordination node
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def AlterNode(self, request, context):
        """Modifies settings of a coordination node
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def DropNode(self, request, context):
        """Drops a coordination node
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def DescribeNode(self, request, context):
        """Describes a coordination node
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_CoordinationServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'Session': grpc.stream_stream_rpc_method_handler(
                    servicer.Session,
                    request_deserializer=protos_dot_ydb__coordination__pb2.SessionRequest.FromString,
                    response_serializer=protos_dot_ydb__coordination__pb2.SessionResponse.SerializeToString,
            ),
            'CreateNode': grpc.unary_unary_rpc_method_handler(
                    servicer.CreateNode,
                    request_deserializer=protos_dot_ydb__coordination__pb2.CreateNodeRequest.FromString,
                    response_serializer=protos_dot_ydb__coordination__pb2.CreateNodeResponse.SerializeToString,
            ),
            'AlterNode': grpc.unary_unary_rpc_method_handler(
                    servicer.AlterNode,
                    request_deserializer=protos_dot_ydb__coordination__pb2.AlterNodeRequest.FromString,
                    response_serializer=protos_dot_ydb__coordination__pb2.AlterNodeResponse.SerializeToString,
            ),
            'DropNode': grpc.unary_unary_rpc_method_handler(
                    servicer.DropNode,
                    request_deserializer=protos_dot_ydb__coordination__pb2.DropNodeRequest.FromString,
                    response_serializer=protos_dot_ydb__coordination__pb2.DropNodeResponse.SerializeToString,
            ),
            'DescribeNode': grpc.unary_unary_rpc_method_handler(
                    servicer.DescribeNode,
                    request_deserializer=protos_dot_ydb__coordination__pb2.DescribeNodeRequest.FromString,
                    response_serializer=protos_dot_ydb__coordination__pb2.DescribeNodeResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'Ydb.Coordination.V1.CoordinationService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


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

    @staticmethod
    def Session(request_iterator,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.stream_stream(request_iterator, target, '/Ydb.Coordination.V1.CoordinationService/Session',
            protos_dot_ydb__coordination__pb2.SessionRequest.SerializeToString,
            protos_dot_ydb__coordination__pb2.SessionResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def CreateNode(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, '/Ydb.Coordination.V1.CoordinationService/CreateNode',
            protos_dot_ydb__coordination__pb2.CreateNodeRequest.SerializeToString,
            protos_dot_ydb__coordination__pb2.CreateNodeResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def AlterNode(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, '/Ydb.Coordination.V1.CoordinationService/AlterNode',
            protos_dot_ydb__coordination__pb2.AlterNodeRequest.SerializeToString,
            protos_dot_ydb__coordination__pb2.AlterNodeResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def DropNode(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, '/Ydb.Coordination.V1.CoordinationService/DropNode',
            protos_dot_ydb__coordination__pb2.DropNodeRequest.SerializeToString,
            protos_dot_ydb__coordination__pb2.DropNodeResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def DescribeNode(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, '/Ydb.Coordination.V1.CoordinationService/DescribeNode',
            protos_dot_ydb__coordination__pb2.DescribeNodeRequest.SerializeToString,
            protos_dot_ydb__coordination__pb2.DescribeNodeResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
