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

from . import aioshadowsocks_pb2 as aioshadowsocks__pb2


class ssStub(object):
    """service"""

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

        Args:
            channel: A grpc.Channel.
        """
        self.CreateUser = channel.unary_unary(
            "/aioshadowsocks.ss/CreateUser",
            request_serializer=aioshadowsocks__pb2.UserReq.SerializeToString,
            response_deserializer=aioshadowsocks__pb2.User.FromString,
        )
        self.UpdateUser = channel.unary_unary(
            "/aioshadowsocks.ss/UpdateUser",
            request_serializer=aioshadowsocks__pb2.UserReq.SerializeToString,
            response_deserializer=aioshadowsocks__pb2.User.FromString,
        )
        self.GetUser = channel.unary_unary(
            "/aioshadowsocks.ss/GetUser",
            request_serializer=aioshadowsocks__pb2.UserIdReq.SerializeToString,
            response_deserializer=aioshadowsocks__pb2.User.FromString,
        )
        self.DeleteUser = channel.unary_unary(
            "/aioshadowsocks.ss/DeleteUser",
            request_serializer=aioshadowsocks__pb2.UserIdReq.SerializeToString,
            response_deserializer=aioshadowsocks__pb2.Empty.FromString,
        )
        self.ListUser = channel.unary_unary(
            "/aioshadowsocks.ss/ListUser",
            request_serializer=aioshadowsocks__pb2.UserReq.SerializeToString,
            response_deserializer=aioshadowsocks__pb2.UserList.FromString,
        )
        self.HealthCheck = channel.unary_stream(
            "/aioshadowsocks.ss/HealthCheck",
            request_serializer=aioshadowsocks__pb2.HealthCheckReq.SerializeToString,
            response_deserializer=aioshadowsocks__pb2.HealthCheckRes.FromString,
        )
        self.FindAccessUser = channel.unary_unary(
            "/aioshadowsocks.ss/FindAccessUser",
            request_serializer=aioshadowsocks__pb2.FindAccessUserReq.SerializeToString,
            response_deserializer=aioshadowsocks__pb2.User.FromString,
        )
        self.DecryptData = channel.unary_unary(
            "/aioshadowsocks.ss/DecryptData",
            request_serializer=aioshadowsocks__pb2.DecryptDataReq.SerializeToString,
            response_deserializer=aioshadowsocks__pb2.DecryptDataRes.FromString,
        )


class ssServicer(object):
    """service"""

    def CreateUser(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 UpdateUser(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 GetUser(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 DeleteUser(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 ListUser(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 HealthCheck(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 FindAccessUser(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 DecryptData(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 add_ssServicer_to_server(servicer, server):
    rpc_method_handlers = {
        "CreateUser": grpc.unary_unary_rpc_method_handler(
            servicer.CreateUser,
            request_deserializer=aioshadowsocks__pb2.UserReq.FromString,
            response_serializer=aioshadowsocks__pb2.User.SerializeToString,
        ),
        "UpdateUser": grpc.unary_unary_rpc_method_handler(
            servicer.UpdateUser,
            request_deserializer=aioshadowsocks__pb2.UserReq.FromString,
            response_serializer=aioshadowsocks__pb2.User.SerializeToString,
        ),
        "GetUser": grpc.unary_unary_rpc_method_handler(
            servicer.GetUser,
            request_deserializer=aioshadowsocks__pb2.UserIdReq.FromString,
            response_serializer=aioshadowsocks__pb2.User.SerializeToString,
        ),
        "DeleteUser": grpc.unary_unary_rpc_method_handler(
            servicer.DeleteUser,
            request_deserializer=aioshadowsocks__pb2.UserIdReq.FromString,
            response_serializer=aioshadowsocks__pb2.Empty.SerializeToString,
        ),
        "ListUser": grpc.unary_unary_rpc_method_handler(
            servicer.ListUser,
            request_deserializer=aioshadowsocks__pb2.UserReq.FromString,
            response_serializer=aioshadowsocks__pb2.UserList.SerializeToString,
        ),
        "HealthCheck": grpc.unary_stream_rpc_method_handler(
            servicer.HealthCheck,
            request_deserializer=aioshadowsocks__pb2.HealthCheckReq.FromString,
            response_serializer=aioshadowsocks__pb2.HealthCheckRes.SerializeToString,
        ),
        "FindAccessUser": grpc.unary_unary_rpc_method_handler(
            servicer.FindAccessUser,
            request_deserializer=aioshadowsocks__pb2.FindAccessUserReq.FromString,
            response_serializer=aioshadowsocks__pb2.User.SerializeToString,
        ),
        "DecryptData": grpc.unary_unary_rpc_method_handler(
            servicer.DecryptData,
            request_deserializer=aioshadowsocks__pb2.DecryptDataReq.FromString,
            response_serializer=aioshadowsocks__pb2.DecryptDataRes.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        "aioshadowsocks.ss", rpc_method_handlers
    )
    server.add_generic_rpc_handlers((generic_handler,))


# This class is part of an EXPERIMENTAL API.
class ss(object):
    """service"""

    @staticmethod
    def CreateUser(
        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,
            "/aioshadowsocks.ss/CreateUser",
            aioshadowsocks__pb2.UserReq.SerializeToString,
            aioshadowsocks__pb2.User.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def UpdateUser(
        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,
            "/aioshadowsocks.ss/UpdateUser",
            aioshadowsocks__pb2.UserReq.SerializeToString,
            aioshadowsocks__pb2.User.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def GetUser(
        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,
            "/aioshadowsocks.ss/GetUser",
            aioshadowsocks__pb2.UserIdReq.SerializeToString,
            aioshadowsocks__pb2.User.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def DeleteUser(
        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,
            "/aioshadowsocks.ss/DeleteUser",
            aioshadowsocks__pb2.UserIdReq.SerializeToString,
            aioshadowsocks__pb2.Empty.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def ListUser(
        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,
            "/aioshadowsocks.ss/ListUser",
            aioshadowsocks__pb2.UserReq.SerializeToString,
            aioshadowsocks__pb2.UserList.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def HealthCheck(
        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,
            "/aioshadowsocks.ss/HealthCheck",
            aioshadowsocks__pb2.HealthCheckReq.SerializeToString,
            aioshadowsocks__pb2.HealthCheckRes.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def FindAccessUser(
        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,
            "/aioshadowsocks.ss/FindAccessUser",
            aioshadowsocks__pb2.FindAccessUserReq.SerializeToString,
            aioshadowsocks__pb2.User.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def DecryptData(
        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,
            "/aioshadowsocks.ss/DecryptData",
            aioshadowsocks__pb2.DecryptDataReq.SerializeToString,
            aioshadowsocks__pb2.DecryptDataRes.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )
