def METHOD_NAME(cls, v, values):
    for format_, endpoints in v.items():
        if format_ not in values["formats"]:
            raise ValueError(f"'{format_}' must be listed in formats to be valid")
        for endpoint in endpoints:
            if endpoint not in values["available_endpoints"]:
                raise ValueError(
                    f"'{endpoint}' must be listed in available_endpoints to be valid"
                )
    return v