Esempio n. 1
0
        public async Task <IList <BuildDefinition> > GetBuildDefinitions(AccountDetails accountDetails)
        {
            _restClient.SetBasicCredentials(accountDetails.EncodedCredentials);
            string address = VsoAddressHelper.GetFullAddress(accountDetails.AccountName, string.Format(Constants.VsoBuildDefinitionsAddress, accountDetails.ProjectId));
            VsoBuildDefinitionList buildList = await _restClient.GetRequest <VsoBuildDefinitionList>(null, address);

            return(buildList.Value.Select(build => _mapper.MapToBuildDefinition(build)).ToList());
        }
Esempio n. 2
0
        public async Task <IList <Project> > GetProjects(AccountDetails accountDetails)
        {
            _restClient.SetBasicCredentials(accountDetails.EncodedCredentials);
            string         address     = VsoAddressHelper.GetFullAddress(accountDetails.AccountName, Constants.VsoProjectsAddress);
            VsoProjectList projectList = await _restClient.GetRequest <VsoProjectList>(null, address);

            return(projectList.Value.Select(project => _mapper.MapToProject(project)).ToList());
        }
Esempio n. 3
0
        public async Task <IList <Model.Build> > GetBuilds(AccountDetails accountDetails, IList <string> buildDefinitions)
        {
            _restClient.SetBasicCredentials(accountDetails.EncodedCredentials);
            string formattedBuildDefinitions = string.Join(",", buildDefinitions);

            string address = VsoAddressHelper.GetFullAddress(accountDetails.AccountName, string.Format(Constants.VsoBuildsAddress, accountDetails.ProjectId, formattedBuildDefinitions, NumberOfBuildsToCheck));

            Model.DTO.VsoBuildList buildList = await _restClient.GetRequest <Model.DTO.VsoBuildList>(null, address);

            return(buildList.Value.Select(record => _mapper.MapToBuild(record)).ToList());
        }