public async Task <IEnumerable <IBasicBuildConfiguration> > GetAllBuildConfigurationsAsync()
        {
            var request  = new RestRequest("buildTypes");
            var response = await _teamCityClient.ExecuteRequestAsync <BuildTypesResponse>(request);

            return(_buildConfigurationMapper.Map(response));
        }
        public async Task <IEnumerable <IBasicProject> > GetAllProjectsAsync()
        {
            var request  = new RestRequest("projects", Method.GET);
            var response = await _teamCityClient.ExecuteRequestAsync <ProjectsResponse>(request);

            return(_projectMapper.Map(response));
        }
        public async Task <IEnumerable <IDetailedBuild> > GetBuildsOfBuildConfigurationAsync(string buildConfigurationId, int count = 100)
        {
            var requestUrl = _apiOptions.GetBuildsOfBuildConfiguration;

            requestUrl = requestUrl.Replace("{count}", count.ToString());
            requestUrl = requestUrl.Replace("{buildConfigurationId}", buildConfigurationId);
            var request  = new RestRequest(requestUrl);
            var response = await _teamCityClient.ExecuteRequestAsync <BuildsResponse>(request);

            return(_buildMapper.Map(response));
        }
Esempio n. 4
0
        public async Task <IEnumerable <IDetailedBuild> > GetBuildsOfBuildConfigurationAsync(string buildConfigurationId, int count = 100)
        {
            var request = new RestRequest("builds/?locator=branch:(default:any),running:any,count:{count},buildType:(id:{buildConfigurationId})" +
                                          "&fields=count,build(id,buildTypeId,number,status,state,percentageComplete,branchName,href,webUrl," +
                                          "running-info(percentageComplete,elapsedSeconds,estimatedTotalSeconds,currentStageText),queuedDate,startDate,finishDate)");

            request.AddUrlSegment("count", Convert.ToString(count));
            request.AddUrlSegment("buildConfigurationId", buildConfigurationId);
            var response = await _teamCityClient.ExecuteRequestAsync <BuildsResponse>(request);

            return(_buildMapper.Map(response));
        }