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

from terrascope_api.models import user_pb2 as user__pb2

GRPC_GENERATED_VERSION = '1.68.1'
GRPC_VERSION = grpc.__version__
_version_not_supported = False

try:
    from grpc._utilities import first_version_is_lower
    _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
except ImportError:
    _version_not_supported = True

if _version_not_supported:
    raise RuntimeError(
        f'The grpc package installed is at version {GRPC_VERSION},'
        + f' but the generated code in user_pb2_grpc.py depends on'
        + f' grpcio>={GRPC_GENERATED_VERSION}.'
        + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
        + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
    )


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,
                _registered_method=True)
        self.change_password = channel.unary_unary(
                '/oi.papi.UserApi/change_password',
                request_serializer=user__pb2.UserChangePasswordRequest.SerializeToString,
                response_deserializer=user__pb2.UserChangePasswordResponse.FromString,
                _registered_method=True)
        self.generate_temp_password = channel.unary_unary(
                '/oi.papi.UserApi/generate_temp_password',
                request_serializer=user__pb2.UserGenerateTempPasswordRequest.SerializeToString,
                response_deserializer=user__pb2.UserGenerateTempPasswordResponse.FromString,
                _registered_method=True)
        self.create = channel.unary_unary(
                '/oi.papi.UserApi/create',
                request_serializer=user__pb2.UserCreateRequest.SerializeToString,
                response_deserializer=user__pb2.UserCreateResponse.FromString,
                _registered_method=True)
        self.get = channel.unary_unary(
                '/oi.papi.UserApi/get',
                request_serializer=user__pb2.UserGetRequest.SerializeToString,
                response_deserializer=user__pb2.UserGetResponse.FromString,
                _registered_method=True)
        self.update = channel.unary_unary(
                '/oi.papi.UserApi/update',
                request_serializer=user__pb2.UserUpdateRequest.SerializeToString,
                response_deserializer=user__pb2.UserUpdateResponse.FromString,
                _registered_method=True)
        self.delete = channel.unary_unary(
                '/oi.papi.UserApi/delete',
                request_serializer=user__pb2.UserDeleteRequest.SerializeToString,
                response_deserializer=user__pb2.UserDeleteResponse.FromString,
                _registered_method=True)
        self.list = channel.unary_unary(
                '/oi.papi.UserApi/list',
                request_serializer=user__pb2.UserListRequest.SerializeToString,
                response_deserializer=user__pb2.UserListResponse.FromString,
                _registered_method=True)
        self.get_properties = channel.unary_unary(
                '/oi.papi.UserApi/get_properties',
                request_serializer=user__pb2.UserPropertiesGetRequest.SerializeToString,
                response_deserializer=user__pb2.UserPropertiesGetResponse.FromString,
                _registered_method=True)
        self.update_properties = channel.unary_unary(
                '/oi.papi.UserApi/update_properties',
                request_serializer=user__pb2.UserPropertiesUpdateRequest.SerializeToString,
                response_deserializer=user__pb2.UserPropertiesUpdateResponse.FromString,
                _registered_method=True)
        self.get_public_key = channel.unary_unary(
                '/oi.papi.UserApi/get_public_key',
                request_serializer=user__pb2.UserPublicKeyRequest.SerializeToString,
                response_deserializer=user__pb2.UserPublicKeyResponse.FromString,
                _registered_method=True)


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 generate_temp_password(self, request, context):
        """
        Create a temporary password for User
        """
        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 update(self, request, context):
        """
        Updates the details of the specified User. If no User is given, returns details for the requesting User.
        user is identified by id(uuid) field, remaining fields contain information to set
        Access limitations apply.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def delete(self, request, context):
        """
        Delete the User specified by its id(UUID), which must be set. Requesting user cannot be deleted implicitly
        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 get_properties(self, request, context):
        """
        Returns properties for the requesting User.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def update_properties(self, request, context):
        """
        Updates properties for the requesting User.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def get_public_key(self, request, context):
        """
        Get public key for the requesting User.
        """
        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,
            ),
            'generate_temp_password': grpc.unary_unary_rpc_method_handler(
                    servicer.generate_temp_password,
                    request_deserializer=user__pb2.UserGenerateTempPasswordRequest.FromString,
                    response_serializer=user__pb2.UserGenerateTempPasswordResponse.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,
            ),
            'update': grpc.unary_unary_rpc_method_handler(
                    servicer.update,
                    request_deserializer=user__pb2.UserUpdateRequest.FromString,
                    response_serializer=user__pb2.UserUpdateResponse.SerializeToString,
            ),
            'delete': grpc.unary_unary_rpc_method_handler(
                    servicer.delete,
                    request_deserializer=user__pb2.UserDeleteRequest.FromString,
                    response_serializer=user__pb2.UserDeleteResponse.SerializeToString,
            ),
            'list': grpc.unary_unary_rpc_method_handler(
                    servicer.list,
                    request_deserializer=user__pb2.UserListRequest.FromString,
                    response_serializer=user__pb2.UserListResponse.SerializeToString,
            ),
            'get_properties': grpc.unary_unary_rpc_method_handler(
                    servicer.get_properties,
                    request_deserializer=user__pb2.UserPropertiesGetRequest.FromString,
                    response_serializer=user__pb2.UserPropertiesGetResponse.SerializeToString,
            ),
            'update_properties': grpc.unary_unary_rpc_method_handler(
                    servicer.update_properties,
                    request_deserializer=user__pb2.UserPropertiesUpdateRequest.FromString,
                    response_serializer=user__pb2.UserPropertiesUpdateResponse.SerializeToString,
            ),
            'get_public_key': grpc.unary_unary_rpc_method_handler(
                    servicer.get_public_key,
                    request_deserializer=user__pb2.UserPublicKeyRequest.FromString,
                    response_serializer=user__pb2.UserPublicKeyResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'oi.papi.UserApi', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('oi.papi.UserApi', rpc_method_handlers)


 # 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,
            _registered_method=True)

    @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,
            _registered_method=True)

    @staticmethod
    def generate_temp_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/generate_temp_password',
            user__pb2.UserGenerateTempPasswordRequest.SerializeToString,
            user__pb2.UserGenerateTempPasswordResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @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,
            _registered_method=True)

    @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,
            _registered_method=True)

    @staticmethod
    def update(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/update',
            user__pb2.UserUpdateRequest.SerializeToString,
            user__pb2.UserUpdateResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def delete(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/delete',
            user__pb2.UserDeleteRequest.SerializeToString,
            user__pb2.UserDeleteResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @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,
            _registered_method=True)

    @staticmethod
    def get_properties(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_properties',
            user__pb2.UserPropertiesGetRequest.SerializeToString,
            user__pb2.UserPropertiesGetResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def update_properties(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/update_properties',
            user__pb2.UserPropertiesUpdateRequest.SerializeToString,
            user__pb2.UserPropertiesUpdateResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def get_public_key(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_public_key',
            user__pb2.UserPublicKeyRequest.SerializeToString,
            user__pb2.UserPublicKeyResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
