# 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 apexnova.identity.user import user_pb2 as apexnova_dot_identity_dot_user_dot_user__pb2
from apexnova.identity.user import user_service_pb2 as apexnova_dot_identity_dot_user_dot_user__service__pb2

GRPC_GENERATED_VERSION = '1.72.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 apexnova/identity/user/user_service_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 UserServiceStub(object):
    """The User service definition
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.CreateUser = channel.unary_unary(
                '/identity.UserService/CreateUser',
                request_serializer=apexnova_dot_identity_dot_user_dot_user__service__pb2.CreateUserRequest.SerializeToString,
                response_deserializer=apexnova_dot_identity_dot_user_dot_user__service__pb2.CreateUserResponse.FromString,
                _registered_method=True)
        self.ReadUser = channel.unary_unary(
                '/identity.UserService/ReadUser',
                request_serializer=apexnova_dot_identity_dot_user_dot_user__service__pb2.ReadUserRequest.SerializeToString,
                response_deserializer=apexnova_dot_identity_dot_user_dot_user__service__pb2.ReadUserResponse.FromString,
                _registered_method=True)
        self.UpdateUser = channel.unary_unary(
                '/identity.UserService/UpdateUser',
                request_serializer=apexnova_dot_identity_dot_user_dot_user__service__pb2.UpdateUserRequest.SerializeToString,
                response_deserializer=apexnova_dot_identity_dot_user_dot_user__service__pb2.UpdateUserResponse.FromString,
                _registered_method=True)
        self.DeleteUser = channel.unary_unary(
                '/identity.UserService/DeleteUser',
                request_serializer=apexnova_dot_identity_dot_user_dot_user__service__pb2.DeleteUserRequest.SerializeToString,
                response_deserializer=apexnova_dot_identity_dot_user_dot_user__service__pb2.DeleteUserResponse.FromString,
                _registered_method=True)
        self.ReadUsersStream = channel.unary_stream(
                '/identity.UserService/ReadUsersStream',
                request_serializer=apexnova_dot_identity_dot_user_dot_user__service__pb2.ReadUsersStreamRequest.SerializeToString,
                response_deserializer=apexnova_dot_identity_dot_user_dot_user__pb2.User.FromString,
                _registered_method=True)


class UserServiceServicer(object):
    """The User service definition
    """

    def CreateUser(self, request, context):
        """Creates a new user.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ReadUser(self, request, context):
        """Reads a user by their ID.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def UpdateUser(self, request, context):
        """Updates a user's details.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def DeleteUser(self, request, context):
        """Deletes a user by their ID.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ReadUsersStream(self, request, context):
        """Streams user data for multiple users by their IDs.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_UserServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'CreateUser': grpc.unary_unary_rpc_method_handler(
                    servicer.CreateUser,
                    request_deserializer=apexnova_dot_identity_dot_user_dot_user__service__pb2.CreateUserRequest.FromString,
                    response_serializer=apexnova_dot_identity_dot_user_dot_user__service__pb2.CreateUserResponse.SerializeToString,
            ),
            'ReadUser': grpc.unary_unary_rpc_method_handler(
                    servicer.ReadUser,
                    request_deserializer=apexnova_dot_identity_dot_user_dot_user__service__pb2.ReadUserRequest.FromString,
                    response_serializer=apexnova_dot_identity_dot_user_dot_user__service__pb2.ReadUserResponse.SerializeToString,
            ),
            'UpdateUser': grpc.unary_unary_rpc_method_handler(
                    servicer.UpdateUser,
                    request_deserializer=apexnova_dot_identity_dot_user_dot_user__service__pb2.UpdateUserRequest.FromString,
                    response_serializer=apexnova_dot_identity_dot_user_dot_user__service__pb2.UpdateUserResponse.SerializeToString,
            ),
            'DeleteUser': grpc.unary_unary_rpc_method_handler(
                    servicer.DeleteUser,
                    request_deserializer=apexnova_dot_identity_dot_user_dot_user__service__pb2.DeleteUserRequest.FromString,
                    response_serializer=apexnova_dot_identity_dot_user_dot_user__service__pb2.DeleteUserResponse.SerializeToString,
            ),
            'ReadUsersStream': grpc.unary_stream_rpc_method_handler(
                    servicer.ReadUsersStream,
                    request_deserializer=apexnova_dot_identity_dot_user_dot_user__service__pb2.ReadUsersStreamRequest.FromString,
                    response_serializer=apexnova_dot_identity_dot_user_dot_user__pb2.User.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'identity.UserService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('identity.UserService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class UserService(object):
    """The User service definition
    """

    @staticmethod
    def CreateUser(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,
            '/identity.UserService/CreateUser',
            apexnova_dot_identity_dot_user_dot_user__service__pb2.CreateUserRequest.SerializeToString,
            apexnova_dot_identity_dot_user_dot_user__service__pb2.CreateUserResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ReadUser(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,
            '/identity.UserService/ReadUser',
            apexnova_dot_identity_dot_user_dot_user__service__pb2.ReadUserRequest.SerializeToString,
            apexnova_dot_identity_dot_user_dot_user__service__pb2.ReadUserResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def UpdateUser(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,
            '/identity.UserService/UpdateUser',
            apexnova_dot_identity_dot_user_dot_user__service__pb2.UpdateUserRequest.SerializeToString,
            apexnova_dot_identity_dot_user_dot_user__service__pb2.UpdateUserResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def DeleteUser(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,
            '/identity.UserService/DeleteUser',
            apexnova_dot_identity_dot_user_dot_user__service__pb2.DeleteUserRequest.SerializeToString,
            apexnova_dot_identity_dot_user_dot_user__service__pb2.DeleteUserResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ReadUsersStream(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,
            '/identity.UserService/ReadUsersStream',
            apexnova_dot_identity_dot_user_dot_user__service__pb2.ReadUsersStreamRequest.SerializeToString,
            apexnova_dot_identity_dot_user_dot_user__pb2.User.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
