# Path: aioconsul/client/bases.py
# class EndpointBase:
# 
#     def __init__(self, api):
#         self._api = api
# 
#     def __repr__(self):
#         return "<%s(%r)>" % (self.__class__.__name__, str(self._api.address))
# 
# Path: aioconsul/util.py
# def extract_attr(obj, *, keys):
#     if isinstance(obj, Mapping):
#         for key in keys:
#             if key in obj:
#                 return obj[key]
#         raise TypeError("%s not found in obj %s" % (keys, obj))
#     return obj


from .bases import EndpointBase
from aioconsul.util import extract_attr
        **Datacenters**. The default value is an empty list.

        **OnlyPassing** controls the behavior of the query's health check
        filtering. If this is set to false, the results will include nodes
        with checks in the passing as well as the warning states. If this is
        set to true, only nodes with checks in the passing state will be
        returned. The default value is False.

        **Tags** provides a list of service tags to filter the query results.
        For a service to pass the tag filter it must have all of the required
        tags, and none of the excluded tags (prefixed with ``!``).
        The default value is an empty list, which does no tag filtering.

        **TTL** in the **DNS** structure is a duration string that can use "s"
        as a suffix for seconds. It controls how the TTL is set when query
        results are served over DNS. If this isn't specified, then the Consul
        agent configuration for the given service will be used
        (see DNS Caching). If this is specified, it will take precedence over
        any Consul agent-specific configuration. If no TTL is specified here
        or at the Consul agent level, then the TTL will default to 0.

        It returns the ID of the created query::

            {
                "ID": "8f246b77-f3e1-ff88-5b48-8ec93abf3e05"
            }
        """

        if "Token" in query:
            # in case of a full token object...

# Path: aioconsul/client/bases.py
# class EndpointBase:
# 
#     def __init__(self, api):
#         self._api = api
# 
#     def __repr__(self):
#         return "<%s(%r)>" % (self.__class__.__name__, str(self._api.address))
# 
# Path: aioconsul/util.py
# def extract_attr(obj, *, keys):
#     if isinstance(obj, Mapping):
#         for key in keys:
#             if key in obj:
#                 return obj[key]
#         raise TypeError("%s not found in obj %s" % (keys, obj))
#     return obj


# Path: aioconsul/client/query_endpoint.py
from .bases import EndpointBase
from aioconsul.util import extract_attr

        **Datacenters**. The default value is an empty list.

        **OnlyPassing** controls the behavior of the query's health check
        filtering. If this is set to false, the results will include nodes
        with checks in the passing as well as the warning states. If this is
        set to true, only nodes with checks in the passing state will be
        returned. The default value is False.

        **Tags** provides a list of service tags to filter the query results.
        For a service to pass the tag filter it must have all of the required
        tags, and none of the excluded tags (prefixed with ``!``).
        The default value is an empty list, which does no tag filtering.

        **TTL** in the **DNS** structure is a duration string that can use "s"
        as a suffix for seconds. It controls how the TTL is set when query
        results are served over DNS. If this isn't specified, then the Consul
        agent configuration for the given service will be used
        (see DNS Caching). If this is specified, it will take precedence over
        any Consul agent-specific configuration. If no TTL is specified here
        or at the Consul agent level, then the TTL will default to 0.

        It returns the ID of the created query::

            {
                "ID": "8f246b77-f3e1-ff88-5b48-8ec93abf3e05"
            }
        """

        if "Token" in query:
            # in case of a full token object...

            query["Token"] = extract_attr(query["Token"], keys=["ID"])