public List<ChangeSummary> GetChanges(Build build) { if (build.Changes.Count == 0) return new List<ChangeSummary>(); var changeWrapper = _caller.GetFormat<ChangeWrapper>(build.Changes.Href); return changeWrapper.Change; }
public void GetArtifactsInBuild(Build build, Action<IEnumerable<ArtifactModel>> callback) { if (callback == null) throw new ArgumentNullException("callback"); if (!(client is TeamCityClient)) throw new InvalidOperationException("Not TeamCityClient"); worker.QueueWork(delegate { // TODO why is not this method in the interface? callback( ((TeamCityClient)client).ArtifactsByBuildConfigIdAndBuildNumber(build.BuildTypeId, build.Number).Select( x => new ArtifactModel(x))); }); }
private static string GetFlagTooltip(Build b) { return string.Format("{0} - {1} #{2}", b.NiceProjectName(), b.NiceName(), b.Number); }
private static string GetFlagTooltip(Build b) { return $"{b.NiceProjectName()} - {b.NiceName()} #{b.Number}"; }
/// <summary/> /// <param name="downloadHandler"></param> /// <param name="build"> </param> public void DownloadTestsCsv(Action<string> downloadHandler, Build build) { string uriPart = string.Format("/get/tests/buildId/{0}", build.Id); _caller.GetDownloadFormat(downloadHandler, uriPart); }
/// <summary> /// Retrieves the artifacts associated to the specified <see cref="Build"/>. /// </summary> /// <param name="build"> /// The TeamCity <see cref="Build"/> of the desired artifacts. /// </param> /// <param name="artifactRelativeName"> /// the relative path and filename of a specific artifact. Supports referencing files under archives using the "!" delimiter after the archive name. /// </param> /// <remarks> /// This method is only supported by TeamCity 8.x and higher. /// </remarks> public IArtifactWrapper2 ByBuild(Build build, string artifactRelativeName = "") { if (build == null || string.IsNullOrEmpty(build.Id)) { throw new ArgumentException("Invalid build specified. Please be sure to use the methods of the IBuilds interface to obtain it."); } var receivedBuildHref = string.Format(TeamCityRestBuildFormat, build.Id); if (!build.Href.EndsWith(receivedBuildHref)) { throw new ArgumentException("Invalid build specified. Please be sure to use the methods of the IBuilds interface to obtain it."); } var artifacts = _caller.GetFormat<Artifacts>("{0}{1}{2}", build.Href, TeamCityRestBuildArtifactChildren, string.IsNullOrEmpty(artifactRelativeName) ? string.Empty : string.Format("/{0}", artifactRelativeName)); return new ArtifactWrapper2(_caller, artifacts, artifactRelativeName); }