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

from yandex.cloud.serverless.apigateway.websocket.v1 import connection_pb2 as yandex_dot_cloud_dot_serverless_dot_apigateway_dot_websocket_dot_v1_dot_connection__pb2
from yandex.cloud.serverless.apigateway.websocket.v1 import connection_service_pb2 as yandex_dot_cloud_dot_serverless_dot_apigateway_dot_websocket_dot_v1_dot_connection__service__pb2


class ConnectionServiceStub(object):
    """A set of methods for managing API Gateway WebSocket connections.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.Get = channel.unary_unary(
                '/yandex.cloud.serverless.apigateway.websocket.v1.ConnectionService/Get',
                request_serializer=yandex_dot_cloud_dot_serverless_dot_apigateway_dot_websocket_dot_v1_dot_connection__service__pb2.GetConnectionRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_serverless_dot_apigateway_dot_websocket_dot_v1_dot_connection__pb2.Connection.FromString,
                )
        self.Send = channel.unary_unary(
                '/yandex.cloud.serverless.apigateway.websocket.v1.ConnectionService/Send',
                request_serializer=yandex_dot_cloud_dot_serverless_dot_apigateway_dot_websocket_dot_v1_dot_connection__service__pb2.SendToConnectionRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_serverless_dot_apigateway_dot_websocket_dot_v1_dot_connection__service__pb2.SendToConnectionResponse.FromString,
                )
        self.Disconnect = channel.unary_unary(
                '/yandex.cloud.serverless.apigateway.websocket.v1.ConnectionService/Disconnect',
                request_serializer=yandex_dot_cloud_dot_serverless_dot_apigateway_dot_websocket_dot_v1_dot_connection__service__pb2.DisconnectRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_serverless_dot_apigateway_dot_websocket_dot_v1_dot_connection__service__pb2.DisconnectResponse.FromString,
                )


class ConnectionServiceServicer(object):
    """A set of methods for managing API Gateway WebSocket connections.
    """

    def Get(self, request, context):
        """Returns the specified connection info.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Send(self, request, context):
        """Sends data to the specified connection.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Disconnect(self, request, context):
        """Disconnects the specified connection.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_ConnectionServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'Get': grpc.unary_unary_rpc_method_handler(
                    servicer.Get,
                    request_deserializer=yandex_dot_cloud_dot_serverless_dot_apigateway_dot_websocket_dot_v1_dot_connection__service__pb2.GetConnectionRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_serverless_dot_apigateway_dot_websocket_dot_v1_dot_connection__pb2.Connection.SerializeToString,
            ),
            'Send': grpc.unary_unary_rpc_method_handler(
                    servicer.Send,
                    request_deserializer=yandex_dot_cloud_dot_serverless_dot_apigateway_dot_websocket_dot_v1_dot_connection__service__pb2.SendToConnectionRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_serverless_dot_apigateway_dot_websocket_dot_v1_dot_connection__service__pb2.SendToConnectionResponse.SerializeToString,
            ),
            'Disconnect': grpc.unary_unary_rpc_method_handler(
                    servicer.Disconnect,
                    request_deserializer=yandex_dot_cloud_dot_serverless_dot_apigateway_dot_websocket_dot_v1_dot_connection__service__pb2.DisconnectRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_serverless_dot_apigateway_dot_websocket_dot_v1_dot_connection__service__pb2.DisconnectResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'yandex.cloud.serverless.apigateway.websocket.v1.ConnectionService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class ConnectionService(object):
    """A set of methods for managing API Gateway WebSocket connections.
    """

    @staticmethod
    def Get(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, '/yandex.cloud.serverless.apigateway.websocket.v1.ConnectionService/Get',
            yandex_dot_cloud_dot_serverless_dot_apigateway_dot_websocket_dot_v1_dot_connection__service__pb2.GetConnectionRequest.SerializeToString,
            yandex_dot_cloud_dot_serverless_dot_apigateway_dot_websocket_dot_v1_dot_connection__pb2.Connection.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Send(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, '/yandex.cloud.serverless.apigateway.websocket.v1.ConnectionService/Send',
            yandex_dot_cloud_dot_serverless_dot_apigateway_dot_websocket_dot_v1_dot_connection__service__pb2.SendToConnectionRequest.SerializeToString,
            yandex_dot_cloud_dot_serverless_dot_apigateway_dot_websocket_dot_v1_dot_connection__service__pb2.SendToConnectionResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Disconnect(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, '/yandex.cloud.serverless.apigateway.websocket.v1.ConnectionService/Disconnect',
            yandex_dot_cloud_dot_serverless_dot_apigateway_dot_websocket_dot_v1_dot_connection__service__pb2.DisconnectRequest.SerializeToString,
            yandex_dot_cloud_dot_serverless_dot_apigateway_dot_websocket_dot_v1_dot_connection__service__pb2.DisconnectResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
