# 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 links.v1 import links_pb2 as links_dot_v1_dot_links__pb2

GRPC_GENERATED_VERSION = '1.78.0'
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},'
        + ' but the generated code in links/v1/links_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 LinkServiceStub(object):
    """LinkService handles smart link management
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.ListLinks = channel.unary_unary(
                '/links.v1.LinkService/ListLinks',
                request_serializer=links_dot_v1_dot_links__pb2.ListLinksRequest.SerializeToString,
                response_deserializer=links_dot_v1_dot_links__pb2.ListLinksResponse.FromString,
                _registered_method=True)
        self.CreateLink = channel.unary_unary(
                '/links.v1.LinkService/CreateLink',
                request_serializer=links_dot_v1_dot_links__pb2.CreateLinkRequest.SerializeToString,
                response_deserializer=links_dot_v1_dot_links__pb2.Link.FromString,
                _registered_method=True)
        self.GetLink = channel.unary_unary(
                '/links.v1.LinkService/GetLink',
                request_serializer=links_dot_v1_dot_links__pb2.GetLinkRequest.SerializeToString,
                response_deserializer=links_dot_v1_dot_links__pb2.Link.FromString,
                _registered_method=True)
        self.UpdateLink = channel.unary_unary(
                '/links.v1.LinkService/UpdateLink',
                request_serializer=links_dot_v1_dot_links__pb2.UpdateLinkRequest.SerializeToString,
                response_deserializer=links_dot_v1_dot_links__pb2.Link.FromString,
                _registered_method=True)
        self.DeleteLink = channel.unary_unary(
                '/links.v1.LinkService/DeleteLink',
                request_serializer=links_dot_v1_dot_links__pb2.DeleteLinkRequest.SerializeToString,
                response_deserializer=links_dot_v1_dot_links__pb2.DeleteLinkResponse.FromString,
                _registered_method=True)
        self.CheckSlug = channel.unary_unary(
                '/links.v1.LinkService/CheckSlug',
                request_serializer=links_dot_v1_dot_links__pb2.CheckSlugRequest.SerializeToString,
                response_deserializer=links_dot_v1_dot_links__pb2.CheckSlugResponse.FromString,
                _registered_method=True)


class LinkServiceServicer(object):
    """LinkService handles smart link management
    """

    def ListLinks(self, request, context):
        """List all links for the authenticated user
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CreateLink(self, request, context):
        """Create a new smart link
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetLink(self, request, context):
        """Get a specific link by ID
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def UpdateLink(self, request, context):
        """Update an existing link
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

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

    def CheckSlug(self, request, context):
        """Check if a slug is available
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_LinkServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'ListLinks': grpc.unary_unary_rpc_method_handler(
                    servicer.ListLinks,
                    request_deserializer=links_dot_v1_dot_links__pb2.ListLinksRequest.FromString,
                    response_serializer=links_dot_v1_dot_links__pb2.ListLinksResponse.SerializeToString,
            ),
            'CreateLink': grpc.unary_unary_rpc_method_handler(
                    servicer.CreateLink,
                    request_deserializer=links_dot_v1_dot_links__pb2.CreateLinkRequest.FromString,
                    response_serializer=links_dot_v1_dot_links__pb2.Link.SerializeToString,
            ),
            'GetLink': grpc.unary_unary_rpc_method_handler(
                    servicer.GetLink,
                    request_deserializer=links_dot_v1_dot_links__pb2.GetLinkRequest.FromString,
                    response_serializer=links_dot_v1_dot_links__pb2.Link.SerializeToString,
            ),
            'UpdateLink': grpc.unary_unary_rpc_method_handler(
                    servicer.UpdateLink,
                    request_deserializer=links_dot_v1_dot_links__pb2.UpdateLinkRequest.FromString,
                    response_serializer=links_dot_v1_dot_links__pb2.Link.SerializeToString,
            ),
            'DeleteLink': grpc.unary_unary_rpc_method_handler(
                    servicer.DeleteLink,
                    request_deserializer=links_dot_v1_dot_links__pb2.DeleteLinkRequest.FromString,
                    response_serializer=links_dot_v1_dot_links__pb2.DeleteLinkResponse.SerializeToString,
            ),
            'CheckSlug': grpc.unary_unary_rpc_method_handler(
                    servicer.CheckSlug,
                    request_deserializer=links_dot_v1_dot_links__pb2.CheckSlugRequest.FromString,
                    response_serializer=links_dot_v1_dot_links__pb2.CheckSlugResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'links.v1.LinkService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('links.v1.LinkService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class LinkService(object):
    """LinkService handles smart link management
    """

    @staticmethod
    def ListLinks(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,
            '/links.v1.LinkService/ListLinks',
            links_dot_v1_dot_links__pb2.ListLinksRequest.SerializeToString,
            links_dot_v1_dot_links__pb2.ListLinksResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def CreateLink(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,
            '/links.v1.LinkService/CreateLink',
            links_dot_v1_dot_links__pb2.CreateLinkRequest.SerializeToString,
            links_dot_v1_dot_links__pb2.Link.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetLink(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,
            '/links.v1.LinkService/GetLink',
            links_dot_v1_dot_links__pb2.GetLinkRequest.SerializeToString,
            links_dot_v1_dot_links__pb2.Link.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def UpdateLink(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,
            '/links.v1.LinkService/UpdateLink',
            links_dot_v1_dot_links__pb2.UpdateLinkRequest.SerializeToString,
            links_dot_v1_dot_links__pb2.Link.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def DeleteLink(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,
            '/links.v1.LinkService/DeleteLink',
            links_dot_v1_dot_links__pb2.DeleteLinkRequest.SerializeToString,
            links_dot_v1_dot_links__pb2.DeleteLinkResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def CheckSlug(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,
            '/links.v1.LinkService/CheckSlug',
            links_dot_v1_dot_links__pb2.CheckSlugRequest.SerializeToString,
            links_dot_v1_dot_links__pb2.CheckSlugResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
