Skip to content

Commit

Permalink
Adding custom non-batched return types for non-batch calls (Azure#6992)
Browse files Browse the repository at this point in the history
  • Loading branch information
assafi authored and AlexGhiondea committed Jul 24, 2019
1 parent 4839ca2 commit fcae227
Show file tree
Hide file tree
Showing 10 changed files with 340 additions and 51 deletions.
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; }
}
}
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; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
namespace Microsoft.Azure.CognitiveServices.Language.TextAnalytics.Models
{
using Newtonsoft.Json;
using System.Linq;

public partial class LanguageInput
{
Expand Down
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; }

}
}
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; }
}
}
Loading

0 comments on commit fcae227

Please sign in to comment.