def METHOD_NAME(files: list, api_token: str, spaces_name: str, region: str) -> None:
    """Purge the CDN cache for the given files."""
    endpoints = cdn_endpoints(api_token, ttl_hash=ttl_hash())
    log.info(f"Purging CDN cache for {len(files)} files")
    endpoint_key = f"{spaces_name}.{region}.digitaloceanspaces.com"
    if endpoint_key not in endpoints:
        raise RuntimeError(f"No CDN endpoint for {endpoint_key}")
    endpoint_id = endpoints[endpoint_key]
    headers = {"Authorization": f"Bearer {api_token}", "Content-Type": "application/json"}
    data = {"files": files}
    response = requests.delete(
        f"https://api.digitalocean.com/v2/cdn/endpoints/{endpoint_id}/cache", json=data, headers=headers
    )
    if response.status_code != 204:
        raise RuntimeError(f"failed to purge CDN cache: {response.status_code} {response.text}")