/// <summary> /// Execute example /// </summary> /// <param name="cancellationToken">The cancellation token</param> /// <returns>The task</returns> public async Task Execute(CancellationToken cancellationToken) { var integrationExportId = Guid.Parse("64064995-E24B-4C38-8DCA-DD32C29793AB"); var request = new AcceptIntegrationExportV1Request { IntegrationExportId = integrationExportId, }; var response = await _client .Execute(request, cancellationToken) .ThrowIfFailed() .ConfigureAwait(Await.Default); Require.NotNull(response, nameof(response)); }
/// <summary> /// Handle command /// </summary> /// <param name="command">The command</param> /// <param name="cancellationToken">The cancellation token</param> /// <returns>The response</returns> public async Task <DownloadIntegrationExportCommandResult> Handle( DownloadIntegrationExportCommand command, CancellationToken cancellationToken) { Argument.NotNull(command, nameof(command)); DownloadIntegrationExportCommandResult commandResult; var request = new AcceptIntegrationExportV1Request { IntegrationExportId = command.IntegrationExportId, }; var response = await _client .Execute(request, cancellationToken) .ConfigureAwait(Await.Default); if (response.IsSuccessful) { command.IntegrationExportLogId = response.Model.IntegrationExportLogId; commandResult = await _handler .Handle(command, cancellationToken) .ConfigureAwait(Await.Default); } else { commandResult = new DownloadIntegrationExportCommandResult { Success = false, Message = "Error accepting integration export", }; } return(commandResult); }