# 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 google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
try:
    import infragraph_pb2 as infragraph__pb2
except ImportError:
    from infragraph import infragraph_pb2 as infragraph__pb2

GRPC_GENERATED_VERSION = '1.70.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},'
        + f' but the generated code in infragraph_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 OpenapiStub(object):
    """Description missing in models

    For all RPCs defined in this service, API Server SHOULD provide JSON
    representation of `Error` message as an error string upon failure, ensuring
    name of enum constants (instead of value) for `kind` property is present
    in the representation
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.SetGraph = channel.unary_unary(
                '/infragraph.Openapi/SetGraph',
                request_serializer=infragraph__pb2.SetGraphRequest.SerializeToString,
                response_deserializer=infragraph__pb2.SetGraphResponse.FromString,
                _registered_method=True)
        self.streamSetGraph = channel.stream_unary(
                '/infragraph.Openapi/streamSetGraph',
                request_serializer=infragraph__pb2.Data.SerializeToString,
                response_deserializer=infragraph__pb2.SetGraphResponse.FromString,
                _registered_method=True)
        self.GetGraph = channel.unary_unary(
                '/infragraph.Openapi/GetGraph',
                request_serializer=infragraph__pb2.GetGraphRequest.SerializeToString,
                response_deserializer=infragraph__pb2.GetGraphResponse.FromString,
                _registered_method=True)
        self.streamGetGraph = channel.stream_unary(
                '/infragraph.Openapi/streamGetGraph',
                request_serializer=infragraph__pb2.Data.SerializeToString,
                response_deserializer=infragraph__pb2.GetGraphResponse.FromString,
                _registered_method=True)
        self.QueryGraph = channel.unary_unary(
                '/infragraph.Openapi/QueryGraph',
                request_serializer=infragraph__pb2.QueryGraphRequest.SerializeToString,
                response_deserializer=infragraph__pb2.QueryGraphResponse.FromString,
                _registered_method=True)
        self.streamQueryGraph = channel.stream_unary(
                '/infragraph.Openapi/streamQueryGraph',
                request_serializer=infragraph__pb2.Data.SerializeToString,
                response_deserializer=infragraph__pb2.QueryGraphResponse.FromString,
                _registered_method=True)
        self.AnnotateGraph = channel.unary_unary(
                '/infragraph.Openapi/AnnotateGraph',
                request_serializer=infragraph__pb2.AnnotateGraphRequest.SerializeToString,
                response_deserializer=infragraph__pb2.AnnotateGraphResponse.FromString,
                _registered_method=True)
        self.streamAnnotateGraph = channel.stream_unary(
                '/infragraph.Openapi/streamAnnotateGraph',
                request_serializer=infragraph__pb2.Data.SerializeToString,
                response_deserializer=infragraph__pb2.AnnotateGraphResponse.FromString,
                _registered_method=True)
        self.GetVersion = channel.unary_unary(
                '/infragraph.Openapi/GetVersion',
                request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
                response_deserializer=infragraph__pb2.GetVersionResponse.FromString,
                _registered_method=True)


class OpenapiServicer(object):
    """Description missing in models

    For all RPCs defined in this service, API Server SHOULD provide JSON
    representation of `Error` message as an error string upon failure, ensuring
    name of enum constants (instead of value) for `kind` property is present
    in the representation
    """

    def SetGraph(self, request, context):
        """Given an infrastructure object this API method will create a fully qualified infrastructure
        graph and validate it.

        Creating a fully qualified infrastructure graph requires the following steps:
        - process each of the infrastructure instance objects by locating the device and
        creating a subgraph using the device's edges and substituting the instance name for
        the device name.
        - process each of the infrastructure edges, looking up the instance to determine
        the max count and the name to be substituted for the device and link the subgraphs
        to create a complete infrastructure graph
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def streamSetGraph(self, request_iterator, context):
        """streaming version of the rpc SetGraph
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetGraph(self, request, context):
        """This will return the current graph.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def streamGetGraph(self, request_iterator, context):
        """streaming version of the rpc GetGraph
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def QueryGraph(self, request, context):
        """Query the current fully expanded graph using a declarative query syntax.

        - example: Ask the graph for specific endpoints such as those of type `XPU` or
        `NIC`
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def streamQueryGraph(self, request_iterator, context):
        """streaming version of the rpc QueryGraph
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def AnnotateGraph(self, request, context):
        """Extend the current graph created by the `set_graph` API.

        - example: Update specific endpoints with name/value information such as `rank=0`
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def streamAnnotateGraph(self, request_iterator, context):
        """streaming version of the rpc AnnotateGraph
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetVersion(self, request, context):
        """Description missing in models
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_OpenapiServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'SetGraph': grpc.unary_unary_rpc_method_handler(
                    servicer.SetGraph,
                    request_deserializer=infragraph__pb2.SetGraphRequest.FromString,
                    response_serializer=infragraph__pb2.SetGraphResponse.SerializeToString,
            ),
            'streamSetGraph': grpc.stream_unary_rpc_method_handler(
                    servicer.streamSetGraph,
                    request_deserializer=infragraph__pb2.Data.FromString,
                    response_serializer=infragraph__pb2.SetGraphResponse.SerializeToString,
            ),
            'GetGraph': grpc.unary_unary_rpc_method_handler(
                    servicer.GetGraph,
                    request_deserializer=infragraph__pb2.GetGraphRequest.FromString,
                    response_serializer=infragraph__pb2.GetGraphResponse.SerializeToString,
            ),
            'streamGetGraph': grpc.stream_unary_rpc_method_handler(
                    servicer.streamGetGraph,
                    request_deserializer=infragraph__pb2.Data.FromString,
                    response_serializer=infragraph__pb2.GetGraphResponse.SerializeToString,
            ),
            'QueryGraph': grpc.unary_unary_rpc_method_handler(
                    servicer.QueryGraph,
                    request_deserializer=infragraph__pb2.QueryGraphRequest.FromString,
                    response_serializer=infragraph__pb2.QueryGraphResponse.SerializeToString,
            ),
            'streamQueryGraph': grpc.stream_unary_rpc_method_handler(
                    servicer.streamQueryGraph,
                    request_deserializer=infragraph__pb2.Data.FromString,
                    response_serializer=infragraph__pb2.QueryGraphResponse.SerializeToString,
            ),
            'AnnotateGraph': grpc.unary_unary_rpc_method_handler(
                    servicer.AnnotateGraph,
                    request_deserializer=infragraph__pb2.AnnotateGraphRequest.FromString,
                    response_serializer=infragraph__pb2.AnnotateGraphResponse.SerializeToString,
            ),
            'streamAnnotateGraph': grpc.stream_unary_rpc_method_handler(
                    servicer.streamAnnotateGraph,
                    request_deserializer=infragraph__pb2.Data.FromString,
                    response_serializer=infragraph__pb2.AnnotateGraphResponse.SerializeToString,
            ),
            'GetVersion': grpc.unary_unary_rpc_method_handler(
                    servicer.GetVersion,
                    request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                    response_serializer=infragraph__pb2.GetVersionResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'infragraph.Openapi', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('infragraph.Openapi', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class Openapi(object):
    """Description missing in models

    For all RPCs defined in this service, API Server SHOULD provide JSON
    representation of `Error` message as an error string upon failure, ensuring
    name of enum constants (instead of value) for `kind` property is present
    in the representation
    """

    @staticmethod
    def SetGraph(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,
            '/infragraph.Openapi/SetGraph',
            infragraph__pb2.SetGraphRequest.SerializeToString,
            infragraph__pb2.SetGraphResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def streamSetGraph(request_iterator,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.stream_unary(
            request_iterator,
            target,
            '/infragraph.Openapi/streamSetGraph',
            infragraph__pb2.Data.SerializeToString,
            infragraph__pb2.SetGraphResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetGraph(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,
            '/infragraph.Openapi/GetGraph',
            infragraph__pb2.GetGraphRequest.SerializeToString,
            infragraph__pb2.GetGraphResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def streamGetGraph(request_iterator,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.stream_unary(
            request_iterator,
            target,
            '/infragraph.Openapi/streamGetGraph',
            infragraph__pb2.Data.SerializeToString,
            infragraph__pb2.GetGraphResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def QueryGraph(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,
            '/infragraph.Openapi/QueryGraph',
            infragraph__pb2.QueryGraphRequest.SerializeToString,
            infragraph__pb2.QueryGraphResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def streamQueryGraph(request_iterator,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.stream_unary(
            request_iterator,
            target,
            '/infragraph.Openapi/streamQueryGraph',
            infragraph__pb2.Data.SerializeToString,
            infragraph__pb2.QueryGraphResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def AnnotateGraph(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,
            '/infragraph.Openapi/AnnotateGraph',
            infragraph__pb2.AnnotateGraphRequest.SerializeToString,
            infragraph__pb2.AnnotateGraphResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def streamAnnotateGraph(request_iterator,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.stream_unary(
            request_iterator,
            target,
            '/infragraph.Openapi/streamAnnotateGraph',
            infragraph__pb2.Data.SerializeToString,
            infragraph__pb2.AnnotateGraphResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetVersion(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,
            '/infragraph.Openapi/GetVersion',
            google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            infragraph__pb2.GetVersionResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
