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

from prodvana.proto.prodvana.auth import auth_manager_pb2 as prodvana_dot_auth_dot_auth__manager__pb2


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.GetAuthToken = channel.unary_unary(
                '/prodvana.auth.AuthManager/GetAuthToken',
                request_serializer=prodvana_dot_auth_dot_auth__manager__pb2.GetTokenRequest.SerializeToString,
                response_deserializer=prodvana_dot_auth_dot_auth__manager__pb2.GetAuthTokenResp.FromString,
                )
        self.GetAuthUrl = channel.unary_unary(
                '/prodvana.auth.AuthManager/GetAuthUrl',
                request_serializer=prodvana_dot_auth_dot_auth__manager__pb2.GetAuthUrlRequest.SerializeToString,
                response_deserializer=prodvana_dot_auth_dot_auth__manager__pb2.GetAuthUrlResponse.FromString,
                )
        self.RefreshToken = channel.unary_unary(
                '/prodvana.auth.AuthManager/RefreshToken',
                request_serializer=prodvana_dot_auth_dot_auth__manager__pb2.RefreshTokenReq.SerializeToString,
                response_deserializer=prodvana_dot_auth_dot_auth__manager__pb2.GetAuthTokenResp.FromString,
                )
        self.CliAuth = channel.unary_stream(
                '/prodvana.auth.AuthManager/CliAuth',
                request_serializer=prodvana_dot_auth_dot_auth__manager__pb2.CliAuthReq.SerializeToString,
                response_deserializer=prodvana_dot_auth_dot_auth__manager__pb2.CliAuthResp.FromString,
                )


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

    def GetAuthToken(self, request, context):
        """web auth flow
        TODO(naphat) we should make this only available to our UI app
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetAuthUrl(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 RefreshToken(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 CliAuth(self, request, context):
        """cli auth flow
        This returns a streaming response with exactly two items:
        1. Immediately, a UserPrmopt will be returned which should then be conveyed to the user
        2. Once user authenticates via a browser, a Token will be returned
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_AuthManagerServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'GetAuthToken': grpc.unary_unary_rpc_method_handler(
                    servicer.GetAuthToken,
                    request_deserializer=prodvana_dot_auth_dot_auth__manager__pb2.GetTokenRequest.FromString,
                    response_serializer=prodvana_dot_auth_dot_auth__manager__pb2.GetAuthTokenResp.SerializeToString,
            ),
            'GetAuthUrl': grpc.unary_unary_rpc_method_handler(
                    servicer.GetAuthUrl,
                    request_deserializer=prodvana_dot_auth_dot_auth__manager__pb2.GetAuthUrlRequest.FromString,
                    response_serializer=prodvana_dot_auth_dot_auth__manager__pb2.GetAuthUrlResponse.SerializeToString,
            ),
            'RefreshToken': grpc.unary_unary_rpc_method_handler(
                    servicer.RefreshToken,
                    request_deserializer=prodvana_dot_auth_dot_auth__manager__pb2.RefreshTokenReq.FromString,
                    response_serializer=prodvana_dot_auth_dot_auth__manager__pb2.GetAuthTokenResp.SerializeToString,
            ),
            'CliAuth': grpc.unary_stream_rpc_method_handler(
                    servicer.CliAuth,
                    request_deserializer=prodvana_dot_auth_dot_auth__manager__pb2.CliAuthReq.FromString,
                    response_serializer=prodvana_dot_auth_dot_auth__manager__pb2.CliAuthResp.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'prodvana.auth.AuthManager', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


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

    @staticmethod
    def GetAuthToken(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, '/prodvana.auth.AuthManager/GetAuthToken',
            prodvana_dot_auth_dot_auth__manager__pb2.GetTokenRequest.SerializeToString,
            prodvana_dot_auth_dot_auth__manager__pb2.GetAuthTokenResp.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetAuthUrl(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, '/prodvana.auth.AuthManager/GetAuthUrl',
            prodvana_dot_auth_dot_auth__manager__pb2.GetAuthUrlRequest.SerializeToString,
            prodvana_dot_auth_dot_auth__manager__pb2.GetAuthUrlResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def RefreshToken(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, '/prodvana.auth.AuthManager/RefreshToken',
            prodvana_dot_auth_dot_auth__manager__pb2.RefreshTokenReq.SerializeToString,
            prodvana_dot_auth_dot_auth__manager__pb2.GetAuthTokenResp.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def CliAuth(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, '/prodvana.auth.AuthManager/CliAuth',
            prodvana_dot_auth_dot_auth__manager__pb2.CliAuthReq.SerializeToString,
            prodvana_dot_auth_dot_auth__manager__pb2.CliAuthResp.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)


class AuthSessionManagerStub(object):
    """unlike AuthManager, AuthSessionManager is about the current authenticated session, i.e. it requires
    user to be authed already
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.Check = channel.unary_unary(
                '/prodvana.auth.AuthSessionManager/Check',
                request_serializer=prodvana_dot_auth_dot_auth__manager__pb2.Empty.SerializeToString,
                response_deserializer=prodvana_dot_auth_dot_auth__manager__pb2.Empty.FromString,
                )
        self.Logout = channel.unary_unary(
                '/prodvana.auth.AuthSessionManager/Logout',
                request_serializer=prodvana_dot_auth_dot_auth__manager__pb2.LogoutReq.SerializeToString,
                response_deserializer=prodvana_dot_auth_dot_auth__manager__pb2.LogoutResp.FromString,
                )


class AuthSessionManagerServicer(object):
    """unlike AuthManager, AuthSessionManager is about the current authenticated session, i.e. it requires
    user to be authed already
    """

    def Check(self, request, context):
        """check if user is authenticated and token is still valid
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Logout(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_AuthSessionManagerServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'Check': grpc.unary_unary_rpc_method_handler(
                    servicer.Check,
                    request_deserializer=prodvana_dot_auth_dot_auth__manager__pb2.Empty.FromString,
                    response_serializer=prodvana_dot_auth_dot_auth__manager__pb2.Empty.SerializeToString,
            ),
            'Logout': grpc.unary_unary_rpc_method_handler(
                    servicer.Logout,
                    request_deserializer=prodvana_dot_auth_dot_auth__manager__pb2.LogoutReq.FromString,
                    response_serializer=prodvana_dot_auth_dot_auth__manager__pb2.LogoutResp.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'prodvana.auth.AuthSessionManager', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class AuthSessionManager(object):
    """unlike AuthManager, AuthSessionManager is about the current authenticated session, i.e. it requires
    user to be authed already
    """

    @staticmethod
    def Check(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, '/prodvana.auth.AuthSessionManager/Check',
            prodvana_dot_auth_dot_auth__manager__pb2.Empty.SerializeToString,
            prodvana_dot_auth_dot_auth__manager__pb2.Empty.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, '/prodvana.auth.AuthSessionManager/Logout',
            prodvana_dot_auth_dot_auth__manager__pb2.LogoutReq.SerializeToString,
            prodvana_dot_auth_dot_auth__manager__pb2.LogoutResp.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.CreateOrgApiToken = channel.unary_unary(
                '/prodvana.auth.ApiTokenManager/CreateOrgApiToken',
                request_serializer=prodvana_dot_auth_dot_auth__manager__pb2.Empty.SerializeToString,
                response_deserializer=prodvana_dot_auth_dot_auth__manager__pb2.CreateOrgApiTokenResp.FromString,
                )
        self.CreateOrgApiToken2 = channel.unary_unary(
                '/prodvana.auth.ApiTokenManager/CreateOrgApiToken2',
                request_serializer=prodvana_dot_auth_dot_auth__manager__pb2.CreateOrgApiTokenReq.SerializeToString,
                response_deserializer=prodvana_dot_auth_dot_auth__manager__pb2.CreateOrgApiTokenResp.FromString,
                )
        self.DeleteOrgApiToken = channel.unary_unary(
                '/prodvana.auth.ApiTokenManager/DeleteOrgApiToken',
                request_serializer=prodvana_dot_auth_dot_auth__manager__pb2.DeleteOrgApiTokenReq.SerializeToString,
                response_deserializer=prodvana_dot_auth_dot_auth__manager__pb2.DeleteOrgApiTokenResp.FromString,
                )
        self.ListOrgApiTokens = channel.unary_unary(
                '/prodvana.auth.ApiTokenManager/ListOrgApiTokens',
                request_serializer=prodvana_dot_auth_dot_auth__manager__pb2.ListOrgApiTokensReq.SerializeToString,
                response_deserializer=prodvana_dot_auth_dot_auth__manager__pb2.ListOrgApiTokensResp.FromString,
                )


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

    def CreateOrgApiToken(self, request, context):
        """Create an api token tied to the organization. This api token is not tied to the user in anyway,
        e.g. if the user is deleted, the token will continue to have access to the organization.
        This token currently does not expire, so be very careful with storing them.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CreateOrgApiToken2(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 DeleteOrgApiToken(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 ListOrgApiTokens(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_ApiTokenManagerServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'CreateOrgApiToken': grpc.unary_unary_rpc_method_handler(
                    servicer.CreateOrgApiToken,
                    request_deserializer=prodvana_dot_auth_dot_auth__manager__pb2.Empty.FromString,
                    response_serializer=prodvana_dot_auth_dot_auth__manager__pb2.CreateOrgApiTokenResp.SerializeToString,
            ),
            'CreateOrgApiToken2': grpc.unary_unary_rpc_method_handler(
                    servicer.CreateOrgApiToken2,
                    request_deserializer=prodvana_dot_auth_dot_auth__manager__pb2.CreateOrgApiTokenReq.FromString,
                    response_serializer=prodvana_dot_auth_dot_auth__manager__pb2.CreateOrgApiTokenResp.SerializeToString,
            ),
            'DeleteOrgApiToken': grpc.unary_unary_rpc_method_handler(
                    servicer.DeleteOrgApiToken,
                    request_deserializer=prodvana_dot_auth_dot_auth__manager__pb2.DeleteOrgApiTokenReq.FromString,
                    response_serializer=prodvana_dot_auth_dot_auth__manager__pb2.DeleteOrgApiTokenResp.SerializeToString,
            ),
            'ListOrgApiTokens': grpc.unary_unary_rpc_method_handler(
                    servicer.ListOrgApiTokens,
                    request_deserializer=prodvana_dot_auth_dot_auth__manager__pb2.ListOrgApiTokensReq.FromString,
                    response_serializer=prodvana_dot_auth_dot_auth__manager__pb2.ListOrgApiTokensResp.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'prodvana.auth.ApiTokenManager', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


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

    @staticmethod
    def CreateOrgApiToken(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, '/prodvana.auth.ApiTokenManager/CreateOrgApiToken',
            prodvana_dot_auth_dot_auth__manager__pb2.Empty.SerializeToString,
            prodvana_dot_auth_dot_auth__manager__pb2.CreateOrgApiTokenResp.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def CreateOrgApiToken2(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, '/prodvana.auth.ApiTokenManager/CreateOrgApiToken2',
            prodvana_dot_auth_dot_auth__manager__pb2.CreateOrgApiTokenReq.SerializeToString,
            prodvana_dot_auth_dot_auth__manager__pb2.CreateOrgApiTokenResp.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def DeleteOrgApiToken(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, '/prodvana.auth.ApiTokenManager/DeleteOrgApiToken',
            prodvana_dot_auth_dot_auth__manager__pb2.DeleteOrgApiTokenReq.SerializeToString,
            prodvana_dot_auth_dot_auth__manager__pb2.DeleteOrgApiTokenResp.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def ListOrgApiTokens(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, '/prodvana.auth.ApiTokenManager/ListOrgApiTokens',
            prodvana_dot_auth_dot_auth__manager__pb2.ListOrgApiTokensReq.SerializeToString,
            prodvana_dot_auth_dot_auth__manager__pb2.ListOrgApiTokensResp.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
