public async Task <CheckRunsResponse> GetAllForCheckSuite(long repositoryId, long checkSuiteId, CheckRunRequest checkRunRequest, ApiOptions options) { Ensure.ArgumentNotNull(checkRunRequest, nameof(checkRunRequest)); Ensure.ArgumentNotNull(options, nameof(options)); var results = await ApiConnection.GetAll <CheckRunsResponse>(ApiUrls.CheckRunsForCheckSuite(repositoryId, checkSuiteId), checkRunRequest.ToParametersDictionary(), AcceptHeaders.ChecksApiPreview, options).ConfigureAwait(false); return(new CheckRunsResponse( results.Count > 0 ? results.Max(x => x.TotalCount) : 0, results.SelectMany(x => x.CheckRuns).ToList())); }
public async Task <CheckRunsResponse> GetAllForReference(string owner, string name, string reference, CheckRunRequest checkRunRequest, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); Ensure.ArgumentNotNullOrEmptyString(reference, nameof(reference)); Ensure.ArgumentNotNull(checkRunRequest, nameof(checkRunRequest)); Ensure.ArgumentNotNull(options, nameof(options)); var results = await ApiConnection.GetAll <CheckRunsResponse>(ApiUrls.CheckRunsForReference(owner, name, reference), checkRunRequest.ToParametersDictionary(), AcceptHeaders.ChecksApiPreview, options).ConfigureAwait(false); return(new CheckRunsResponse( results.Count > 0 ? results.Max(x => x.TotalCount) : 0, results.SelectMany(x => x.CheckRuns).ToList())); }