/
TextAnalyticsActionResult.cs
47 lines (40 loc) · 1.49 KB
/
TextAnalyticsActionResult.cs
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
41
42
43
44
45
46
47
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using Azure.AI.TextAnalytics.Models;
namespace Azure.AI.TextAnalytics
{
/// <summary>
/// Base type for results of Text Analytics Actions executed in a set of documents.
/// </summary>
public class TextAnalyticsActionResult
{
internal TextAnalyticsActionResult(string actionName, DateTimeOffset completedOn, Error error)
{
ActionName = actionName;
CompletedOn = completedOn;
Error = error != null ? Transforms.ConvertToError(error) : default;
}
internal TextAnalyticsActionResult(string actionName, DateTimeOffset completedOn)
{
ActionName = actionName;
CompletedOn = completedOn;
}
/// <summary>
/// Indicates the time at which the action was last updated on.
/// </summary>
public DateTimeOffset CompletedOn { get; }
/// <summary>
/// Determines the TextAnalyticsError object for an action result.
/// </summary>
public TextAnalyticsError Error { get; }
/// <summary>
/// Indicates that the document was not successfully processed and an error was returned for this document.
/// </summary>
public bool HasError => Error.ErrorCode != default;
/// <summary>
/// Gets the name for this action.
/// </summary>
public string ActionName { get; }
}
}