public async Task <IEnumerable <IBasicBuildConfiguration> > GetAllBuildConfigurationsAsync() { var request = new RestRequest("buildTypes"); var response = await _teamCityClient.ExecuteRequestAsync <BuildTypesResponse>(request); return(_buildConfigurationMapper.Map(response)); }
public Build Map(BuildResponse build) { if (build == null) { return(null); } return(new Build { Id = build.Id, BuildConfigurationId = build.BuildTypeId, Agent = _agentMapper.Map(build.Agent), ArtifactDependencies = Map(build.ArtifactDependencies), BranchName = build.BranchName, BuildConfiguration = _buildConfigurationMapper.Map(build.BuildType), FinishDate = build.FinishDate, Href = build.Href, IsDefaultBranch = build.DefaultBranch || string.Equals(build.BranchName, "develop") || string.Equals(build.BranchName, "master"), LastChanges = _buildChangeMapper.Map(build.LastChanges), Number = build.Number, PercentageComplete = build.PercentageComplete ?? build.RunningInfo?.PercentageComplete, ElapsedSeconds = build.RunningInfo?.ElapsedSeconds, EstimatedTotalSeconds = build.RunningInfo?.EstimatedTotalSeconds, CurrentStageText = build.RunningInfo?.CurrentStageText, Properties = _propertyMapper.Map(build.Properties), QueuedDate = build.QueuedDate, SnapshotDependencies = Map(build.SnapshotDependencies), StartDate = build.StartDate, State = build.State, Status = _buildStatusMapper.Map(build.Status), StatusText = build.StatusText, WebUrl = build.WebUrl }); }