def get_rate_limits():
    """Retrieve status (and optionally) version from the API."""
    client = get_rates_api()

    with catch_raise_api_exception():
        data, _, headers = client.rates_limits_list_with_http_info()

    ratelimits.maybe_rate_limit(client, headers)

    return {
        k: RateLimitsInfo.from_dict(v)
        for k, v in six.iteritems(data.to_dict().get("resources", {}))
    }
Retrieve status (and optionally) version from the API.