forked from dotnet/extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIngestionResult.cs
More file actions
40 lines (33 loc) · 1.18 KB
/
IngestionResult.cs
File metadata and controls
40 lines (33 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using Microsoft.Shared.Diagnostics;
namespace Microsoft.Extensions.DataIngestion;
/// <summary>
/// Represents the result of an ingestion operation.
/// </summary>
public sealed class IngestionResult
{
/// <summary>
/// Gets the ID of the document that was ingested.
/// </summary>
public string DocumentId { get; }
/// <summary>
/// Gets the ingestion document created from the source file, if reading the document has succeeded.
/// </summary>
public IngestionDocument? Document { get; }
/// <summary>
/// Gets the exception that occurred during ingestion, if any.
/// </summary>
public Exception? Exception { get; }
/// <summary>
/// Gets a value indicating whether the ingestion succeeded.
/// </summary>
public bool Succeeded => Exception is null;
internal IngestionResult(string documentId, IngestionDocument? document, Exception? exception)
{
DocumentId = Throw.IfNullOrEmpty(documentId);
Document = document;
Exception = exception;
}
}