# 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
        will evaluate the script every **Interval** to update the status.

        If a **DockerContainerID** is provided, the check is a Docker check,
        and Consul will evaluate the script every **Interval** in the given
        container using the specified Shell. Note that Shell is currently only
        supported for Docker checks.

        An **HTTP** check will perform an HTTP GET request against the value of
        **HTTP** (expected to be a URL) every **Interval**. If the response is
        any 2xx code, the check is passing. If the response is
        ``429 Too Many Requests``, the check is **warning**.
        Otherwise, the check is **critical**.

        An **TCP** check will perform an TCP connection attempt against the
        value of **TCP** (expected to be an IP/hostname and port combination)
        every **Interval**. If the connection attempt is successful, the check
        is **passing**. If the connection attempt is unsuccessful, the check
        is **critical**. In the case of a hostname that resolves to both IPv4
        and IPv6 addresses, an attempt will be made to both addresses, and the
        first successful connection attempt will result in a successful check.

        If a **TTL** type is used, then the TTL update endpoint must be used
        periodically to update the state of the check.

        The **ServiceID** field can be provided to associate the registered
        check with an existing service provided by the agent.

        The **Status** field can be provided to specify the initial state of
        the health check.
        """

# 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/checks_endpoint.py
from .bases import EndpointBase
from aioconsul.util import extract_attr

        will evaluate the script every **Interval** to update the status.

        If a **DockerContainerID** is provided, the check is a Docker check,
        and Consul will evaluate the script every **Interval** in the given
        container using the specified Shell. Note that Shell is currently only
        supported for Docker checks.

        An **HTTP** check will perform an HTTP GET request against the value of
        **HTTP** (expected to be a URL) every **Interval**. If the response is
        any 2xx code, the check is passing. If the response is
        ``429 Too Many Requests``, the check is **warning**.
        Otherwise, the check is **critical**.

        An **TCP** check will perform an TCP connection attempt against the
        value of **TCP** (expected to be an IP/hostname and port combination)
        every **Interval**. If the connection attempt is successful, the check
        is **passing**. If the connection attempt is unsuccessful, the check
        is **critical**. In the case of a hostname that resolves to both IPv4
        and IPv6 addresses, an attempt will be made to both addresses, and the
        first successful connection attempt will result in a successful check.

        If a **TTL** type is used, then the TTL update endpoint must be used
        periodically to update the state of the check.

        The **ServiceID** field can be provided to associate the registered
        check with an existing service provided by the agent.

        The **Status** field can be provided to specify the initial state of
        the health check.
        """

        token_id = extract_attr(token, keys=["ID"])