Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TA] Move action name to TextAnalyticsActionResult #22110

Merged
merged 1 commit into from
Jun 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ public AnalyzeSentimentAction(Azure.AI.TextAnalytics.AnalyzeSentimentOptions opt
public partial class AnalyzeSentimentActionResult : Azure.AI.TextAnalytics.TextAnalyticsActionResult
{
internal AnalyzeSentimentActionResult() { }
public string ActionName { get { throw null; } }
public Azure.AI.TextAnalytics.AnalyzeSentimentResultCollection DocumentsResults { get { throw null; } }
}
public partial class AnalyzeSentimentOptions : Azure.AI.TextAnalytics.TextAnalyticsRequestOptions
Expand Down Expand Up @@ -240,7 +239,6 @@ public ExtractKeyPhrasesAction(Azure.AI.TextAnalytics.TextAnalyticsRequestOption
public partial class ExtractKeyPhrasesActionResult : Azure.AI.TextAnalytics.TextAnalyticsActionResult
{
internal ExtractKeyPhrasesActionResult() { }
public string ActionName { get { throw null; } }
public Azure.AI.TextAnalytics.ExtractKeyPhrasesResultCollection DocumentsResults { get { throw null; } }
}
public partial class ExtractKeyPhrasesResult : Azure.AI.TextAnalytics.TextAnalyticsResult
Expand Down Expand Up @@ -622,7 +620,6 @@ public RecognizeEntitiesAction(Azure.AI.TextAnalytics.TextAnalyticsRequestOption
public partial class RecognizeEntitiesActionResult : Azure.AI.TextAnalytics.TextAnalyticsActionResult
{
internal RecognizeEntitiesActionResult() { }
public string ActionName { get { throw null; } }
public Azure.AI.TextAnalytics.RecognizeEntitiesResultCollection DocumentsResults { get { throw null; } }
}
public partial class RecognizeEntitiesResult : Azure.AI.TextAnalytics.TextAnalyticsResult
Expand All @@ -647,7 +644,6 @@ public RecognizeLinkedEntitiesAction(Azure.AI.TextAnalytics.TextAnalyticsRequest
public partial class RecognizeLinkedEntitiesActionResult : Azure.AI.TextAnalytics.TextAnalyticsActionResult
{
internal RecognizeLinkedEntitiesActionResult() { }
public string ActionName { get { throw null; } }
public Azure.AI.TextAnalytics.RecognizeLinkedEntitiesResultCollection DocumentsResults { get { throw null; } }
}
public partial class RecognizeLinkedEntitiesResult : Azure.AI.TextAnalytics.TextAnalyticsResult
Expand All @@ -674,7 +670,6 @@ public RecognizePiiEntitiesAction(Azure.AI.TextAnalytics.RecognizePiiEntitiesOpt
public partial class RecognizePiiEntitiesActionResult : Azure.AI.TextAnalytics.TextAnalyticsActionResult
{
internal RecognizePiiEntitiesActionResult() { }
public string ActionName { get { throw null; } }
public Azure.AI.TextAnalytics.RecognizePiiEntitiesResultCollection DocumentsResults { get { throw null; } }
}
public partial class RecognizePiiEntitiesOptions : Azure.AI.TextAnalytics.TextAnalyticsRequestOptions
Expand Down Expand Up @@ -735,6 +730,7 @@ public readonly partial struct TargetSentiment
public partial class TextAnalyticsActionResult
{
internal TextAnalyticsActionResult() { }
public string ActionName { get { throw null; } }
public System.DateTimeOffset CompletedOn { get { throw null; } }
public Azure.AI.TextAnalytics.TextAnalyticsError Error { get { throw null; } }
public bool HasError { get { throw null; } }
Expand Down Expand Up @@ -937,8 +933,6 @@ public static partial class TextAnalyticsModelFactory
public static Azure.AI.TextAnalytics.SentenceSentiment SentenceSentiment(Azure.AI.TextAnalytics.TextSentiment sentiment, string text, double positiveScore, double neutralScore, double negativeScore, int offset, int length, System.Collections.Generic.IEnumerable<Azure.AI.TextAnalytics.SentenceOpinion> opinions) { throw null; }
public static Azure.AI.TextAnalytics.SentimentConfidenceScores SentimentConfidenceScores(double positiveScore, double neutralScore, double negativeScore) { throw null; }
public static Azure.AI.TextAnalytics.TargetSentiment TargetSentiment(Azure.AI.TextAnalytics.TextSentiment sentiment, string text, double positiveScore, double negativeScore, int offset, int length) { throw null; }
public static Azure.AI.TextAnalytics.TextAnalyticsActionResult TextAnalyticsActionResult(System.DateTimeOffset completedOn) { throw null; }
public static Azure.AI.TextAnalytics.TextAnalyticsActionResult TextAnalyticsActionResult(System.DateTimeOffset completedOn, string code, string message) { throw null; }
public static Azure.AI.TextAnalytics.TextAnalyticsError TextAnalyticsError(string code, string message, string target = null) { throw null; }
public static Azure.AI.TextAnalytics.TextAnalyticsWarning TextAnalyticsWarning(string code, string message) { throw null; }
public static Azure.AI.TextAnalytics.TextDocumentBatchStatistics TextDocumentBatchStatistics(int documentCount, int validDocumentCount, int invalidDocumentCount, long transactionCount) { throw null; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,16 @@ public class AnalyzeSentimentActionResult : TextAnalyticsActionResult
/// Successful action.
/// </summary>
internal AnalyzeSentimentActionResult(AnalyzeSentimentResultCollection result, string actionName, DateTimeOffset completedOn)
: base(completedOn)
: base(completedOn, actionName)
{
_documentsResults = result;
ActionName = actionName;
}

/// <summary>
/// Action with an error.
/// </summary>
internal AnalyzeSentimentActionResult(string actionName, DateTimeOffset completedOn, TextAnalyticsErrorInternal error)
: base(completedOn, error)
{
ActionName = actionName;
}
: base(completedOn, actionName, error) { }

/// <summary>
/// Gets the result of the execution of an <see cref="AnalyzeSentimentAction"/> per each input document.
Expand All @@ -46,10 +42,5 @@ public AnalyzeSentimentResultCollection DocumentsResults
return _documentsResults;
}
}

/// <summary>
/// Gets the name for this action.
/// </summary>
public string ActionName { get; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,16 @@ public class ExtractKeyPhrasesActionResult : TextAnalyticsActionResult
/// Successful action.
/// </summary>
internal ExtractKeyPhrasesActionResult(ExtractKeyPhrasesResultCollection result, string actionName, DateTimeOffset completedOn)
: base(completedOn)
: base(completedOn, actionName)
{
_documentsResults = result;
ActionName = actionName;
}

/// <summary>
/// Action with an error.
/// </summary>
internal ExtractKeyPhrasesActionResult(string actionName, DateTimeOffset completedOn, TextAnalyticsErrorInternal error)
: base(completedOn, error)
{
ActionName = actionName;
}
: base(completedOn, actionName, error) { }

/// <summary>
/// Gets the result of the execution of an <see cref="ExtractKeyPhrasesAction"/> per each input document.
Expand All @@ -48,10 +44,5 @@ public ExtractKeyPhrasesResultCollection DocumentsResults
return _documentsResults;
}
}

/// <summary>
/// Gets the name for this action.
/// </summary>
public string ActionName { get; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,16 @@ public class RecognizeEntitiesActionResult : TextAnalyticsActionResult
/// Successful action.
/// </summary>
internal RecognizeEntitiesActionResult(RecognizeEntitiesResultCollection result, string actionName, DateTimeOffset completedOn)
: base(completedOn)
: base(completedOn, actionName)
{
_documentsResults = result;
ActionName = actionName;
}

/// <summary>
/// Action with an error.
/// </summary>
internal RecognizeEntitiesActionResult(string actionName, DateTimeOffset completedOn, TextAnalyticsErrorInternal error)
: base(completedOn, error)
{
ActionName = actionName;
}
: base(completedOn, actionName, error) { }

/// <summary>
/// Gets the result of the execution of a <see cref="RecognizeEntitiesAction"/> per each input document.
Expand All @@ -48,10 +44,5 @@ public RecognizeEntitiesResultCollection DocumentsResults
return _documentsResults;
}
}

/// <summary>
/// Gets the name for this action.
/// </summary>
public string ActionName { get; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,16 @@ public class RecognizeLinkedEntitiesActionResult : TextAnalyticsActionResult
/// Successful action.
/// </summary>
internal RecognizeLinkedEntitiesActionResult(RecognizeLinkedEntitiesResultCollection result, string actionName, DateTimeOffset completedOn)
: base(completedOn)
: base(completedOn, actionName)
{
_documentsResults = result;
ActionName = actionName;
}

/// <summary>
/// Action with an error.
/// </summary>
internal RecognizeLinkedEntitiesActionResult(string actionName, DateTimeOffset completedOn, TextAnalyticsErrorInternal error)
: base(completedOn, error)
{
ActionName = actionName;
}
: base(completedOn, actionName, error) { }

/// <summary>
/// Gets the result of the execution of a <see cref="RecognizeLinkedEntitiesAction"/> per each input document.
Expand All @@ -48,10 +44,5 @@ public RecognizeLinkedEntitiesResultCollection DocumentsResults
return _documentsResults;
}
}

/// <summary>
/// Gets the name for this action.
/// </summary>
public string ActionName { get; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,16 @@ public class RecognizePiiEntitiesActionResult : TextAnalyticsActionResult
/// Successful action.
/// </summary>
internal RecognizePiiEntitiesActionResult(RecognizePiiEntitiesResultCollection result, string actionName, DateTimeOffset completedOn)
: base(completedOn)
: base(completedOn, actionName)
{
_documentsResults = result;
ActionName = actionName;
}

/// <summary>
/// Action with an error.
/// </summary>
internal RecognizePiiEntitiesActionResult(string actionName, DateTimeOffset completedOn, TextAnalyticsErrorInternal error)
: base(completedOn, error)
{
ActionName = actionName;
}
: base(completedOn, actionName, error) { }

/// <summary>
/// Gets the result of the execution of a <see cref="RecognizePiiEntitiesAction"/> per each input document.
Expand All @@ -48,10 +44,5 @@ public RecognizePiiEntitiesResultCollection DocumentsResults
return _documentsResults;
}
}

/// <summary>
/// Gets the name for this action.
/// </summary>
public string ActionName { get; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,29 @@ namespace Azure.AI.TextAnalytics
/// </summary>
public class TextAnalyticsActionResult
{
internal TextAnalyticsActionResult (DateTimeOffset completedOn, TextAnalyticsErrorInternal error)
internal TextAnalyticsActionResult (DateTimeOffset completedOn, string actionName, TextAnalyticsErrorInternal error)
{
CompletedOn = completedOn;
ActionName = actionName;
Error = error != null ? Transforms.ConvertToError(error) : default;
}

internal TextAnalyticsActionResult(DateTimeOffset completedOn)
internal TextAnalyticsActionResult(DateTimeOffset completedOn, string actionName)
{
CompletedOn = completedOn;
ActionName = actionName;
}

/// <summary>
/// Indicates the time at which the action was last updated on.
/// </summary>
public DateTimeOffset CompletedOn { get; }

/// <summary>
/// Gets the name for this action.
/// </summary>
public string ActionName { get; }

/// <summary>
/// Determines the TextAnalyticsError object for an action result.
/// </summary>
Expand Down
Loading