Rename Feedser to Concelier
This commit is contained in:
		
							
								
								
									
										46
									
								
								src/StellaOps.Concelier.Exporter.Json/JsonExportResult.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										46
									
								
								src/StellaOps.Concelier.Exporter.Json/JsonExportResult.cs
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,46 @@
 | 
			
		||||
using System;
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
using System.Collections.Immutable;
 | 
			
		||||
using System.Linq;
 | 
			
		||||
 | 
			
		||||
namespace StellaOps.Concelier.Exporter.Json;
 | 
			
		||||
 | 
			
		||||
public sealed class JsonExportResult
 | 
			
		||||
{
 | 
			
		||||
    public JsonExportResult(
 | 
			
		||||
        string exportDirectory,
 | 
			
		||||
        DateTimeOffset exportedAt,
 | 
			
		||||
        IEnumerable<JsonExportFile> files,
 | 
			
		||||
        int advisoryCount,
 | 
			
		||||
        long totalBytes)
 | 
			
		||||
    {
 | 
			
		||||
        if (string.IsNullOrWhiteSpace(exportDirectory))
 | 
			
		||||
        {
 | 
			
		||||
            throw new ArgumentException("Export directory must be provided.", nameof(exportDirectory));
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        ExportDirectory = exportDirectory;
 | 
			
		||||
        ExportedAt = exportedAt;
 | 
			
		||||
        AdvisoryCount = advisoryCount;
 | 
			
		||||
        TotalBytes = totalBytes;
 | 
			
		||||
 | 
			
		||||
        var list = (files ?? throw new ArgumentNullException(nameof(files)))
 | 
			
		||||
            .Where(static file => file is not null)
 | 
			
		||||
            .ToImmutableArray();
 | 
			
		||||
 | 
			
		||||
        Files = list;
 | 
			
		||||
        FilePaths = list.Select(static file => file.RelativePath).ToImmutableArray();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public string ExportDirectory { get; }
 | 
			
		||||
 | 
			
		||||
    public DateTimeOffset ExportedAt { get; }
 | 
			
		||||
 | 
			
		||||
    public ImmutableArray<JsonExportFile> Files { get; }
 | 
			
		||||
 | 
			
		||||
    public ImmutableArray<string> FilePaths { get; }
 | 
			
		||||
 | 
			
		||||
    public int AdvisoryCount { get; }
 | 
			
		||||
 | 
			
		||||
    public long TotalBytes { get; }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user