"""
@generated by mypy-protobuf.  Do not edit manually!
isort:skip_file
Copyright (c) 2019-2024 Iotic Labs Ltd. All rights reserved.

Iotics Web protocol definitions (meta)
"""

import abc
import collections.abc
import grpc
import grpc.aio
import iotics.api.meta_pb2
import typing

_T = typing.TypeVar("_T")

class _MaybeAsyncIterator(collections.abc.AsyncIterator[_T], collections.abc.Iterator[_T], metaclass=abc.ABCMeta): ...

class _ServicerContext(grpc.ServicerContext, grpc.aio.ServicerContext):  # type: ignore[misc, type-arg]
    ...

class MetaAPIStub:
    """---------------------------------------------------------------------------------------------------------------------

    MetaAPI enables querying of metadata associated with Twins and Feeds.
    Services only affect local resources, unless stated otherwise.
    """

    def __init__(self, channel: typing.Union[grpc.Channel, grpc.aio.Channel]) -> None: ...
    SparqlQuery: grpc.UnaryStreamMultiCallable[
        iotics.api.meta_pb2.SparqlQueryRequest,
        iotics.api.meta_pb2.SparqlQueryResponse,
    ]
    """SparqlQuery performs a SPARQL 1.1 query against the Federated Knowledge Graph of the Iotics network to which this
    host belongs. The result is returned as a sequence of chunks. Note that:
    - Result chunks MIGHT arrive out of order and it is the client's responsibility to re-assemble them.
    - This RPC is currently in beta, it means:
         - the logic should remain unchanged,
         - the rpc call should remain unchanged,
         - the service can be interrupted without notice.
    """

    SparqlUpdate: grpc.UnaryUnaryMultiCallable[
        iotics.api.meta_pb2.SparqlUpdateRequest,
        iotics.api.meta_pb2.SparqlUpdateResponse,
    ]
    """SparqlUpdate performs a SPARQL 1.1 update. When performing an update, the update query must contain a reference to
    one of the following graph IRIs:
    1. http://data.iotics.com/graph#custom-public (aka custom public graph) - All metadata written to this graph will be
       visible during SPARQL queries both with local & global scope (and thus, the Iotics network).
    """

class MetaAPIAsyncStub:
    """---------------------------------------------------------------------------------------------------------------------

    MetaAPI enables querying of metadata associated with Twins and Feeds.
    Services only affect local resources, unless stated otherwise.
    """

    SparqlQuery: grpc.aio.UnaryStreamMultiCallable[
        iotics.api.meta_pb2.SparqlQueryRequest,
        iotics.api.meta_pb2.SparqlQueryResponse,
    ]
    """SparqlQuery performs a SPARQL 1.1 query against the Federated Knowledge Graph of the Iotics network to which this
    host belongs. The result is returned as a sequence of chunks. Note that:
    - Result chunks MIGHT arrive out of order and it is the client's responsibility to re-assemble them.
    - This RPC is currently in beta, it means:
         - the logic should remain unchanged,
         - the rpc call should remain unchanged,
         - the service can be interrupted without notice.
    """

    SparqlUpdate: grpc.aio.UnaryUnaryMultiCallable[
        iotics.api.meta_pb2.SparqlUpdateRequest,
        iotics.api.meta_pb2.SparqlUpdateResponse,
    ]
    """SparqlUpdate performs a SPARQL 1.1 update. When performing an update, the update query must contain a reference to
    one of the following graph IRIs:
    1. http://data.iotics.com/graph#custom-public (aka custom public graph) - All metadata written to this graph will be
       visible during SPARQL queries both with local & global scope (and thus, the Iotics network).
    """

class MetaAPIServicer(metaclass=abc.ABCMeta):
    """---------------------------------------------------------------------------------------------------------------------

    MetaAPI enables querying of metadata associated with Twins and Feeds.
    Services only affect local resources, unless stated otherwise.
    """

    @abc.abstractmethod
    def SparqlQuery(
        self,
        request: iotics.api.meta_pb2.SparqlQueryRequest,
        context: _ServicerContext,
    ) -> typing.Union[collections.abc.Iterator[iotics.api.meta_pb2.SparqlQueryResponse], collections.abc.AsyncIterator[iotics.api.meta_pb2.SparqlQueryResponse]]:
        """SparqlQuery performs a SPARQL 1.1 query against the Federated Knowledge Graph of the Iotics network to which this
        host belongs. The result is returned as a sequence of chunks. Note that:
        - Result chunks MIGHT arrive out of order and it is the client's responsibility to re-assemble them.
        - This RPC is currently in beta, it means:
             - the logic should remain unchanged,
             - the rpc call should remain unchanged,
             - the service can be interrupted without notice.
        """

    @abc.abstractmethod
    def SparqlUpdate(
        self,
        request: iotics.api.meta_pb2.SparqlUpdateRequest,
        context: _ServicerContext,
    ) -> typing.Union[iotics.api.meta_pb2.SparqlUpdateResponse, collections.abc.Awaitable[iotics.api.meta_pb2.SparqlUpdateResponse]]:
        """SparqlUpdate performs a SPARQL 1.1 update. When performing an update, the update query must contain a reference to
        one of the following graph IRIs:
        1. http://data.iotics.com/graph#custom-public (aka custom public graph) - All metadata written to this graph will be
           visible during SPARQL queries both with local & global scope (and thus, the Iotics network).
        """

def add_MetaAPIServicer_to_server(servicer: MetaAPIServicer, server: typing.Union[grpc.Server, grpc.aio.Server]) -> None: ...
