private List<Artifact> GetArtifacts(Test test, ArtifactCategory artifactCategory) { string nextToken = null; List<Artifact> artifacts = new List<Artifact>(); do { var resp = DFClient.ListArtifacts(new ListArtifactsRequest() { NextToken = nextToken, Arn = test.Arn, Type = artifactCategory }); nextToken = resp.NextToken; artifacts.AddRange(resp.Artifacts); } while (nextToken != null); return artifacts; }