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

from . import auth_pb2 as auth__pb2
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.SignupFlow = channel.unary_unary(
                '/org.couchers.auth.Auth/SignupFlow',
                request_serializer=auth__pb2.SignupFlowReq.SerializeToString,
                response_deserializer=auth__pb2.SignupFlowRes.FromString,
                )
        self.UsernameValid = channel.unary_unary(
                '/org.couchers.auth.Auth/UsernameValid',
                request_serializer=auth__pb2.UsernameValidReq.SerializeToString,
                response_deserializer=auth__pb2.UsernameValidRes.FromString,
                )
        self.Authenticate = channel.unary_unary(
                '/org.couchers.auth.Auth/Authenticate',
                request_serializer=auth__pb2.AuthReq.SerializeToString,
                response_deserializer=auth__pb2.AuthRes.FromString,
                )
        self.GetAuthState = channel.unary_unary(
                '/org.couchers.auth.Auth/GetAuthState',
                request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
                response_deserializer=auth__pb2.GetAuthStateRes.FromString,
                )
        self.Deauthenticate = channel.unary_unary(
                '/org.couchers.auth.Auth/Deauthenticate',
                request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                )
        self.ResetPassword = channel.unary_unary(
                '/org.couchers.auth.Auth/ResetPassword',
                request_serializer=auth__pb2.ResetPasswordReq.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                )
        self.CompletePasswordResetV2 = channel.unary_unary(
                '/org.couchers.auth.Auth/CompletePasswordResetV2',
                request_serializer=auth__pb2.CompletePasswordResetV2Req.SerializeToString,
                response_deserializer=auth__pb2.AuthRes.FromString,
                )
        self.ConfirmChangeEmailV2 = channel.unary_unary(
                '/org.couchers.auth.Auth/ConfirmChangeEmailV2',
                request_serializer=auth__pb2.ConfirmChangeEmailV2Req.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                )
        self.ConfirmDeleteAccount = channel.unary_unary(
                '/org.couchers.auth.Auth/ConfirmDeleteAccount',
                request_serializer=auth__pb2.ConfirmDeleteAccountReq.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                )
        self.RecoverAccount = channel.unary_unary(
                '/org.couchers.auth.Auth/RecoverAccount',
                request_serializer=auth__pb2.RecoverAccountReq.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                )
        self.Unsubscribe = channel.unary_unary(
                '/org.couchers.auth.Auth/Unsubscribe',
                request_serializer=auth__pb2.UnsubscribeReq.SerializeToString,
                response_deserializer=auth__pb2.UnsubscribeRes.FromString,
                )
        self.AntiBot = channel.unary_unary(
                '/org.couchers.auth.Auth/AntiBot',
                request_serializer=auth__pb2.AntiBotReq.SerializeToString,
                response_deserializer=auth__pb2.AntiBotRes.FromString,
                )
        self.AntiBotPolicy = channel.unary_unary(
                '/org.couchers.auth.Auth/AntiBotPolicy',
                request_serializer=auth__pb2.AntiBotPolicyReq.SerializeToString,
                response_deserializer=auth__pb2.AntiBotPolicyRes.FromString,
                )
        self.GetInviteCodeInfo = channel.unary_unary(
                '/org.couchers.auth.Auth/GetInviteCodeInfo',
                request_serializer=auth__pb2.GetInviteCodeInfoReq.SerializeToString,
                response_deserializer=auth__pb2.GetInviteCodeInfoRes.FromString,
                )


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

    def SignupFlow(self, request, context):
        """
        Authentication API

        This API facilitates authentication actions: signup and signin. Users need to use this before logging in, so you don't
        need to be authorized to use it.

        The signup flow is as follows:
        A user enters their email and submits a form, which fires off a Signup call
        Signup validates the email isn't in the database yet, creates a signup_token, and emails it to the email address
        User clicks on the signup link, which brings them onto the signup completion form
        When this form loads, the app queries SignupTokenInfo for the email address associated to that login token to
        display in the UI
        User chooses a username (possibly querying UsernameValid to check possibly usernames) and fills in other basic
        information
        User submits the signup completion form, which validates this input, creates the user and logs them in, returns a
        session token (signup token is invalidated)

        The login flow is as follows:
        User types in username and password and the frontend calls Authenticate

        Signup tokens expire after some time, and once used cannot be reused.

        There can be multiple signup requests simultaneously with the same email address. Email address uniqueness is checked
        once when creating the signup request, and again when creating the user.

        The signup flow (from point of view of backend) is as follows:
        * There are three parts to the signup: Basic, Account, and Feedback
        * Each part needs to be filled in, and the user's email needs to be confirmed before the user can continue to the
        app
        * The Basic part must be filled in in the first request, after which the backend returns a flow_token
        * The frontend may do the signup incrementally by sending the other parts with the same flow_token
        * You can only fill in each part once
        * You can get info on the flow_token by sending an empty request with just the flow_token
        * Once the flow completes, the user is logged in and the signup flow is destroyed
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def UsernameValid(self, request, context):
        """Check whether the username is valid and available
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Authenticate(self, request, context):
        """Log in with username + password
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetAuthState(self, request, context):
        """Get info on current authentication state
        we need this because the web client does not have access to the non-JS cookie that contains this info, so it
        needs to be validated against the backend
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Deauthenticate(self, request, context):
        """Invalidate a session, deauthing a user
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ResetPassword(self, request, context):
        """Sends a forgot password email to the given user if the user exists, returns no output (so you can't go around
        guessing email addresses)
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CompletePasswordResetV2(self, request, context):
        """Triggered when the user goes to the link sent in the forgot password email, and logs the user in

        Actually changes the user's password
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ConfirmChangeEmailV2(self, request, context):
        """Triggered when the user goes to the link sent in the either email_changed_confirmation_*_email
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ConfirmDeleteAccount(self, request, context):
        """Confirms deletion of a user using a token
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def RecoverAccount(self, request, context):
        """Recovers a recently deleted account
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Unsubscribe(self, request, context):
        """Handle an unsubscribe action from an email
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def AntiBot(self, request, context):
        """Send antibot info asynchronously
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def AntiBotPolicy(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 GetInviteCodeInfo(self, request, context):
        """Returns basic profile of the invite code creator: name, username, avatar_url
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_AuthServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'SignupFlow': grpc.unary_unary_rpc_method_handler(
                    servicer.SignupFlow,
                    request_deserializer=auth__pb2.SignupFlowReq.FromString,
                    response_serializer=auth__pb2.SignupFlowRes.SerializeToString,
            ),
            'UsernameValid': grpc.unary_unary_rpc_method_handler(
                    servicer.UsernameValid,
                    request_deserializer=auth__pb2.UsernameValidReq.FromString,
                    response_serializer=auth__pb2.UsernameValidRes.SerializeToString,
            ),
            'Authenticate': grpc.unary_unary_rpc_method_handler(
                    servicer.Authenticate,
                    request_deserializer=auth__pb2.AuthReq.FromString,
                    response_serializer=auth__pb2.AuthRes.SerializeToString,
            ),
            'GetAuthState': grpc.unary_unary_rpc_method_handler(
                    servicer.GetAuthState,
                    request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                    response_serializer=auth__pb2.GetAuthStateRes.SerializeToString,
            ),
            'Deauthenticate': grpc.unary_unary_rpc_method_handler(
                    servicer.Deauthenticate,
                    request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
            'ResetPassword': grpc.unary_unary_rpc_method_handler(
                    servicer.ResetPassword,
                    request_deserializer=auth__pb2.ResetPasswordReq.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
            'CompletePasswordResetV2': grpc.unary_unary_rpc_method_handler(
                    servicer.CompletePasswordResetV2,
                    request_deserializer=auth__pb2.CompletePasswordResetV2Req.FromString,
                    response_serializer=auth__pb2.AuthRes.SerializeToString,
            ),
            'ConfirmChangeEmailV2': grpc.unary_unary_rpc_method_handler(
                    servicer.ConfirmChangeEmailV2,
                    request_deserializer=auth__pb2.ConfirmChangeEmailV2Req.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
            'ConfirmDeleteAccount': grpc.unary_unary_rpc_method_handler(
                    servicer.ConfirmDeleteAccount,
                    request_deserializer=auth__pb2.ConfirmDeleteAccountReq.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
            'RecoverAccount': grpc.unary_unary_rpc_method_handler(
                    servicer.RecoverAccount,
                    request_deserializer=auth__pb2.RecoverAccountReq.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
            'Unsubscribe': grpc.unary_unary_rpc_method_handler(
                    servicer.Unsubscribe,
                    request_deserializer=auth__pb2.UnsubscribeReq.FromString,
                    response_serializer=auth__pb2.UnsubscribeRes.SerializeToString,
            ),
            'AntiBot': grpc.unary_unary_rpc_method_handler(
                    servicer.AntiBot,
                    request_deserializer=auth__pb2.AntiBotReq.FromString,
                    response_serializer=auth__pb2.AntiBotRes.SerializeToString,
            ),
            'AntiBotPolicy': grpc.unary_unary_rpc_method_handler(
                    servicer.AntiBotPolicy,
                    request_deserializer=auth__pb2.AntiBotPolicyReq.FromString,
                    response_serializer=auth__pb2.AntiBotPolicyRes.SerializeToString,
            ),
            'GetInviteCodeInfo': grpc.unary_unary_rpc_method_handler(
                    servicer.GetInviteCodeInfo,
                    request_deserializer=auth__pb2.GetInviteCodeInfoReq.FromString,
                    response_serializer=auth__pb2.GetInviteCodeInfoRes.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'org.couchers.auth.Auth', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


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

    @staticmethod
    def SignupFlow(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, '/org.couchers.auth.Auth/SignupFlow',
            auth__pb2.SignupFlowReq.SerializeToString,
            auth__pb2.SignupFlowRes.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def UsernameValid(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, '/org.couchers.auth.Auth/UsernameValid',
            auth__pb2.UsernameValidReq.SerializeToString,
            auth__pb2.UsernameValidRes.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Authenticate(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, '/org.couchers.auth.Auth/Authenticate',
            auth__pb2.AuthReq.SerializeToString,
            auth__pb2.AuthRes.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetAuthState(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, '/org.couchers.auth.Auth/GetAuthState',
            google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            auth__pb2.GetAuthStateRes.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Deauthenticate(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, '/org.couchers.auth.Auth/Deauthenticate',
            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 ResetPassword(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, '/org.couchers.auth.Auth/ResetPassword',
            auth__pb2.ResetPasswordReq.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def CompletePasswordResetV2(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, '/org.couchers.auth.Auth/CompletePasswordResetV2',
            auth__pb2.CompletePasswordResetV2Req.SerializeToString,
            auth__pb2.AuthRes.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def ConfirmChangeEmailV2(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, '/org.couchers.auth.Auth/ConfirmChangeEmailV2',
            auth__pb2.ConfirmChangeEmailV2Req.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def ConfirmDeleteAccount(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, '/org.couchers.auth.Auth/ConfirmDeleteAccount',
            auth__pb2.ConfirmDeleteAccountReq.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def RecoverAccount(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, '/org.couchers.auth.Auth/RecoverAccount',
            auth__pb2.RecoverAccountReq.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Unsubscribe(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, '/org.couchers.auth.Auth/Unsubscribe',
            auth__pb2.UnsubscribeReq.SerializeToString,
            auth__pb2.UnsubscribeRes.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def AntiBot(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, '/org.couchers.auth.Auth/AntiBot',
            auth__pb2.AntiBotReq.SerializeToString,
            auth__pb2.AntiBotRes.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def AntiBotPolicy(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, '/org.couchers.auth.Auth/AntiBotPolicy',
            auth__pb2.AntiBotPolicyReq.SerializeToString,
            auth__pb2.AntiBotPolicyRes.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetInviteCodeInfo(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, '/org.couchers.auth.Auth/GetInviteCodeInfo',
            auth__pb2.GetInviteCodeInfoReq.SerializeToString,
            auth__pb2.GetInviteCodeInfoRes.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
