public async Task <int> Handle(PublishCommand cmd) { this.Initialize(cmd); using var httpClient = new HttpClient(); var gatewayAutomation = new GatewayAutomation(httpClient, this.logicTokenProviderFactory, this.gatewayOptions); var results = await gatewayAutomation.PublishAsync(cmd.FolderPath).ConfigureAwait(false); this.outputFormatter.PrintResults(results); return(results.Any(result => result.IsError) ? 1 : 0); }
#pragma warning disable CA1801 // Remove unused parameter public async Task <int> Handle(PublishCommand cmd) #pragma warning restore CA1801 // Remove unused parameter { this.Initialize(cmd); using var httpClient = new HttpClient(); var gatewayAutomation = new GatewayAutomation(httpClient, this.logicTokenProviderFactory, this.gatewayOptions); var results = await gatewayAutomation.PublishAsync(cmd.FolderPath).ConfigureAwait(false); foreach (var result in results) { Console.WriteLine(result.ToString()); } return(0); }
private static async Task Run(AppConfiguration configuration) { var validator = new ConfigurationValidator(configuration); if (!validator.Validate()) { return; } using var httpClient = new HttpClient(); using var tokenProviderFactory = new LogicTokenProviderFactory(configuration.TokenProvider); var gatewayAutomation = new GatewayAutomation(httpClient, tokenProviderFactory, configuration.Gateway); var results = await gatewayAutomation.PublishAsync(configuration.FolderPath).ConfigureAwait(false); foreach (var result in results) { Console.WriteLine(result.ToString()); } }