# 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/api.py
# @singledispatch
# def consul(obj, meta=None):
#     meta = meta or {}
#     return ConsulValue(obj, meta=meta)


from .bases import EndpointBase
from aioconsul.api import consul
                      Defaults to the agent's local datacenter.
            watch (Blocking): Do a blocking query
            consistency (Consistency): Force consistency
        Returns:
            CollectionMeta: where value is a list of node / coord

        This endpoint is hit with a GET and returns the LAN network
        coordinates for all nodes in a given DC.
        By default, the datacenter of the agent is queried.

        It returns a body like this::

            [
                {
                    "Node": "agent-one",
                    "Coord": {
                        "Adjustment": 0,
                        "Error": 1.5,
                        "Height": 0,
                        "Vec": [0,0,0,0,0,0,0,0]
                    }
                }
            ]
        """
        path = "/v1/coordinate/nodes"
        params = {"dc": dc}
        response = await self._api.get(path,
                                       params=params,
                                       watch=watch,
                                       consistency=consistency)

# 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/api.py
# @singledispatch
# def consul(obj, meta=None):
#     meta = meta or {}
#     return ConsulValue(obj, meta=meta)


# Path: aioconsul/client/coordinate_endpoint.py
from .bases import EndpointBase
from aioconsul.api import consul

                      Defaults to the agent's local datacenter.
            watch (Blocking): Do a blocking query
            consistency (Consistency): Force consistency
        Returns:
            CollectionMeta: where value is a list of node / coord

        This endpoint is hit with a GET and returns the LAN network
        coordinates for all nodes in a given DC.
        By default, the datacenter of the agent is queried.

        It returns a body like this::

            [
                {
                    "Node": "agent-one",
                    "Coord": {
                        "Adjustment": 0,
                        "Error": 1.5,
                        "Height": 0,
                        "Vec": [0,0,0,0,0,0,0,0]
                    }
                }
            ]
        """
        path = "/v1/coordinate/nodes"
        params = {"dc": dc}
        response = await self._api.get(path,
                                       params=params,
                                       watch=watch,
                                       consistency=consistency)

        return consul(response)