def get_next_artifacts_url()

in buildkite/download-artifact/download_artifacts.py [0:0]


def get_next_artifacts_url(artifacts_response) -> Optional[str]:
    """
    Gets the next artifacts list URL from an artifacts list response.
    https://buildkite.com/docs/apis/rest-api/artifacts#list-artifacts-for-a-build
    :param artifacts_response: Paginated list response (https://buildkite.com/docs/apis/rest-api#pagination)
    :return: The next artifacts url or None
    """
    if "next" in artifacts_response.links:
        return artifacts_response.links["next"]["url"]
    else:
        return None