# 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_collection_pb2 as user__collection__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_collection_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 UserCollectionApiStub(object):
    """Missing associated documentation comment in .proto file."""

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

        Args:
            channel: A grpc.Channel.
        """
        self.create = channel.unary_unary(
                '/oi.papi.UserCollectionApi/create',
                request_serializer=user__collection__pb2.UserCollectionCreateRequest.SerializeToString,
                response_deserializer=user__collection__pb2.UserCollectionCreateResponse.FromString,
                _registered_method=True)
        self.get = channel.unary_unary(
                '/oi.papi.UserCollectionApi/get',
                request_serializer=user__collection__pb2.UserCollectionGetRequest.SerializeToString,
                response_deserializer=user__collection__pb2.UserCollectionGetResponse.FromString,
                _registered_method=True)
        self.list = channel.unary_unary(
                '/oi.papi.UserCollectionApi/list',
                request_serializer=user__collection__pb2.UserCollectionListRequest.SerializeToString,
                response_deserializer=user__collection__pb2.UserCollectionListResponse.FromString,
                _registered_method=True)
        self.update = channel.unary_unary(
                '/oi.papi.UserCollectionApi/update',
                request_serializer=user__collection__pb2.UserCollectionUpdateRequest.SerializeToString,
                response_deserializer=user__collection__pb2.UserCollectionUpdateResponse.FromString,
                _registered_method=True)
        self.delete = channel.unary_unary(
                '/oi.papi.UserCollectionApi/delete',
                request_serializer=user__collection__pb2.UserCollectionDeleteRequest.SerializeToString,
                response_deserializer=user__collection__pb2.UserCollectionDeleteResponse.FromString,
                _registered_method=True)
        self.add_user = channel.unary_unary(
                '/oi.papi.UserCollectionApi/add_user',
                request_serializer=user__collection__pb2.UserCollectionAddUserRequest.SerializeToString,
                response_deserializer=user__collection__pb2.UserCollectionAddUserResponse.FromString,
                _registered_method=True)
        self.remove_user = channel.unary_unary(
                '/oi.papi.UserCollectionApi/remove_user',
                request_serializer=user__collection__pb2.UserCollectionRemoveUserRequest.SerializeToString,
                response_deserializer=user__collection__pb2.UserCollectionRemoveUserResponse.FromString,
                _registered_method=True)


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

    def create(self, request, context):
        """
        Create a new UserCollection to house a collection of users. This can only be done by an admin.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def get(self, request, context):
        """
        Get the details of a UserCollection. This can only done for the UserCollection that a User is a part of.
        If include_users is set to true, this endpoint also returns the list of Users in the UserCollection.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def list(self, request, context):
        """
        Search for collections
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def update(self, request, context):
        """
        Update a UserCollection
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def delete(self, request, context):
        """
        Delete a UserCollection
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def add_user(self, request, context):
        """
        Add a User to UserCollection
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def remove_user(self, request, context):
        """
        Remove a User from UserCollection
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_UserCollectionApiServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'create': grpc.unary_unary_rpc_method_handler(
                    servicer.create,
                    request_deserializer=user__collection__pb2.UserCollectionCreateRequest.FromString,
                    response_serializer=user__collection__pb2.UserCollectionCreateResponse.SerializeToString,
            ),
            'get': grpc.unary_unary_rpc_method_handler(
                    servicer.get,
                    request_deserializer=user__collection__pb2.UserCollectionGetRequest.FromString,
                    response_serializer=user__collection__pb2.UserCollectionGetResponse.SerializeToString,
            ),
            'list': grpc.unary_unary_rpc_method_handler(
                    servicer.list,
                    request_deserializer=user__collection__pb2.UserCollectionListRequest.FromString,
                    response_serializer=user__collection__pb2.UserCollectionListResponse.SerializeToString,
            ),
            'update': grpc.unary_unary_rpc_method_handler(
                    servicer.update,
                    request_deserializer=user__collection__pb2.UserCollectionUpdateRequest.FromString,
                    response_serializer=user__collection__pb2.UserCollectionUpdateResponse.SerializeToString,
            ),
            'delete': grpc.unary_unary_rpc_method_handler(
                    servicer.delete,
                    request_deserializer=user__collection__pb2.UserCollectionDeleteRequest.FromString,
                    response_serializer=user__collection__pb2.UserCollectionDeleteResponse.SerializeToString,
            ),
            'add_user': grpc.unary_unary_rpc_method_handler(
                    servicer.add_user,
                    request_deserializer=user__collection__pb2.UserCollectionAddUserRequest.FromString,
                    response_serializer=user__collection__pb2.UserCollectionAddUserResponse.SerializeToString,
            ),
            'remove_user': grpc.unary_unary_rpc_method_handler(
                    servicer.remove_user,
                    request_deserializer=user__collection__pb2.UserCollectionRemoveUserRequest.FromString,
                    response_serializer=user__collection__pb2.UserCollectionRemoveUserResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'oi.papi.UserCollectionApi', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('oi.papi.UserCollectionApi', rpc_method_handlers)


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

    @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.UserCollectionApi/create',
            user__collection__pb2.UserCollectionCreateRequest.SerializeToString,
            user__collection__pb2.UserCollectionCreateResponse.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.UserCollectionApi/get',
            user__collection__pb2.UserCollectionGetRequest.SerializeToString,
            user__collection__pb2.UserCollectionGetResponse.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.UserCollectionApi/list',
            user__collection__pb2.UserCollectionListRequest.SerializeToString,
            user__collection__pb2.UserCollectionListResponse.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.UserCollectionApi/update',
            user__collection__pb2.UserCollectionUpdateRequest.SerializeToString,
            user__collection__pb2.UserCollectionUpdateResponse.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.UserCollectionApi/delete',
            user__collection__pb2.UserCollectionDeleteRequest.SerializeToString,
            user__collection__pb2.UserCollectionDeleteResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def add_user(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.UserCollectionApi/add_user',
            user__collection__pb2.UserCollectionAddUserRequest.SerializeToString,
            user__collection__pb2.UserCollectionAddUserResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def remove_user(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.UserCollectionApi/remove_user',
            user__collection__pb2.UserCollectionRemoveUserRequest.SerializeToString,
            user__collection__pb2.UserCollectionRemoveUserResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
