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

from paperpilot_common.protobuf.user import auth_pb2 as paperpilot__common_dot_protobuf_dot_user_dot_auth__pb2
from paperpilot_common.protobuf.user import user_pb2 as paperpilot__common_dot_protobuf_dot_user_dot_user__pb2


class AuthPublicServiceStub(object):
    """认证公开接口（可匿名访问）"""

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

        Args:
            channel: A grpc.Channel.
        """
        self.Login = channel.unary_unary(
            "/auth.AuthPublicService/Login",
            request_serializer=paperpilot__common_dot_protobuf_dot_user_dot_auth__pb2.LoginRequest.SerializeToString,
            response_deserializer=paperpilot__common_dot_protobuf_dot_user_dot_auth__pb2.LoginResponse.FromString,
        )
        self.Refresh = channel.unary_unary(
            "/auth.AuthPublicService/Refresh",
            request_serializer=paperpilot__common_dot_protobuf_dot_user_dot_auth__pb2.RefreshTokenRequest.SerializeToString,
            response_deserializer=paperpilot__common_dot_protobuf_dot_user_dot_auth__pb2.RefreshTokenResponse.FromString,
        )
        self.Logout = channel.unary_unary(
            "/auth.AuthPublicService/Logout",
            request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
        )
        self.Register = channel.unary_unary(
            "/auth.AuthPublicService/Register",
            request_serializer=paperpilot__common_dot_protobuf_dot_user_dot_user__pb2.CreateUserRequest.SerializeToString,
            response_deserializer=paperpilot__common_dot_protobuf_dot_user_dot_auth__pb2.LoginResponse.FromString,
        )
        self.SendSmsCode = channel.unary_unary(
            "/auth.AuthPublicService/SendSmsCode",
            request_serializer=paperpilot__common_dot_protobuf_dot_user_dot_auth__pb2.SendSmsCodeRequest.SerializeToString,
            response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
        )
        self.CountPhone = channel.unary_unary(
            "/auth.AuthPublicService/CountPhone",
            request_serializer=paperpilot__common_dot_protobuf_dot_user_dot_auth__pb2.CountPhoneRequest.SerializeToString,
            response_deserializer=paperpilot__common_dot_protobuf_dot_user_dot_auth__pb2.CountResponse.FromString,
        )
        self.CountUsername = channel.unary_unary(
            "/auth.AuthPublicService/CountUsername",
            request_serializer=paperpilot__common_dot_protobuf_dot_user_dot_auth__pb2.CountUsernameRequest.SerializeToString,
            response_deserializer=paperpilot__common_dot_protobuf_dot_user_dot_auth__pb2.CountResponse.FromString,
        )


class AuthPublicServiceServicer(object):
    """认证公开接口（可匿名访问）"""

    def Login(self, request, context):
        """登录"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def Refresh(self, request, context):
        """刷新token"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def Logout(self, request, context):
        """登出"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def Register(self, request, context):
        """注册"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def SendSmsCode(self, request, context):
        """发送短信验证码"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def CountPhone(self, request, context):
        """获取手机号数量"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def CountUsername(self, request, context):
        """获取用户名数量"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")


def add_AuthPublicServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
        "Login": grpc.unary_unary_rpc_method_handler(
            servicer.Login,
            request_deserializer=paperpilot__common_dot_protobuf_dot_user_dot_auth__pb2.LoginRequest.FromString,
            response_serializer=paperpilot__common_dot_protobuf_dot_user_dot_auth__pb2.LoginResponse.SerializeToString,
        ),
        "Refresh": grpc.unary_unary_rpc_method_handler(
            servicer.Refresh,
            request_deserializer=paperpilot__common_dot_protobuf_dot_user_dot_auth__pb2.RefreshTokenRequest.FromString,
            response_serializer=paperpilot__common_dot_protobuf_dot_user_dot_auth__pb2.RefreshTokenResponse.SerializeToString,
        ),
        "Logout": grpc.unary_unary_rpc_method_handler(
            servicer.Logout,
            request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
        ),
        "Register": grpc.unary_unary_rpc_method_handler(
            servicer.Register,
            request_deserializer=paperpilot__common_dot_protobuf_dot_user_dot_user__pb2.CreateUserRequest.FromString,
            response_serializer=paperpilot__common_dot_protobuf_dot_user_dot_auth__pb2.LoginResponse.SerializeToString,
        ),
        "SendSmsCode": grpc.unary_unary_rpc_method_handler(
            servicer.SendSmsCode,
            request_deserializer=paperpilot__common_dot_protobuf_dot_user_dot_auth__pb2.SendSmsCodeRequest.FromString,
            response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
        ),
        "CountPhone": grpc.unary_unary_rpc_method_handler(
            servicer.CountPhone,
            request_deserializer=paperpilot__common_dot_protobuf_dot_user_dot_auth__pb2.CountPhoneRequest.FromString,
            response_serializer=paperpilot__common_dot_protobuf_dot_user_dot_auth__pb2.CountResponse.SerializeToString,
        ),
        "CountUsername": grpc.unary_unary_rpc_method_handler(
            servicer.CountUsername,
            request_deserializer=paperpilot__common_dot_protobuf_dot_user_dot_auth__pb2.CountUsernameRequest.FromString,
            response_serializer=paperpilot__common_dot_protobuf_dot_user_dot_auth__pb2.CountResponse.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler("auth.AuthPublicService", rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


# This class is part of an EXPERIMENTAL API.
class AuthPublicService(object):
    """认证公开接口（可匿名访问）"""

    @staticmethod
    def Login(
        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,
            "/auth.AuthPublicService/Login",
            paperpilot__common_dot_protobuf_dot_user_dot_auth__pb2.LoginRequest.SerializeToString,
            paperpilot__common_dot_protobuf_dot_user_dot_auth__pb2.LoginResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def Refresh(
        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,
            "/auth.AuthPublicService/Refresh",
            paperpilot__common_dot_protobuf_dot_user_dot_auth__pb2.RefreshTokenRequest.SerializeToString,
            paperpilot__common_dot_protobuf_dot_user_dot_auth__pb2.RefreshTokenResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def Logout(
        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,
            "/auth.AuthPublicService/Logout",
            google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def Register(
        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,
            "/auth.AuthPublicService/Register",
            paperpilot__common_dot_protobuf_dot_user_dot_user__pb2.CreateUserRequest.SerializeToString,
            paperpilot__common_dot_protobuf_dot_user_dot_auth__pb2.LoginResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def SendSmsCode(
        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,
            "/auth.AuthPublicService/SendSmsCode",
            paperpilot__common_dot_protobuf_dot_user_dot_auth__pb2.SendSmsCodeRequest.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def CountPhone(
        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,
            "/auth.AuthPublicService/CountPhone",
            paperpilot__common_dot_protobuf_dot_user_dot_auth__pb2.CountPhoneRequest.SerializeToString,
            paperpilot__common_dot_protobuf_dot_user_dot_auth__pb2.CountResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def CountUsername(
        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,
            "/auth.AuthPublicService/CountUsername",
            paperpilot__common_dot_protobuf_dot_user_dot_auth__pb2.CountUsernameRequest.SerializeToString,
            paperpilot__common_dot_protobuf_dot_user_dot_auth__pb2.CountResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )
