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

from terrascope_api.models import user_pb2 as user__pb2


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.login = channel.unary_unary(
                '/oi.papi.UserApi/login',
                request_serializer=user__pb2.LoginRequest.SerializeToString,
                response_deserializer=user__pb2.LoginResponse.FromString,
                )
        self.change_password = channel.unary_unary(
                '/oi.papi.UserApi/change_password',
                request_serializer=user__pb2.UserChangePasswordRequest.SerializeToString,
                response_deserializer=user__pb2.UserChangePasswordResponse.FromString,
                )
        self.create = channel.unary_unary(
                '/oi.papi.UserApi/create',
                request_serializer=user__pb2.UserCreateRequest.SerializeToString,
                response_deserializer=user__pb2.UserCreateResponse.FromString,
                )
        self.get = channel.unary_unary(
                '/oi.papi.UserApi/get',
                request_serializer=user__pb2.UserGetRequest.SerializeToString,
                response_deserializer=user__pb2.UserGetResponse.FromString,
                )
        self.list = channel.unary_unary(
                '/oi.papi.UserApi/list',
                request_serializer=user__pb2.UserListRequest.SerializeToString,
                response_deserializer=user__pb2.UserListResponse.FromString,
                )


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

    def login(self, request, context):
        """
        Login using user's email and password.
        The endpoint returns a JWT access token that is needed to use the API.
        Note: This endpoint does NOT require token authentication.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def change_password(self, request, context):
        """
        Change current User's password
        Note: This is an authenticated endpoint, but still requires old password to be sent.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def create(self, request, context):
        """
        Create a new User in the system, assigned to the specified department.
        This functionality is only available for an admin user.
        This automatically creates an AOICollection associated to this user.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def get(self, request, context):
        """
        Returns the details of the specified User. If no User is given, returns details for the requesting User.
        The specified User must belong to the same UserCollection as the requesting User, otherwise an error is thrown.
        The user_id is a uuid and is actually the folder ID, so its a subject ID. Access limitations apply.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def list(self, request, context):
        """
        List users. Access limitations apply.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_UserApiServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'login': grpc.unary_unary_rpc_method_handler(
                    servicer.login,
                    request_deserializer=user__pb2.LoginRequest.FromString,
                    response_serializer=user__pb2.LoginResponse.SerializeToString,
            ),
            'change_password': grpc.unary_unary_rpc_method_handler(
                    servicer.change_password,
                    request_deserializer=user__pb2.UserChangePasswordRequest.FromString,
                    response_serializer=user__pb2.UserChangePasswordResponse.SerializeToString,
            ),
            'create': grpc.unary_unary_rpc_method_handler(
                    servicer.create,
                    request_deserializer=user__pb2.UserCreateRequest.FromString,
                    response_serializer=user__pb2.UserCreateResponse.SerializeToString,
            ),
            'get': grpc.unary_unary_rpc_method_handler(
                    servicer.get,
                    request_deserializer=user__pb2.UserGetRequest.FromString,
                    response_serializer=user__pb2.UserGetResponse.SerializeToString,
            ),
            'list': grpc.unary_unary_rpc_method_handler(
                    servicer.list,
                    request_deserializer=user__pb2.UserListRequest.FromString,
                    response_serializer=user__pb2.UserListResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'oi.papi.UserApi', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


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

    @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, '/oi.papi.UserApi/login',
            user__pb2.LoginRequest.SerializeToString,
            user__pb2.LoginResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def change_password(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, '/oi.papi.UserApi/change_password',
            user__pb2.UserChangePasswordRequest.SerializeToString,
            user__pb2.UserChangePasswordResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def create(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, '/oi.papi.UserApi/create',
            user__pb2.UserCreateRequest.SerializeToString,
            user__pb2.UserCreateResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @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, '/oi.papi.UserApi/get',
            user__pb2.UserGetRequest.SerializeToString,
            user__pb2.UserGetResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def list(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, '/oi.papi.UserApi/list',
            user__pb2.UserListRequest.SerializeToString,
            user__pb2.UserListResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
