public override async Task <IEnumerable <string> > EnumerateValuesAsync(ValueEnumerationContext context)
        {
            var credentials = ResourceCredentials.Create <TeamCityCredentials>(this.CredentialName);

            using (var client = new TeamCityWebClient(credentials))
            {
                return(await client.GetBuildTypeNamesAsync(this.ProjectName).ConfigureAwait(false));
            }
        }
        public async Task <IEnumerable <string> > GetSuggestionsAsync(IComponentConfiguration config)
        {
            var credentialName = config["CredentialName"];

            if (string.IsNullOrEmpty(credentialName))
            {
                return(Enumerable.Empty <string>());
            }

            var projectName = config["ProjectName"];

            if (string.IsNullOrEmpty(projectName))
            {
                return(Enumerable.Empty <string>());
            }

            var credentials = ResourceCredentials.Create <TeamCityCredentials>(credentialName);

            using (var client = new TeamCityWebClient(credentials))
            {
                return(await client.GetBuildTypeNamesAsync(projectName).ConfigureAwait(false));
            }
        }