protected override void ProcessRecord() { BaseParameters = new Dictionary <string, string> { { "BranchName", BranchName }, { "RepositoryId", RepositoryId }, { "RepositoryType", RepositoryType }, { "ResultFilter", ResultFilter }, { "MinTime", MinTime?.ToString() } }; var parameters = new ParallelRequestParams( "BranchName", BranchNames, BaseParameters ); var requestTasks = ParallelRequestAsync(VssAuthenticator.AzureDevOpsBuildsHost, "DefaultCollection/One/_apis/build/builds", parameters); WriteObject(requestTasks.Result); }
protected override void ProcessRecord() { BaseParameters = new Dictionary <string, string> { { "SourceId", SourceId }, { "ArtifactTypeId", ArtifactTypeId }, { "ArtifactVersionId", ArtifactVersionId }, { "MaxCreatedTime", MaxCreatedTime?.ToString() }, { "MinCreatedTime", MinCreatedTime?.ToString() }, { "DefinitionId", DefinitionId?.ToString() }, { "QueryOrder", QueryOrder }, { "$Expand", ExpandProperties != null?string.Join(",", ExpandProperties) : null } }; var parameters = new ParallelRequestParams( "ArtifactVersionId", ArtifactVersionIds, BaseParameters ); var requestTasks = ParallelRequestAsync(VssAuthenticator.AzureDevOpsHost, "DefaultCollection/One/_apis/release/releases", parameters); WriteObject(requestTasks.Result); }
public async Task <string[]> ParallelRequestAsync(string host, string apiSubPath, ParallelRequestParams parallelParams) { var requestTasks = parallelParams.GenerateArguments(). Select(requestArgs => RequestHelper.BuildRequestUri(host, apiSubPath, requestArgs)). Select(async requestUri => await RequestHelper.SendRequestAsync(requestUri)); return(await Task.WhenAll(requestTasks)); }