forked from Azure/azure-sdk-for-net
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding custom non-batched return types for non-batch calls (Azure#6992)
- Loading branch information
1 parent
4839ca2
commit fcae227
Showing
10 changed files
with
340 additions
and
51 deletions.
There are no files selected for viewing
62 changes: 62 additions & 0 deletions
62
...services/Language.TextAnalytics/src/Customizations/TextAnalytics/Models/EntitiesResult.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See License.txt in the project root for | ||
// license information. | ||
// | ||
|
||
namespace Microsoft.Azure.CognitiveServices.Language.TextAnalytics.Models | ||
{ | ||
using System.Collections.Generic; | ||
using Newtonsoft.Json; | ||
|
||
public partial class EntitiesResult | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the EntitiesResult class. | ||
/// </summary> | ||
public EntitiesResult() | ||
{ | ||
CustomInit(); | ||
} | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the EntitiesResult class. | ||
/// </summary> | ||
/// <param name="entities">Recognized entities in the document.</param> | ||
/// <param name="errorMessage">Error or Warning related to the document.</param> | ||
/// <param name="statistics">(Optional) if showStats=true was specified | ||
/// in the request this field will contain information about the | ||
/// request payload.</param> | ||
public EntitiesResult(IList<EntityRecord> entities = default(IList<EntityRecord>), string errorMessage = default(string), RequestStatistics statistics = default(RequestStatistics)) | ||
{ | ||
Entities = entities; | ||
ErrorMessage = errorMessage; | ||
Statistics = statistics; | ||
CustomInit(); | ||
} | ||
|
||
/// <summary> | ||
/// An initialization method that performs custom operations like setting defaults | ||
/// </summary> | ||
partial void CustomInit(); | ||
|
||
/// <summary> | ||
/// Gets recognized entities in the document. | ||
/// </summary> | ||
[JsonProperty(PropertyName = "entities")] | ||
public IList<EntityRecord> Entities { get; private set; } | ||
|
||
/// <summary> | ||
/// Gets error or warning for the request. | ||
/// </summary> | ||
[JsonProperty(PropertyName = "ErrorMessage")] | ||
public string ErrorMessage { get; private set; } | ||
|
||
/// <summary> | ||
/// Gets (Optional) if showStats=true was specified in the request this | ||
/// field will contain information about the request payload. | ||
/// </summary> | ||
[JsonProperty(PropertyName = "statistics")] | ||
public RequestStatistics Statistics { get; set; } | ||
} | ||
} |
67 changes: 67 additions & 0 deletions
67
...ervices/Language.TextAnalytics/src/Customizations/TextAnalytics/Models/KeyPhraseResult.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
// | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See License.txt in the project root for | ||
// license information. | ||
// | ||
|
||
namespace Microsoft.Azure.CognitiveServices.Language.TextAnalytics.Models | ||
{ | ||
using System.Collections.Generic; | ||
using Newtonsoft.Json; | ||
|
||
public partial class KeyPhraseResult | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the KeyPhraseResult class. | ||
/// </summary> | ||
public KeyPhraseResult() | ||
{ | ||
CustomInit(); | ||
} | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the KeyPhraseResult class. | ||
/// </summary> | ||
/// <param name="keyPhrases">A list of representative words or phrases. | ||
/// The number of key phrases returned is proportional to the number of | ||
/// words in the input document.</param> | ||
/// <param name="errorMessage">Error or Warning related to the document.</param> | ||
/// <param name="statistics">(Optional) if showStats=true was specified | ||
/// in the request this field will contain information about the | ||
/// request payload.</param> | ||
public KeyPhraseResult(IList<string> keyPhrases = default(IList<string>), string errorMessage = default(string), RequestStatistics statistics = default(RequestStatistics)) | ||
{ | ||
KeyPhrases = keyPhrases; | ||
ErrorMessage = errorMessage; | ||
Statistics = statistics; | ||
CustomInit(); | ||
} | ||
|
||
|
||
/// <summary> | ||
/// An initialization method that performs custom operations like setting defaults | ||
/// </summary> | ||
partial void CustomInit(); | ||
|
||
/// <summary> | ||
/// Gets a list of representative words or phrases. The number of key | ||
/// phrases returned is proportional to the number of words in the | ||
/// input document. | ||
/// </summary> | ||
[JsonProperty(PropertyName = "keyPhrases")] | ||
public IList<string> KeyPhrases { get; private set; } | ||
|
||
/// <summary> | ||
/// Gets error or warning for the request. | ||
/// </summary> | ||
[JsonProperty(PropertyName = "ErrorMessage")] | ||
public string ErrorMessage { get; private set; } | ||
|
||
/// <summary> | ||
/// Gets (Optional) if showStats=true was specified in the request this | ||
/// field will contain information about the request payload. | ||
/// </summary> | ||
[JsonProperty(PropertyName = "statistics")] | ||
public RequestStatistics Statistics { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
...services/Language.TextAnalytics/src/Customizations/TextAnalytics/Models/LanguageResult.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
// | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See License.txt in the project root for | ||
// license information. | ||
// | ||
|
||
namespace Microsoft.Azure.CognitiveServices.Language.TextAnalytics.Models | ||
{ | ||
using Newtonsoft.Json; | ||
using System.Collections.Generic; | ||
|
||
public partial class LanguageResult | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the LanguageResult class. | ||
/// </summary> | ||
public LanguageResult() | ||
{ | ||
CustomInit(); | ||
} | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the LanguageResult class. | ||
/// </summary> | ||
/// <param name="detectedLanguages">A list of extracted languages.</param> | ||
/// <param name="errorMessage">Error or Warning related to the document.</param> | ||
/// <param name="statistics">(Optional) if showStats=true was specified | ||
/// in the request this field will contain information about the | ||
/// request payload.</param> | ||
public LanguageResult(IList<DetectedLanguage> detectedLanguages = default(IList<DetectedLanguage>), string errorMessage = default(string), RequestStatistics statistics = default(RequestStatistics)) | ||
{ | ||
DetectedLanguages = detectedLanguages; | ||
ErrorMessage = errorMessage; | ||
Statistics = statistics; | ||
CustomInit(); | ||
} | ||
|
||
/// <summary> | ||
/// An initialization method that performs custom operations like setting defaults | ||
/// </summary> | ||
partial void CustomInit(); | ||
|
||
/// <summary> | ||
/// Gets or sets a list of extracted languages. | ||
/// </summary> | ||
[JsonProperty(PropertyName = "detectedLanguages")] | ||
public IList<DetectedLanguage> DetectedLanguages { get; set; } | ||
|
||
/// <summary> | ||
/// Gets error or warning for the request. | ||
/// </summary> | ||
[JsonProperty(PropertyName = "ErrorMessage")] | ||
public string ErrorMessage { get; private set; } | ||
|
||
/// <summary> | ||
/// Gets (Optional) if showStats=true was specified in the request this | ||
/// field will contain information about the request payload. | ||
/// </summary> | ||
[JsonProperty(PropertyName = "statistics")] | ||
public RequestStatistics Statistics { get; private set; } | ||
|
||
} | ||
} |
67 changes: 67 additions & 0 deletions
67
...ervices/Language.TextAnalytics/src/Customizations/TextAnalytics/Models/SentimentResult.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
// | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See License.txt in the project root for | ||
// license information. | ||
// | ||
|
||
namespace Microsoft.Azure.CognitiveServices.Language.TextAnalytics.Models | ||
{ | ||
using Newtonsoft.Json; | ||
|
||
public partial class SentimentResult | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the SentimentResult class. | ||
/// </summary> | ||
public SentimentResult() | ||
{ | ||
CustomInit(); | ||
} | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the SentimentResult class. | ||
/// </summary> | ||
/// <param name="score">A decimal number between 0 and 1 denoting the | ||
/// sentiment of the document. A score above 0.7 usually refers to a | ||
/// positive document while a score below 0.3 normally has a negative | ||
/// connotation. Mid values refer to neutral text.</param> | ||
/// <param name="errorMessage">Error or Warning related to the document.</param> | ||
/// <param name="statistics">(Optional) if showStats=true was specified | ||
/// in the request this field will contain information about the | ||
/// request payload.</param> | ||
public SentimentResult(double? score = default(double?), string errorMessage = default(string), RequestStatistics statistics = default(RequestStatistics)) | ||
{ | ||
Score = score; | ||
ErrorMessage = errorMessage; | ||
Statistics = statistics; | ||
CustomInit(); | ||
} | ||
|
||
/// <summary> | ||
/// An initialization method that performs custom operations like setting defaults | ||
/// </summary> | ||
partial void CustomInit(); | ||
|
||
/// <summary> | ||
/// Gets or sets a decimal number between 0 and 1 denoting the | ||
/// sentiment of the document. A score above 0.7 usually refers to a | ||
/// positive document while a score below 0.3 normally has a negative | ||
/// connotation. Mid values refer to neutral text. | ||
/// </summary> | ||
[JsonProperty(PropertyName = "score")] | ||
public double? Score { get; set; } | ||
|
||
/// <summary> | ||
/// Gets error or warning for the request. | ||
/// </summary> | ||
[JsonProperty(PropertyName = "ErrorMessage")] | ||
public string ErrorMessage { get; private set; } | ||
|
||
/// <summary> | ||
/// Gets (Optional) if showStats=true was specified in the request this | ||
/// field will contain information about the request payload. | ||
/// </summary> | ||
[JsonProperty(PropertyName = "statistics")] | ||
public RequestStatistics Statistics { get; set; } | ||
} | ||
} |
Oops, something went wrong.