diff --git a/eng/.docsettings.yml b/eng/.docsettings.yml
index b39012873099c..ca21a1741d9fc 100644
--- a/eng/.docsettings.yml
+++ b/eng/.docsettings.yml
@@ -120,6 +120,7 @@ known_content_issues:
- ['sdk/extensions/Microsoft.Azure.WebJobs.Extensions.Clients/README.md','azure-sdk-tools/issues/404']
- ['sdk/extensions/Microsoft.Extensions.Azure/README.md','azure-sdk-tools/issues/404']
- ['sdk/storage/Azure.Storage.Common/README.md','azure-sdk-tools/issues/404']
+ - ['sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/README.md','https://github.com/Azure/azure-sdk-tools/issues/404']
- ['sdk/webpubsub/Azure.Messaging.WebPubSub/README.md', 'azure-sdk-tools/issues/404 - requires different name for auth section']
- ['sdk/anomalydetector/Azure.AI.AnomalyDetector/README.md', '#25936: Needs Examples']
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/Azure.AI.TextAnalytics.Legacy.sln b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/Azure.AI.TextAnalytics.Legacy.sln
new file mode 100644
index 0000000000000..794ae8e24960b
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/Azure.AI.TextAnalytics.Legacy.sln
@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.28803.308
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.AI.TextAnalytics.Legacy", "src\Azure.AI.TextAnalytics.Legacy.csproj", "{25CE0676-8F2C-497B-8FB5-7DA41A31F6F9}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {25CE0676-8F2C-497B-8FB5-7DA41A31F6F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {25CE0676-8F2C-497B-8FB5-7DA41A31F6F9}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {25CE0676-8F2C-497B-8FB5-7DA41A31F6F9}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {25CE0676-8F2C-497B-8FB5-7DA41A31F6F9}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {F99E1793-076D-4060-A0BD-71ED8FA9050D}
+ EndGlobalSection
+EndGlobal
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/README.md b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/README.md
new file mode 100644
index 0000000000000..472b24a8eb0f7
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/README.md
@@ -0,0 +1,15 @@
+# Azure Cognitive Services Text Analytics code sharing library
+
+This library is intended to serve as a common location for non-public code for the legacy REST API that is used by the [Azure Cognitive Services Text Analytics client library for .NET](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/textanalytics/Azure.AI.TextAnalytics). The Text Analytics library includes these artifacts by shared links to enable them to be loosely hosted within those projects rather than consumed by direct project or package reference.
+
+## Contributing
+
+This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.
+
+When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
+
+This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
+
+Please see our [contributing guide](https://github.com/Azure/azure-sdk-for-net/blob/main/CONTRIBUTING.md) for more information.
+
+![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%textanalytics%2FAzure.AI.TextAnalytics.Legacy.Shared%2FREADME.png)
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Azure.AI.TextAnalytics.Legacy.csproj b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Azure.AI.TextAnalytics.Legacy.csproj
new file mode 100644
index 0000000000000..cd4335aae92b7
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Azure.AI.TextAnalytics.Legacy.csproj
@@ -0,0 +1,35 @@
+
+
+ Microsoft Azure.AI.TextAnalytics shared code library
+ 1.0.0
+ $(RequiredTargetFrameworks)
+ false
+ true
+ true
+ true
+
+
+
+
+ $(NoWarn);3021;AZC0012
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Custom/DocumentSentimentValue.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Custom/DocumentSentimentValue.cs
new file mode 100644
index 0000000000000..3f5a9e5356eea
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Custom/DocumentSentimentValue.cs
@@ -0,0 +1,21 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+using Azure.Core;
+
+namespace Azure.AI.TextAnalytics.Legacy.Models
+{
+ /// Predicted sentiment for document (Negative, Neutral, Positive, or Mixed).
+ [CodeGenModel("DocumentSentimentValue")]
+ internal enum DocumentSentimentValue
+ {
+ /// positive.
+ Positive,
+ /// neutral.
+ Neutral,
+ /// negative.
+ Negative,
+ /// mixed.
+ Mixed
+ }
+}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Custom/JobManifestTasks.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Custom/JobManifestTasks.cs
new file mode 100644
index 0000000000000..c2468344d8a52
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Custom/JobManifestTasks.cs
@@ -0,0 +1,60 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+using System.Collections.Generic;
+using Azure.Core;
+
+namespace Azure.AI.TextAnalytics.Legacy
+{
+ ///
+ /// JobManifestTasks.
+ ///
+ [CodeGenModel("JobManifestTasks")]
+ internal partial class JobManifestTasks
+ {
+ ///
+ /// EntityRecognitionTasks
+ ///
+ internal IList EntityRecognitionTasks { get; set; }
+
+ ///
+ /// EntityRecognitionPiiTasks
+ ///
+ internal IList EntityRecognitionPiiTasks { get; set; }
+
+ ///
+ /// KeyPhraseExtractionTasks
+ ///
+ internal IList KeyPhraseExtractionTasks { get; set; }
+
+ ///
+ /// EntityLinkingTasks
+ ///
+ internal IList EntityLinkingTasks { get; set; }
+
+ ///
+ /// SentimentAnalysisTasks
+ ///
+ internal IList SentimentAnalysisTasks { get; set; }
+
+ ///
+ /// ExtractiveSummarizationTasks
+ ///
+ public IList ExtractiveSummarizationTasks { get; set; }
+
+ ///
+ /// CustomEntityRecognitionTasks
+ ///
+ internal IList CustomEntityRecognitionTasks { get; set; }
+
+ ///
+ /// CustomSingleClassificationTasks
+ ///
+ internal IList CustomSingleClassificationTasks { get; set; }
+
+ ///
+ /// CustomMultiClassificationTasks
+ ///
+ internal IList CustomMultiClassificationTasks { get; set; }
+ }
+}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Custom/PiiEntity.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Custom/PiiEntity.cs
new file mode 100644
index 0000000000000..8aa6d8bb9019a
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Custom/PiiEntity.cs
@@ -0,0 +1,64 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+using Azure.AI.TextAnalytics.Legacy.Models;
+
+namespace Azure.AI.TextAnalytics.Legacy
+{
+ ///
+ /// A word or phrase identified as a Personally Identifiable Information
+ /// that can be categorized as known type in a given taxonomy.
+ /// The set of categories recognized by the Text Analytics service is described at
+ /// .
+ ///
+ internal readonly struct PiiEntity
+ {
+ internal PiiEntity(Entity entity)
+ {
+ Category = entity.Category;
+ Text = entity.Text;
+ SubCategory = entity.Subcategory;
+ ConfidenceScore = entity.ConfidenceScore;
+ Offset = entity.Offset;
+ Length = entity.Length;
+ }
+
+ ///
+ /// Gets the entity text as it appears in the input document.
+ ///
+ public string Text { get; }
+
+ ///
+ /// Gets the PII entity category inferred by the Text Analytics service's
+ /// named entity recognition model, such as Financial Account
+ /// Identification/Social Security Number/Phone Number, etc.
+ /// The list of available categories is described at
+ /// .
+ ///
+ public PiiEntityLegacyCategory Category { get; }
+
+ ///
+ /// Gets the sub category of the entity inferred by the Text Analytics service's
+ /// named entity recognition model. This property may not have a value if
+ /// a sub category doesn't exist for this entity. The list of available categories and
+ /// subcategories is described at .
+ ///
+ public string SubCategory { get; }
+
+ ///
+ /// Gets a score between 0 and 1, indicating the confidence that the
+ /// text substring matches this inferred entity.
+ ///
+ public double ConfidenceScore { get; }
+
+ ///
+ /// Gets the starting position for the matching text in the input document.
+ ///
+ public int Offset { get; }
+
+ ///
+ /// Gets the length of the matching text in the input document.
+ ///
+ public int Length { get; }
+ }
+}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Custom/PiiEntityDomain.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Custom/PiiEntityDomain.cs
new file mode 100644
index 0000000000000..1eb085219576e
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Custom/PiiEntityDomain.cs
@@ -0,0 +1,37 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+using System.Diagnostics.CodeAnalysis;
+
+namespace Azure.AI.TextAnalytics.Legacy
+{
+ ///
+ /// The different domains of PII entities that users can filter requests by.
+ ///
+ internal enum PiiEntityDomain
+ {
+ ///
+ /// Don't apply any domain filter. This is the default value.
+ ///
+ None,
+ ///
+ /// Protected Health Information entities.
+ /// For more information see .
+ ///
+ ProtectedHealthInformation
+ }
+
+ [SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1649:File name should match first type name", Justification = "Small extensions, good to keep here.")]
+ internal static class PiiEntityDomainExtensions
+ {
+ internal static string GetString(this PiiEntityDomain type)
+ {
+ return type switch
+ {
+ PiiEntityDomain.None => null,
+ PiiEntityDomain.ProtectedHealthInformation => "phi",
+ _ => null,
+ };
+ }
+ }
+}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Custom/PiiTaskParameters.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Custom/PiiTaskParameters.cs
new file mode 100644
index 0000000000000..0f41ed43ac05d
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Custom/PiiTaskParameters.cs
@@ -0,0 +1,19 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+using System.Collections.Generic;
+using Azure.AI.TextAnalytics.Legacy.Models;
+using Azure.Core;
+
+namespace Azure.AI.TextAnalytics.Legacy
+{
+ ///
+ /// PiiTaskParameters class.
+ ///
+ [CodeGenModel("PiiTaskParameters")]
+ internal partial class PiiTaskParameters
+ {
+ /// (Optional) describes the PII categories to return.
+ public IList PiiCategories { get; set; }
+ }
+}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Custom/SentenceSentimentValue.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Custom/SentenceSentimentValue.cs
new file mode 100644
index 0000000000000..87ea1e6318029
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Custom/SentenceSentimentValue.cs
@@ -0,0 +1,19 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+using Azure.Core;
+
+namespace Azure.AI.TextAnalytics.Legacy.Models
+{
+ /// The predicted Sentiment for the sentence.
+ [CodeGenModel("SentenceSentimentValue")]
+ internal enum SentenceSentimentValue
+ {
+ /// positive.
+ Positive,
+ /// neutral.
+ Neutral,
+ /// negative.
+ Negative
+ }
+}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Custom/TargetRelationType.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Custom/TargetRelationType.cs
new file mode 100644
index 0000000000000..6b7bc16ad0ae2
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Custom/TargetRelationType.cs
@@ -0,0 +1,17 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+using Azure.Core;
+
+namespace Azure.AI.TextAnalytics.Legacy.Models
+{
+ /// The type related to the target.
+ [CodeGenModel("TargetRelationType")]
+ internal enum TargetRelationType
+ {
+ /// assessment.
+ Assessment,
+ /// target.
+ Target
+ }
+}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Custom/TokenSentimentValue.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Custom/TokenSentimentValue.cs
new file mode 100644
index 0000000000000..a0ef210bd7f5e
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Custom/TokenSentimentValue.cs
@@ -0,0 +1,20 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+using Azure.Core;
+
+namespace Azure.AI.TextAnalytics.Legacy.Models
+{
+ /// Targeted sentiment in the sentence.
+ [CodeGenModel("TokenSentimentValue")]
+ internal enum TokenSentimentValue
+ {
+ /// positive.
+ Positive,
+ /// mixed.
+ Mixed,
+ /// negative.
+ Negative
+ }
+}
+/**/
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/AnalysisInput.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/AnalysisInput.Serialization.cs
similarity index 93%
rename from sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/AnalysisInput.Serialization.cs
rename to sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/AnalysisInput.Serialization.cs
index 5db4b3351a9cf..ba7c61e91ae7d 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/AnalysisInput.Serialization.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/AnalysisInput.Serialization.cs
@@ -8,7 +8,7 @@
using System.Text.Json;
using Azure.Core;
-namespace Azure.AI.TextAnalytics.Models
+namespace Azure.AI.TextAnalytics.Legacy
{
internal partial class AnalysisInput : IUtf8JsonSerializable
{
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/AnalysisInput.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/AnalysisInput.cs
similarity index 96%
rename from sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/AnalysisInput.cs
rename to sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/AnalysisInput.cs
index 84d977f959c02..b367d9dbe858b 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/AnalysisInput.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/AnalysisInput.cs
@@ -7,7 +7,7 @@
using System;
-namespace Azure.AI.TextAnalytics.Models
+namespace Azure.AI.TextAnalytics.Legacy
{
/// The AnalysisInput.
internal partial class AnalysisInput
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/AnalyzeBatchInput.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/AnalyzeBatchInput.Serialization.cs
similarity index 95%
rename from sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/AnalyzeBatchInput.Serialization.cs
rename to sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/AnalyzeBatchInput.Serialization.cs
index d2e689818569e..f860478f0a86f 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/AnalyzeBatchInput.Serialization.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/AnalyzeBatchInput.Serialization.cs
@@ -8,7 +8,7 @@
using System.Text.Json;
using Azure.Core;
-namespace Azure.AI.TextAnalytics.Models
+namespace Azure.AI.TextAnalytics.Legacy
{
internal partial class AnalyzeBatchInput : IUtf8JsonSerializable
{
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/AnalyzeBatchInput.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/AnalyzeBatchInput.cs
similarity index 95%
rename from sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/AnalyzeBatchInput.cs
rename to sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/AnalyzeBatchInput.cs
index af773043f6a11..0622ef850b0b3 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/AnalyzeBatchInput.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/AnalyzeBatchInput.cs
@@ -6,9 +6,8 @@
#nullable disable
using System;
-using Azure.AI.TextAnalytics;
-namespace Azure.AI.TextAnalytics.Models
+namespace Azure.AI.TextAnalytics.Legacy
{
/// The AnalyzeBatchInput.
internal partial class AnalyzeBatchInput : JobDescriptor
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/AnalyzeJobDisplayName.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/AnalyzeJobDisplayName.Serialization.cs
similarity index 94%
rename from sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/AnalyzeJobDisplayName.Serialization.cs
rename to sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/AnalyzeJobDisplayName.Serialization.cs
index 3a52ced6af9a6..c3d707eaeec89 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/AnalyzeJobDisplayName.Serialization.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/AnalyzeJobDisplayName.Serialization.cs
@@ -8,7 +8,7 @@
using System.Text.Json;
using Azure.Core;
-namespace Azure.AI.TextAnalytics.Models
+namespace Azure.AI.TextAnalytics.Legacy
{
internal partial class AnalyzeJobDisplayName
{
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/AnalyzeJobDisplayName.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/AnalyzeJobDisplayName.cs
similarity index 94%
rename from sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/AnalyzeJobDisplayName.cs
rename to sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/AnalyzeJobDisplayName.cs
index 51897d07705c5..9484a20040718 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/AnalyzeJobDisplayName.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/AnalyzeJobDisplayName.cs
@@ -5,7 +5,7 @@
#nullable disable
-namespace Azure.AI.TextAnalytics.Models
+namespace Azure.AI.TextAnalytics.Legacy
{
/// The AnalyzeJobDisplayName.
internal partial class AnalyzeJobDisplayName
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/AnalyzeJobErrorsAndStatistics.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/AnalyzeJobErrorsAndStatistics.Serialization.cs
similarity index 72%
rename from sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/AnalyzeJobErrorsAndStatistics.Serialization.cs
rename to sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/AnalyzeJobErrorsAndStatistics.Serialization.cs
index 01d0269a1d757..64a87f7724371 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/AnalyzeJobErrorsAndStatistics.Serialization.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/AnalyzeJobErrorsAndStatistics.Serialization.cs
@@ -7,17 +7,16 @@
using System.Collections.Generic;
using System.Text.Json;
-using Azure.AI.TextAnalytics;
using Azure.Core;
-namespace Azure.AI.TextAnalytics.Models
+namespace Azure.AI.TextAnalytics.Legacy
{
internal partial class AnalyzeJobErrorsAndStatistics
{
internal static AnalyzeJobErrorsAndStatistics DeserializeAnalyzeJobErrorsAndStatistics(JsonElement element)
{
- Optional> errors = default;
- Optional statistics = default;
+ Optional> errors = default;
+ Optional statistics = default;
foreach (var property in element.EnumerateObject())
{
if (property.NameEquals("errors"))
@@ -27,10 +26,10 @@ internal static AnalyzeJobErrorsAndStatistics DeserializeAnalyzeJobErrorsAndStat
property.ThrowNonNullablePropertyIsNull();
continue;
}
- List array = new List();
+ List array = new List();
foreach (var item in property.Value.EnumerateArray())
{
- array.Add(TextAnalyticsErrorInternal.DeserializeTextAnalyticsErrorInternal(item));
+ array.Add(TextAnalyticsError.DeserializeTextAnalyticsError(item));
}
errors = array;
continue;
@@ -42,7 +41,7 @@ internal static AnalyzeJobErrorsAndStatistics DeserializeAnalyzeJobErrorsAndStat
property.ThrowNonNullablePropertyIsNull();
continue;
}
- statistics = TextDocumentBatchStatistics.DeserializeTextDocumentBatchStatistics(property.Value);
+ statistics = RequestStatistics.DeserializeRequestStatistics(property.Value);
continue;
}
}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/AnalyzeJobErrorsAndStatistics.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/AnalyzeJobErrorsAndStatistics.cs
similarity index 76%
rename from sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/AnalyzeJobErrorsAndStatistics.cs
rename to sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/AnalyzeJobErrorsAndStatistics.cs
index 99ce6c54907f4..531426b6ea643 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/AnalyzeJobErrorsAndStatistics.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/AnalyzeJobErrorsAndStatistics.cs
@@ -6,10 +6,9 @@
#nullable disable
using System.Collections.Generic;
-using Azure.AI.TextAnalytics;
using Azure.Core;
-namespace Azure.AI.TextAnalytics.Models
+namespace Azure.AI.TextAnalytics.Legacy
{
/// The AnalyzeJobErrorsAndStatistics.
internal partial class AnalyzeJobErrorsAndStatistics
@@ -17,21 +16,21 @@ internal partial class AnalyzeJobErrorsAndStatistics
/// Initializes a new instance of AnalyzeJobErrorsAndStatistics.
internal AnalyzeJobErrorsAndStatistics()
{
- Errors = new ChangeTrackingList();
+ Errors = new ChangeTrackingList();
}
/// Initializes a new instance of AnalyzeJobErrorsAndStatistics.
///
/// if showStats=true was specified in the request this field will contain information about the request payload.
- internal AnalyzeJobErrorsAndStatistics(IReadOnlyList errors, TextDocumentBatchStatistics statistics)
+ internal AnalyzeJobErrorsAndStatistics(IReadOnlyList errors, RequestStatistics statistics)
{
Errors = errors;
Statistics = statistics;
}
/// Gets the errors.
- public IReadOnlyList Errors { get; }
+ public IReadOnlyList Errors { get; }
/// if showStats=true was specified in the request this field will contain information about the request payload.
- public TextDocumentBatchStatistics Statistics { get; }
+ public RequestStatistics Statistics { get; }
}
}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/AnalyzeJobMetadata.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/AnalyzeJobMetadata.Serialization.cs
similarity index 87%
rename from sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/AnalyzeJobMetadata.Serialization.cs
rename to sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/AnalyzeJobMetadata.Serialization.cs
index bf5ea4ffb7bad..4e89b912242ee 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/AnalyzeJobMetadata.Serialization.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/AnalyzeJobMetadata.Serialization.cs
@@ -7,10 +7,10 @@
using System;
using System.Text.Json;
-using Azure.AI.TextAnalytics;
+using Azure.AI.TextAnalytics.Legacy.Models;
using Azure.Core;
-namespace Azure.AI.TextAnalytics.Models
+namespace Azure.AI.TextAnalytics.Legacy
{
internal partial class AnalyzeJobMetadata
{
@@ -19,9 +19,9 @@ internal static AnalyzeJobMetadata DeserializeAnalyzeJobMetadata(JsonElement ele
Optional displayName = default;
DateTimeOffset createdDateTime = default;
Optional expirationDateTime = default;
- string jobId = default;
+ Guid jobId = default;
DateTimeOffset lastUpdateDateTime = default;
- TextAnalyticsOperationStatus status = default;
+ State status = default;
foreach (var property in element.EnumerateObject())
{
if (property.NameEquals("displayName"))
@@ -46,7 +46,7 @@ internal static AnalyzeJobMetadata DeserializeAnalyzeJobMetadata(JsonElement ele
}
if (property.NameEquals("jobId"))
{
- jobId = property.Value.GetString();
+ jobId = property.Value.GetGuid();
continue;
}
if (property.NameEquals("lastUpdateDateTime"))
@@ -56,7 +56,7 @@ internal static AnalyzeJobMetadata DeserializeAnalyzeJobMetadata(JsonElement ele
}
if (property.NameEquals("status"))
{
- status = new TextAnalyticsOperationStatus(property.Value.GetString());
+ status = property.Value.GetString().ToState();
continue;
}
}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/AnalyzeJobMetadata.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/AnalyzeJobMetadata.cs
similarity index 64%
rename from sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/AnalyzeJobMetadata.cs
rename to sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/AnalyzeJobMetadata.cs
index dd68f9f990db5..7f95ab5e60e44 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/AnalyzeJobMetadata.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/AnalyzeJobMetadata.cs
@@ -6,9 +6,9 @@
#nullable disable
using System;
-using Azure.AI.TextAnalytics;
+using Azure.AI.TextAnalytics.Legacy.Models;
-namespace Azure.AI.TextAnalytics.Models
+namespace Azure.AI.TextAnalytics.Legacy
{
/// The AnalyzeJobMetadata.
internal partial class AnalyzeJobMetadata : JobMetadata
@@ -18,13 +18,8 @@ internal partial class AnalyzeJobMetadata : JobMetadata
///
///
///
- /// is null.
- internal AnalyzeJobMetadata(DateTimeOffset createdDateTime, string jobId, DateTimeOffset lastUpdateDateTime, TextAnalyticsOperationStatus status) : base(createdDateTime, jobId, lastUpdateDateTime, status)
+ internal AnalyzeJobMetadata(DateTimeOffset createdDateTime, Guid jobId, DateTimeOffset lastUpdateDateTime, State status) : base(createdDateTime, jobId, lastUpdateDateTime, status)
{
- if (jobId == null)
- {
- throw new ArgumentNullException(nameof(jobId));
- }
}
/// Initializes a new instance of AnalyzeJobMetadata.
@@ -34,7 +29,7 @@ internal AnalyzeJobMetadata(DateTimeOffset createdDateTime, string jobId, DateTi
///
///
///
- internal AnalyzeJobMetadata(DateTimeOffset createdDateTime, DateTimeOffset? expirationDateTime, string jobId, DateTimeOffset lastUpdateDateTime, TextAnalyticsOperationStatus status, string displayName) : base(createdDateTime, expirationDateTime, jobId, lastUpdateDateTime, status)
+ internal AnalyzeJobMetadata(DateTimeOffset createdDateTime, DateTimeOffset? expirationDateTime, Guid jobId, DateTimeOffset lastUpdateDateTime, State status, string displayName) : base(createdDateTime, expirationDateTime, jobId, lastUpdateDateTime, status)
{
DisplayName = displayName;
}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/AnalyzeJobState.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/AnalyzeJobState.Serialization.cs
similarity index 78%
rename from sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/AnalyzeJobState.Serialization.cs
rename to sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/AnalyzeJobState.Serialization.cs
index a657536c63338..91a2ff906b995 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/AnalyzeJobState.Serialization.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/AnalyzeJobState.Serialization.cs
@@ -8,30 +8,30 @@
using System;
using System.Collections.Generic;
using System.Text.Json;
-using Azure.AI.TextAnalytics;
+using Azure.AI.TextAnalytics.Legacy.Models;
using Azure.Core;
-namespace Azure.AI.TextAnalytics.Models
+namespace Azure.AI.TextAnalytics.Legacy
{
internal partial class AnalyzeJobState
{
internal static AnalyzeJobState DeserializeAnalyzeJobState(JsonElement element)
{
- AnalyzeTasks tasks = default;
- Optional> errors = default;
- Optional statistics = default;
+ TasksStateTasks tasks = default;
+ Optional> errors = default;
+ Optional statistics = default;
Optional nextLink = default;
Optional displayName = default;
DateTimeOffset createdDateTime = default;
Optional expirationDateTime = default;
- string jobId = default;
+ Guid jobId = default;
DateTimeOffset lastUpdateDateTime = default;
- TextAnalyticsOperationStatus status = default;
+ State status = default;
foreach (var property in element.EnumerateObject())
{
if (property.NameEquals("tasks"))
{
- tasks = AnalyzeTasks.DeserializeAnalyzeTasks(property.Value);
+ tasks = TasksStateTasks.DeserializeTasksStateTasks(property.Value);
continue;
}
if (property.NameEquals("errors"))
@@ -41,10 +41,10 @@ internal static AnalyzeJobState DeserializeAnalyzeJobState(JsonElement element)
property.ThrowNonNullablePropertyIsNull();
continue;
}
- List array = new List();
+ List array = new List();
foreach (var item in property.Value.EnumerateArray())
{
- array.Add(TextAnalyticsErrorInternal.DeserializeTextAnalyticsErrorInternal(item));
+ array.Add(TextAnalyticsError.DeserializeTextAnalyticsError(item));
}
errors = array;
continue;
@@ -56,7 +56,7 @@ internal static AnalyzeJobState DeserializeAnalyzeJobState(JsonElement element)
property.ThrowNonNullablePropertyIsNull();
continue;
}
- statistics = TextDocumentBatchStatistics.DeserializeTextDocumentBatchStatistics(property.Value);
+ statistics = RequestStatistics.DeserializeRequestStatistics(property.Value);
continue;
}
if (property.NameEquals("@nextLink"))
@@ -86,7 +86,7 @@ internal static AnalyzeJobState DeserializeAnalyzeJobState(JsonElement element)
}
if (property.NameEquals("jobId"))
{
- jobId = property.Value.GetString();
+ jobId = property.Value.GetGuid();
continue;
}
if (property.NameEquals("lastUpdateDateTime"))
@@ -96,7 +96,7 @@ internal static AnalyzeJobState DeserializeAnalyzeJobState(JsonElement element)
}
if (property.NameEquals("status"))
{
- status = new TextAnalyticsOperationStatus(property.Value.GetString());
+ status = property.Value.GetString().ToState();
continue;
}
}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/AnalyzeJobState.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/AnalyzeJobState.cs
similarity index 67%
rename from sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/AnalyzeJobState.cs
rename to sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/AnalyzeJobState.cs
index 20c220700791a..58b3d305e8d1f 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/AnalyzeJobState.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/AnalyzeJobState.cs
@@ -7,10 +7,10 @@
using System;
using System.Collections.Generic;
-using Azure.AI.TextAnalytics;
+using Azure.AI.TextAnalytics.Legacy.Models;
using Azure.Core;
-namespace Azure.AI.TextAnalytics.Models
+namespace Azure.AI.TextAnalytics.Legacy
{
/// The AnalyzeJobState.
internal partial class AnalyzeJobState : AnalyzeJobMetadata
@@ -21,20 +21,16 @@ internal partial class AnalyzeJobState : AnalyzeJobMetadata
///
///
///
- /// or is null.
- internal AnalyzeJobState(DateTimeOffset createdDateTime, string jobId, DateTimeOffset lastUpdateDateTime, TextAnalyticsOperationStatus status, AnalyzeTasks tasks) : base(createdDateTime, jobId, lastUpdateDateTime, status)
+ /// is null.
+ internal AnalyzeJobState(DateTimeOffset createdDateTime, Guid jobId, DateTimeOffset lastUpdateDateTime, State status, TasksStateTasks tasks) : base(createdDateTime, jobId, lastUpdateDateTime, status)
{
- if (jobId == null)
- {
- throw new ArgumentNullException(nameof(jobId));
- }
if (tasks == null)
{
throw new ArgumentNullException(nameof(tasks));
}
Tasks = tasks;
- Errors = new ChangeTrackingList();
+ Errors = new ChangeTrackingList();
}
/// Initializes a new instance of AnalyzeJobState.
@@ -48,7 +44,7 @@ internal AnalyzeJobState(DateTimeOffset createdDateTime, string jobId, DateTimeO
///
/// if showStats=true was specified in the request this field will contain information about the request payload.
///
- internal AnalyzeJobState(DateTimeOffset createdDateTime, DateTimeOffset? expirationDateTime, string jobId, DateTimeOffset lastUpdateDateTime, TextAnalyticsOperationStatus status, string displayName, AnalyzeTasks tasks, IReadOnlyList errors, TextDocumentBatchStatistics statistics, string nextLink) : base(createdDateTime, expirationDateTime, jobId, lastUpdateDateTime, status, displayName)
+ internal AnalyzeJobState(DateTimeOffset createdDateTime, DateTimeOffset? expirationDateTime, Guid jobId, DateTimeOffset lastUpdateDateTime, State status, string displayName, TasksStateTasks tasks, IReadOnlyList errors, RequestStatistics statistics, string nextLink) : base(createdDateTime, expirationDateTime, jobId, lastUpdateDateTime, status, displayName)
{
Tasks = tasks;
Errors = errors;
@@ -57,11 +53,11 @@ internal AnalyzeJobState(DateTimeOffset createdDateTime, DateTimeOffset? expirat
}
/// Gets the tasks.
- public AnalyzeTasks Tasks { get; }
+ public TasksStateTasks Tasks { get; }
/// Gets the errors.
- public IReadOnlyList Errors { get; }
+ public IReadOnlyList Errors { get; }
/// if showStats=true was specified in the request this field will contain information about the request payload.
- public TextDocumentBatchStatistics Statistics { get; }
+ public RequestStatistics Statistics { get; }
/// Gets the next link.
public string NextLink { get; }
}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/Association.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/Association.Serialization.cs
new file mode 100644
index 0000000000000..e39ec878cf6fe
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/Association.Serialization.cs
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+
+namespace Azure.AI.TextAnalytics.Legacy.Models
+{
+ internal static partial class AssociationExtensions
+ {
+ public static string ToSerialString(this Association value) => value switch
+ {
+ Association.Subject => "subject",
+ Association.Other => "other",
+ _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown Association value.")
+ };
+
+ public static Association ToAssociation(this string value)
+ {
+ if (string.Equals(value, "subject", StringComparison.InvariantCultureIgnoreCase)) return Association.Subject;
+ if (string.Equals(value, "other", StringComparison.InvariantCultureIgnoreCase)) return Association.Other;
+ throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown Association value.");
+ }
+ }
+}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/Association.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/Association.cs
new file mode 100644
index 0000000000000..f52b773efb0e8
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/Association.cs
@@ -0,0 +1,18 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+namespace Azure.AI.TextAnalytics.Legacy.Models
+{
+ /// Describes if the entity is the subject of the text or if it describes someone else.
+ internal enum Association
+ {
+ /// subject.
+ Subject,
+ /// other.
+ Other
+ }
+}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/Certainty.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/Certainty.Serialization.cs
new file mode 100644
index 0000000000000..475a9ec9f623e
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/Certainty.Serialization.cs
@@ -0,0 +1,34 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+
+namespace Azure.AI.TextAnalytics.Legacy.Models
+{
+ internal static partial class CertaintyExtensions
+ {
+ public static string ToSerialString(this Certainty value) => value switch
+ {
+ Certainty.Positive => "positive",
+ Certainty.PositivePossible => "positivePossible",
+ Certainty.NeutralPossible => "neutralPossible",
+ Certainty.NegativePossible => "negativePossible",
+ Certainty.Negative => "negative",
+ _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown Certainty value.")
+ };
+
+ public static Certainty ToCertainty(this string value)
+ {
+ if (string.Equals(value, "positive", StringComparison.InvariantCultureIgnoreCase)) return Certainty.Positive;
+ if (string.Equals(value, "positivePossible", StringComparison.InvariantCultureIgnoreCase)) return Certainty.PositivePossible;
+ if (string.Equals(value, "neutralPossible", StringComparison.InvariantCultureIgnoreCase)) return Certainty.NeutralPossible;
+ if (string.Equals(value, "negativePossible", StringComparison.InvariantCultureIgnoreCase)) return Certainty.NegativePossible;
+ if (string.Equals(value, "negative", StringComparison.InvariantCultureIgnoreCase)) return Certainty.Negative;
+ throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown Certainty value.");
+ }
+ }
+}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/Certainty.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/Certainty.cs
new file mode 100644
index 0000000000000..9ea2ac332d47e
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/Certainty.cs
@@ -0,0 +1,24 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+namespace Azure.AI.TextAnalytics.Legacy.Models
+{
+ /// Describes the entities certainty and polarity.
+ internal enum Certainty
+ {
+ /// positive.
+ Positive,
+ /// positivePossible.
+ PositivePossible,
+ /// neutralPossible.
+ NeutralPossible,
+ /// negativePossible.
+ NegativePossible,
+ /// negative.
+ Negative
+ }
+}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/ClassificationResult.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/ClassificationResult.Serialization.cs
new file mode 100644
index 0000000000000..dfce82ef91216
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/ClassificationResult.Serialization.cs
@@ -0,0 +1,35 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.AI.TextAnalytics.Legacy
+{
+ internal partial class ClassificationResult
+ {
+ internal static ClassificationResult DeserializeClassificationResult(JsonElement element)
+ {
+ string category = default;
+ double confidenceScore = default;
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("category"))
+ {
+ category = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("confidenceScore"))
+ {
+ confidenceScore = property.Value.GetDouble();
+ continue;
+ }
+ }
+ return new ClassificationResult(category, confidenceScore);
+ }
+ }
+}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/ClassificationResult.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/ClassificationResult.cs
new file mode 100644
index 0000000000000..2186dd7fdaae1
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/ClassificationResult.cs
@@ -0,0 +1,35 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+
+namespace Azure.AI.TextAnalytics.Legacy
+{
+ /// The ClassificationResult.
+ internal partial class ClassificationResult
+ {
+ /// Initializes a new instance of ClassificationResult.
+ /// Classification type.
+ /// Confidence score between 0 and 1 of the recognized classification.
+ /// is null.
+ internal ClassificationResult(string category, double confidenceScore)
+ {
+ if (category == null)
+ {
+ throw new ArgumentNullException(nameof(category));
+ }
+
+ Category = category;
+ ConfidenceScore = confidenceScore;
+ }
+
+ /// Classification type.
+ public string Category { get; }
+ /// Confidence score between 0 and 1 of the recognized classification.
+ public double ConfidenceScore { get; }
+ }
+}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/Conditionality.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/Conditionality.Serialization.cs
new file mode 100644
index 0000000000000..eb5a6297ffb1e
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/Conditionality.Serialization.cs
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+
+namespace Azure.AI.TextAnalytics.Legacy.Models
+{
+ internal static partial class ConditionalityExtensions
+ {
+ public static string ToSerialString(this Conditionality value) => value switch
+ {
+ Conditionality.Hypothetical => "hypothetical",
+ Conditionality.Conditional => "conditional",
+ _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown Conditionality value.")
+ };
+
+ public static Conditionality ToConditionality(this string value)
+ {
+ if (string.Equals(value, "hypothetical", StringComparison.InvariantCultureIgnoreCase)) return Conditionality.Hypothetical;
+ if (string.Equals(value, "conditional", StringComparison.InvariantCultureIgnoreCase)) return Conditionality.Conditional;
+ throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown Conditionality value.");
+ }
+ }
+}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/Conditionality.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/Conditionality.cs
new file mode 100644
index 0000000000000..5cc73d08ebf61
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/Conditionality.cs
@@ -0,0 +1,18 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+namespace Azure.AI.TextAnalytics.Legacy.Models
+{
+ /// Describes any conditionality on the entity.
+ internal enum Conditionality
+ {
+ /// hypothetical.
+ Hypothetical,
+ /// conditional.
+ Conditional
+ }
+}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomEntitiesResult.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomEntitiesResult.Serialization.cs
new file mode 100644
index 0000000000000..9213f150d0eed
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomEntitiesResult.Serialization.cs
@@ -0,0 +1,69 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.AI.TextAnalytics.Legacy
+{
+ internal partial class CustomEntitiesResult
+ {
+ internal static CustomEntitiesResult DeserializeCustomEntitiesResult(JsonElement element)
+ {
+ IReadOnlyList documents = default;
+ IReadOnlyList errors = default;
+ Optional statistics = default;
+ string projectName = default;
+ string deploymentName = default;
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("documents"))
+ {
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(DocumentEntities.DeserializeDocumentEntities(item));
+ }
+ documents = array;
+ continue;
+ }
+ if (property.NameEquals("errors"))
+ {
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(DocumentError.DeserializeDocumentError(item));
+ }
+ errors = array;
+ continue;
+ }
+ if (property.NameEquals("statistics"))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ property.ThrowNonNullablePropertyIsNull();
+ continue;
+ }
+ statistics = RequestStatistics.DeserializeRequestStatistics(property.Value);
+ continue;
+ }
+ if (property.NameEquals("projectName"))
+ {
+ projectName = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("deploymentName"))
+ {
+ deploymentName = property.Value.GetString();
+ continue;
+ }
+ }
+ return new CustomEntitiesResult(documents, errors, statistics.Value, projectName, deploymentName);
+ }
+ }
+}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomEntitiesResult.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomEntitiesResult.cs
new file mode 100644
index 0000000000000..2ddfce8e08219
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomEntitiesResult.cs
@@ -0,0 +1,74 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace Azure.AI.TextAnalytics.Legacy
+{
+ /// The CustomEntitiesResult.
+ internal partial class CustomEntitiesResult
+ {
+ /// Initializes a new instance of CustomEntitiesResult.
+ /// Response by document.
+ /// Errors by document id.
+ /// This field indicates the project name for the model.
+ /// This field indicates the deployment name for the model.
+ /// , , or is null.
+ internal CustomEntitiesResult(IEnumerable documents, IEnumerable errors, string projectName, string deploymentName)
+ {
+ if (documents == null)
+ {
+ throw new ArgumentNullException(nameof(documents));
+ }
+ if (errors == null)
+ {
+ throw new ArgumentNullException(nameof(errors));
+ }
+ if (projectName == null)
+ {
+ throw new ArgumentNullException(nameof(projectName));
+ }
+ if (deploymentName == null)
+ {
+ throw new ArgumentNullException(nameof(deploymentName));
+ }
+
+ Documents = documents.ToList();
+ Errors = errors.ToList();
+ ProjectName = projectName;
+ DeploymentName = deploymentName;
+ }
+
+ /// Initializes a new instance of CustomEntitiesResult.
+ /// Response by document.
+ /// Errors by document id.
+ /// if showStats=true was specified in the request this field will contain information about the request payload.
+ /// This field indicates the project name for the model.
+ /// This field indicates the deployment name for the model.
+ internal CustomEntitiesResult(IReadOnlyList documents, IReadOnlyList errors, RequestStatistics statistics, string projectName, string deploymentName)
+ {
+ Documents = documents;
+ Errors = errors;
+ Statistics = statistics;
+ ProjectName = projectName;
+ DeploymentName = deploymentName;
+ }
+
+ /// Response by document.
+ public IReadOnlyList Documents { get; }
+ /// Errors by document id.
+ public IReadOnlyList Errors { get; }
+ /// if showStats=true was specified in the request this field will contain information about the request payload.
+ public RequestStatistics Statistics { get; }
+ /// This field indicates the project name for the model.
+ public string ProjectName { get; }
+ /// This field indicates the deployment name for the model.
+ public string DeploymentName { get; }
+ }
+}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomEntitiesTask.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomEntitiesTask.Serialization.cs
similarity index 95%
rename from sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomEntitiesTask.Serialization.cs
rename to sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomEntitiesTask.Serialization.cs
index aaa7fd87ce595..c4cbbcc644fcb 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomEntitiesTask.Serialization.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomEntitiesTask.Serialization.cs
@@ -8,7 +8,7 @@
using System.Text.Json;
using Azure.Core;
-namespace Azure.AI.TextAnalytics.Models
+namespace Azure.AI.TextAnalytics.Legacy
{
internal partial class CustomEntitiesTask : IUtf8JsonSerializable
{
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomEntitiesTask.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomEntitiesTask.cs
similarity index 88%
rename from sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomEntitiesTask.cs
rename to sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomEntitiesTask.cs
index 5ef5e897ea2b2..c42ffab5dacb6 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomEntitiesTask.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomEntitiesTask.cs
@@ -5,7 +5,9 @@
#nullable disable
-namespace Azure.AI.TextAnalytics.Models
+using Azure.AI.TextAnalytics.Legacy.Models;
+
+namespace Azure.AI.TextAnalytics.Legacy
{
/// The CustomEntitiesTask.
internal partial class CustomEntitiesTask
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomEntitiesTaskParameters.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomEntitiesTaskParameters.Serialization.cs
new file mode 100644
index 0000000000000..fdcccd5ea3164
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomEntitiesTaskParameters.Serialization.cs
@@ -0,0 +1,35 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.AI.TextAnalytics.Legacy.Models
+{
+ internal partial class CustomEntitiesTaskParameters : IUtf8JsonSerializable
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
+ {
+ writer.WriteStartObject();
+ writer.WritePropertyName("project-name");
+ writer.WriteStringValue(ProjectName);
+ writer.WritePropertyName("deployment-name");
+ writer.WriteStringValue(DeploymentName);
+ if (Optional.IsDefined(LoggingOptOut))
+ {
+ writer.WritePropertyName("loggingOptOut");
+ writer.WriteBooleanValue(LoggingOptOut.Value);
+ }
+ if (Optional.IsDefined(StringIndexType))
+ {
+ writer.WritePropertyName("stringIndexType");
+ writer.WriteStringValue(StringIndexType.Value.ToString());
+ }
+ writer.WriteEndObject();
+ }
+ }
+}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomEntitiesTaskParameters.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomEntitiesTaskParameters.cs
new file mode 100644
index 0000000000000..71839a2eb906d
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomEntitiesTaskParameters.cs
@@ -0,0 +1,44 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using Azure.AI.TextAnalytics.Legacy;
+
+namespace Azure.AI.TextAnalytics.Legacy.Models
+{
+ /// The CustomEntitiesTaskParameters.
+ internal partial class CustomEntitiesTaskParameters
+ {
+ /// Initializes a new instance of CustomEntitiesTaskParameters.
+ ///
+ ///
+ /// or is null.
+ public CustomEntitiesTaskParameters(string projectName, string deploymentName)
+ {
+ if (projectName == null)
+ {
+ throw new ArgumentNullException(nameof(projectName));
+ }
+ if (deploymentName == null)
+ {
+ throw new ArgumentNullException(nameof(deploymentName));
+ }
+
+ ProjectName = projectName;
+ DeploymentName = deploymentName;
+ }
+
+ /// Gets the project name.
+ public string ProjectName { get; }
+ /// Gets the deployment name.
+ public string DeploymentName { get; }
+ /// Gets or sets the logging opt out.
+ public bool? LoggingOptOut { get; set; }
+ /// Gets or sets the string index type.
+ public StringIndexType? StringIndexType { get; set; }
+ }
+}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomEntitiesTaskResult.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomEntitiesTaskResult.Serialization.cs
similarity index 96%
rename from sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomEntitiesTaskResult.Serialization.cs
rename to sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomEntitiesTaskResult.Serialization.cs
index 150c21279b9c3..e321b0adb30b4 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomEntitiesTaskResult.Serialization.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomEntitiesTaskResult.Serialization.cs
@@ -8,7 +8,7 @@
using System.Text.Json;
using Azure.Core;
-namespace Azure.AI.TextAnalytics.Models
+namespace Azure.AI.TextAnalytics.Legacy
{
internal partial class CustomEntitiesTaskResult
{
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomEntitiesTaskResult.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomEntitiesTaskResult.cs
similarity index 95%
rename from sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomEntitiesTaskResult.cs
rename to sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomEntitiesTaskResult.cs
index 6135a79435221..d9c0039db0ab5 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomEntitiesTaskResult.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomEntitiesTaskResult.cs
@@ -5,7 +5,7 @@
#nullable disable
-namespace Azure.AI.TextAnalytics.Models
+namespace Azure.AI.TextAnalytics.Legacy
{
/// The CustomEntitiesTaskResult.
internal partial class CustomEntitiesTaskResult
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomMultiClassificationResult.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomMultiClassificationResult.Serialization.cs
similarity index 90%
rename from sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomMultiClassificationResult.Serialization.cs
rename to sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomMultiClassificationResult.Serialization.cs
index 7c49edb4696a9..b5c6e55bf6353 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomMultiClassificationResult.Serialization.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomMultiClassificationResult.Serialization.cs
@@ -7,10 +7,9 @@
using System.Collections.Generic;
using System.Text.Json;
-using Azure.AI.TextAnalytics;
using Azure.Core;
-namespace Azure.AI.TextAnalytics.Models
+namespace Azure.AI.TextAnalytics.Legacy
{
internal partial class CustomMultiClassificationResult
{
@@ -18,7 +17,7 @@ internal static CustomMultiClassificationResult DeserializeCustomMultiClassifica
{
IReadOnlyList documents = default;
IReadOnlyList errors = default;
- Optional statistics = default;
+ Optional statistics = default;
string projectName = default;
string deploymentName = default;
foreach (var property in element.EnumerateObject())
@@ -50,7 +49,7 @@ internal static CustomMultiClassificationResult DeserializeCustomMultiClassifica
property.ThrowNonNullablePropertyIsNull();
continue;
}
- statistics = TextDocumentBatchStatistics.DeserializeTextDocumentBatchStatistics(property.Value);
+ statistics = RequestStatistics.DeserializeRequestStatistics(property.Value);
continue;
}
if (property.NameEquals("projectName"))
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomMultiClassificationResult.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomMultiClassificationResult.cs
similarity index 93%
rename from sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomMultiClassificationResult.cs
rename to sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomMultiClassificationResult.cs
index 699dd8c0df8ab..dc01c3188f60b 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomMultiClassificationResult.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomMultiClassificationResult.cs
@@ -8,9 +8,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using Azure.AI.TextAnalytics;
-namespace Azure.AI.TextAnalytics.Models
+namespace Azure.AI.TextAnalytics.Legacy
{
/// The CustomMultiClassificationResult.
internal partial class CustomMultiClassificationResult
@@ -52,7 +51,7 @@ internal CustomMultiClassificationResult(IEnumerable if showStats=true was specified in the request this field will contain information about the request payload.
/// This field indicates the project name for the model.
/// This field indicates the deployment name for the model.
- internal CustomMultiClassificationResult(IReadOnlyList documents, IReadOnlyList errors, TextDocumentBatchStatistics statistics, string projectName, string deploymentName)
+ internal CustomMultiClassificationResult(IReadOnlyList documents, IReadOnlyList errors, RequestStatistics statistics, string projectName, string deploymentName)
{
Documents = documents;
Errors = errors;
@@ -66,7 +65,7 @@ internal CustomMultiClassificationResult(IReadOnlyList Errors by document id.
public IReadOnlyList Errors { get; }
/// if showStats=true was specified in the request this field will contain information about the request payload.
- public TextDocumentBatchStatistics Statistics { get; }
+ public RequestStatistics Statistics { get; }
/// This field indicates the project name for the model.
public string ProjectName { get; }
/// This field indicates the deployment name for the model.
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomMultiClassificationTask.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomMultiClassificationTask.Serialization.cs
similarity index 95%
rename from sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomMultiClassificationTask.Serialization.cs
rename to sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomMultiClassificationTask.Serialization.cs
index a6ab8c546b15b..3b9b899a0e5f7 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomMultiClassificationTask.Serialization.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomMultiClassificationTask.Serialization.cs
@@ -8,7 +8,7 @@
using System.Text.Json;
using Azure.Core;
-namespace Azure.AI.TextAnalytics.Models
+namespace Azure.AI.TextAnalytics.Legacy
{
internal partial class CustomMultiClassificationTask : IUtf8JsonSerializable
{
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomMultiClassificationTask.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomMultiClassificationTask.cs
similarity index 88%
rename from sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomMultiClassificationTask.cs
rename to sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomMultiClassificationTask.cs
index 3a32778e9a28f..5a8832548904d 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomMultiClassificationTask.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomMultiClassificationTask.cs
@@ -5,7 +5,9 @@
#nullable disable
-namespace Azure.AI.TextAnalytics.Models
+using Azure.AI.TextAnalytics.Legacy.Models;
+
+namespace Azure.AI.TextAnalytics.Legacy
{
/// The CustomMultiClassificationTask.
internal partial class CustomMultiClassificationTask
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomMultiClassificationTaskParameters.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomMultiClassificationTaskParameters.Serialization.cs
similarity index 94%
rename from sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomMultiClassificationTaskParameters.Serialization.cs
rename to sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomMultiClassificationTaskParameters.Serialization.cs
index dfbffed0afae1..462bb0c41d46c 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomMultiClassificationTaskParameters.Serialization.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomMultiClassificationTaskParameters.Serialization.cs
@@ -8,7 +8,7 @@
using System.Text.Json;
using Azure.Core;
-namespace Azure.AI.TextAnalytics.Models
+namespace Azure.AI.TextAnalytics.Legacy.Models
{
internal partial class CustomMultiClassificationTaskParameters : IUtf8JsonSerializable
{
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomMultiClassificationTaskParameters.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomMultiClassificationTaskParameters.cs
similarity index 96%
rename from sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomMultiClassificationTaskParameters.cs
rename to sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomMultiClassificationTaskParameters.cs
index 162caa94f9536..90a178a3b31f9 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomMultiClassificationTaskParameters.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomMultiClassificationTaskParameters.cs
@@ -7,7 +7,7 @@
using System;
-namespace Azure.AI.TextAnalytics.Models
+namespace Azure.AI.TextAnalytics.Legacy.Models
{
/// The CustomMultiClassificationTaskParameters.
internal partial class CustomMultiClassificationTaskParameters
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomMultiClassificationTaskResult.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomMultiClassificationTaskResult.Serialization.cs
similarity index 96%
rename from sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomMultiClassificationTaskResult.Serialization.cs
rename to sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomMultiClassificationTaskResult.Serialization.cs
index 6516b39a7e652..8f48037150302 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomMultiClassificationTaskResult.Serialization.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomMultiClassificationTaskResult.Serialization.cs
@@ -8,7 +8,7 @@
using System.Text.Json;
using Azure.Core;
-namespace Azure.AI.TextAnalytics.Models
+namespace Azure.AI.TextAnalytics.Legacy
{
internal partial class CustomMultiClassificationTaskResult
{
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomMultiClassificationTaskResult.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomMultiClassificationTaskResult.cs
similarity index 95%
rename from sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomMultiClassificationTaskResult.cs
rename to sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomMultiClassificationTaskResult.cs
index df0878a961feb..a98949d9c70c7 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomMultiClassificationTaskResult.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomMultiClassificationTaskResult.cs
@@ -5,7 +5,7 @@
#nullable disable
-namespace Azure.AI.TextAnalytics.Models
+namespace Azure.AI.TextAnalytics.Legacy
{
/// The CustomMultiClassificationTaskResult.
internal partial class CustomMultiClassificationTaskResult
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomSingleClassificationResult.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomSingleClassificationResult.Serialization.cs
similarity index 90%
rename from sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomSingleClassificationResult.Serialization.cs
rename to sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomSingleClassificationResult.Serialization.cs
index 363cd50862902..f35e844e2cca2 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomSingleClassificationResult.Serialization.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomSingleClassificationResult.Serialization.cs
@@ -7,10 +7,9 @@
using System.Collections.Generic;
using System.Text.Json;
-using Azure.AI.TextAnalytics;
using Azure.Core;
-namespace Azure.AI.TextAnalytics.Models
+namespace Azure.AI.TextAnalytics.Legacy
{
internal partial class CustomSingleClassificationResult
{
@@ -18,7 +17,7 @@ internal static CustomSingleClassificationResult DeserializeCustomSingleClassifi
{
IReadOnlyList documents = default;
IReadOnlyList errors = default;
- Optional statistics = default;
+ Optional statistics = default;
string projectName = default;
string deploymentName = default;
foreach (var property in element.EnumerateObject())
@@ -50,7 +49,7 @@ internal static CustomSingleClassificationResult DeserializeCustomSingleClassifi
property.ThrowNonNullablePropertyIsNull();
continue;
}
- statistics = TextDocumentBatchStatistics.DeserializeTextDocumentBatchStatistics(property.Value);
+ statistics = RequestStatistics.DeserializeRequestStatistics(property.Value);
continue;
}
if (property.NameEquals("projectName"))
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomSingleClassificationResult.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomSingleClassificationResult.cs
similarity index 93%
rename from sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomSingleClassificationResult.cs
rename to sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomSingleClassificationResult.cs
index c07a3cb4ee04e..1e74d12196f78 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomSingleClassificationResult.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomSingleClassificationResult.cs
@@ -8,9 +8,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using Azure.AI.TextAnalytics;
-namespace Azure.AI.TextAnalytics.Models
+namespace Azure.AI.TextAnalytics.Legacy
{
/// The CustomSingleClassificationResult.
internal partial class CustomSingleClassificationResult
@@ -52,7 +51,7 @@ internal CustomSingleClassificationResult(IEnumerable if showStats=true was specified in the request this field will contain information about the request payload.
/// This field indicates the project name for the model.
/// This field indicates the deployment name for the model.
- internal CustomSingleClassificationResult(IReadOnlyList documents, IReadOnlyList errors, TextDocumentBatchStatistics statistics, string projectName, string deploymentName)
+ internal CustomSingleClassificationResult(IReadOnlyList documents, IReadOnlyList errors, RequestStatistics statistics, string projectName, string deploymentName)
{
Documents = documents;
Errors = errors;
@@ -66,7 +65,7 @@ internal CustomSingleClassificationResult(IReadOnlyList Errors by document id.
public IReadOnlyList Errors { get; }
/// if showStats=true was specified in the request this field will contain information about the request payload.
- public TextDocumentBatchStatistics Statistics { get; }
+ public RequestStatistics Statistics { get; }
/// This field indicates the project name for the model.
public string ProjectName { get; }
/// This field indicates the deployment name for the model.
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomSingleClassificationTask.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomSingleClassificationTask.Serialization.cs
similarity index 95%
rename from sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomSingleClassificationTask.Serialization.cs
rename to sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomSingleClassificationTask.Serialization.cs
index 344b2a38d41f3..f4be34dc510fa 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomSingleClassificationTask.Serialization.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomSingleClassificationTask.Serialization.cs
@@ -8,7 +8,7 @@
using System.Text.Json;
using Azure.Core;
-namespace Azure.AI.TextAnalytics.Models
+namespace Azure.AI.TextAnalytics.Legacy
{
internal partial class CustomSingleClassificationTask : IUtf8JsonSerializable
{
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomSingleClassificationTask.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomSingleClassificationTask.cs
similarity index 89%
rename from sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomSingleClassificationTask.cs
rename to sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomSingleClassificationTask.cs
index 45417d3735247..6ea0998fe6de3 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomSingleClassificationTask.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomSingleClassificationTask.cs
@@ -5,7 +5,9 @@
#nullable disable
-namespace Azure.AI.TextAnalytics.Models
+using Azure.AI.TextAnalytics.Legacy.Models;
+
+namespace Azure.AI.TextAnalytics.Legacy
{
/// The CustomSingleClassificationTask.
internal partial class CustomSingleClassificationTask
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomSingleClassificationTaskParameters.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomSingleClassificationTaskParameters.Serialization.cs
similarity index 94%
rename from sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomSingleClassificationTaskParameters.Serialization.cs
rename to sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomSingleClassificationTaskParameters.Serialization.cs
index 5d96c7ef61083..06f17baca0985 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomSingleClassificationTaskParameters.Serialization.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomSingleClassificationTaskParameters.Serialization.cs
@@ -8,7 +8,7 @@
using System.Text.Json;
using Azure.Core;
-namespace Azure.AI.TextAnalytics.Models
+namespace Azure.AI.TextAnalytics.Legacy.Models
{
internal partial class CustomSingleClassificationTaskParameters : IUtf8JsonSerializable
{
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomSingleClassificationTaskParameters.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomSingleClassificationTaskParameters.cs
similarity index 96%
rename from sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomSingleClassificationTaskParameters.cs
rename to sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomSingleClassificationTaskParameters.cs
index e9d1ac59b04ab..9678abd4e482f 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomSingleClassificationTaskParameters.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomSingleClassificationTaskParameters.cs
@@ -7,7 +7,7 @@
using System;
-namespace Azure.AI.TextAnalytics.Models
+namespace Azure.AI.TextAnalytics.Legacy.Models
{
/// The CustomSingleClassificationTaskParameters.
internal partial class CustomSingleClassificationTaskParameters
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomSingleClassificationTaskResult.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomSingleClassificationTaskResult.Serialization.cs
similarity index 96%
rename from sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomSingleClassificationTaskResult.Serialization.cs
rename to sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomSingleClassificationTaskResult.Serialization.cs
index 563ee7164482c..9667eac49b266 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomSingleClassificationTaskResult.Serialization.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomSingleClassificationTaskResult.Serialization.cs
@@ -8,7 +8,7 @@
using System.Text.Json;
using Azure.Core;
-namespace Azure.AI.TextAnalytics.Models
+namespace Azure.AI.TextAnalytics.Legacy
{
internal partial class CustomSingleClassificationTaskResult
{
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomSingleClassificationTaskResult.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomSingleClassificationTaskResult.cs
similarity index 95%
rename from sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomSingleClassificationTaskResult.cs
rename to sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomSingleClassificationTaskResult.cs
index feec1de8531b0..926b59ceada63 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/CustomSingleClassificationTaskResult.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/CustomSingleClassificationTaskResult.cs
@@ -5,7 +5,7 @@
#nullable disable
-namespace Azure.AI.TextAnalytics.Models
+namespace Azure.AI.TextAnalytics.Legacy
{
/// The CustomSingleClassificationTaskResult.
internal partial class CustomSingleClassificationTaskResult
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DetectedLanguage.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DetectedLanguage.Serialization.cs
new file mode 100644
index 0000000000000..dbaf168f8eeef
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DetectedLanguage.Serialization.cs
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.AI.TextAnalytics.Legacy
+{
+ internal partial class DetectedLanguage
+ {
+ internal static DetectedLanguage DeserializeDetectedLanguage(JsonElement element)
+ {
+ string name = default;
+ string iso6391Name = default;
+ double confidenceScore = default;
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("name"))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ name = null;
+ continue;
+ }
+ name = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("iso6391Name"))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ iso6391Name = null;
+ continue;
+ }
+ iso6391Name = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("confidenceScore"))
+ {
+ confidenceScore = property.Value.GetDouble();
+ continue;
+ }
+ }
+ return new DetectedLanguage(name, iso6391Name, confidenceScore);
+ }
+ }
+}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DetectedLanguage.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DetectedLanguage.cs
new file mode 100644
index 0000000000000..8a2288802feb8
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DetectedLanguage.cs
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+namespace Azure.AI.TextAnalytics.Legacy
+{
+ /// The DetectedLanguage.
+ internal partial class DetectedLanguage
+ {
+ /// Initializes a new instance of DetectedLanguage.
+ /// Long name of a detected language (e.g. English, French).
+ /// A two letter representation of the detected language according to the ISO 639-1 standard (e.g. en, fr).
+ /// A confidence score between 0 and 1. Scores close to 1 indicate 100% certainty that the identified language is true.
+ internal DetectedLanguage(string name, string iso6391Name, double confidenceScore)
+ {
+ Name = name;
+ Iso6391Name = iso6391Name;
+ ConfidenceScore = confidenceScore;
+ }
+
+ /// Long name of a detected language (e.g. English, French).
+ public string Name { get; }
+ /// A two letter representation of the detected language according to the ISO 639-1 standard (e.g. en, fr).
+ public string Iso6391Name { get; }
+ /// A confidence score between 0 and 1. Scores close to 1 indicate 100% certainty that the identified language is true.
+ public double ConfidenceScore { get; }
+ }
+}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentEntities.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DocumentEntities.Serialization.cs
similarity index 76%
rename from sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentEntities.Serialization.cs
rename to sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DocumentEntities.Serialization.cs
index 0e6406dc2200d..b3363439170a0 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentEntities.Serialization.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DocumentEntities.Serialization.cs
@@ -7,10 +7,9 @@
using System.Collections.Generic;
using System.Text.Json;
-using Azure.AI.TextAnalytics;
using Azure.Core;
-namespace Azure.AI.TextAnalytics.Models
+namespace Azure.AI.TextAnalytics.Legacy
{
internal partial class DocumentEntities
{
@@ -18,8 +17,8 @@ internal static DocumentEntities DeserializeDocumentEntities(JsonElement element
{
string id = default;
IReadOnlyList entities = default;
- IReadOnlyList warnings = default;
- Optional statistics = default;
+ IReadOnlyList warnings = default;
+ Optional statistics = default;
foreach (var property in element.EnumerateObject())
{
if (property.NameEquals("id"))
@@ -39,10 +38,10 @@ internal static DocumentEntities DeserializeDocumentEntities(JsonElement element
}
if (property.NameEquals("warnings"))
{
- List array = new List();
+ List array = new List();
foreach (var item in property.Value.EnumerateArray())
{
- array.Add(TextAnalyticsWarningInternal.DeserializeTextAnalyticsWarningInternal(item));
+ array.Add(TextAnalyticsWarning.DeserializeTextAnalyticsWarning(item));
}
warnings = array;
continue;
@@ -54,11 +53,11 @@ internal static DocumentEntities DeserializeDocumentEntities(JsonElement element
property.ThrowNonNullablePropertyIsNull();
continue;
}
- statistics = TextDocumentStatistics.DeserializeTextDocumentStatistics(property.Value);
+ statistics = DocumentStatistics.DeserializeDocumentStatistics(property.Value);
continue;
}
}
- return new DocumentEntities(id, entities, warnings, Optional.ToNullable(statistics));
+ return new DocumentEntities(id, entities, warnings, statistics.Value);
}
}
}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentEntities.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DocumentEntities.cs
similarity index 87%
rename from sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentEntities.cs
rename to sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DocumentEntities.cs
index 2654c20aae4bb..28fa8e3673581 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentEntities.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DocumentEntities.cs
@@ -8,9 +8,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using Azure.AI.TextAnalytics;
-namespace Azure.AI.TextAnalytics.Models
+namespace Azure.AI.TextAnalytics.Legacy
{
/// The DocumentEntities.
internal partial class DocumentEntities
@@ -20,7 +19,7 @@ internal partial class DocumentEntities
/// Recognized entities in the document.
/// Warnings encountered while processing document.
/// , or is null.
- internal DocumentEntities(string id, IEnumerable entities, IEnumerable warnings)
+ internal DocumentEntities(string id, IEnumerable entities, IEnumerable warnings)
{
if (id == null)
{
@@ -45,7 +44,7 @@ internal DocumentEntities(string id, IEnumerable entities, IEnumerable Recognized entities in the document.
/// Warnings encountered while processing document.
/// if showStats=true was specified in the request this field will contain information about the document payload.
- internal DocumentEntities(string id, IReadOnlyList entities, IReadOnlyList warnings, TextDocumentStatistics? statistics)
+ internal DocumentEntities(string id, IReadOnlyList entities, IReadOnlyList warnings, DocumentStatistics statistics)
{
Id = id;
Entities = entities;
@@ -58,8 +57,8 @@ internal DocumentEntities(string id, IReadOnlyList entities, IReadOnlyLi
/// Recognized entities in the document.
public IReadOnlyList Entities { get; }
/// Warnings encountered while processing document.
- public IReadOnlyList Warnings { get; }
+ public IReadOnlyList Warnings { get; }
/// if showStats=true was specified in the request this field will contain information about the document payload.
- public TextDocumentStatistics? Statistics { get; }
+ public DocumentStatistics Statistics { get; }
}
}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DocumentError.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DocumentError.Serialization.cs
new file mode 100644
index 0000000000000..255437859e76c
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DocumentError.Serialization.cs
@@ -0,0 +1,35 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.AI.TextAnalytics.Legacy
+{
+ internal partial class DocumentError
+ {
+ internal static DocumentError DeserializeDocumentError(JsonElement element)
+ {
+ string id = default;
+ TextAnalyticsError error = default;
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("id"))
+ {
+ id = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("error"))
+ {
+ error = TextAnalyticsError.DeserializeTextAnalyticsError(property.Value);
+ continue;
+ }
+ }
+ return new DocumentError(id, error);
+ }
+ }
+}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DocumentError.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DocumentError.cs
new file mode 100644
index 0000000000000..74816b434d7d8
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DocumentError.cs
@@ -0,0 +1,39 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+
+namespace Azure.AI.TextAnalytics.Legacy
+{
+ /// The DocumentError.
+ internal partial class DocumentError
+ {
+ /// Initializes a new instance of DocumentError.
+ /// Document Id.
+ /// Document Error.
+ /// or is null.
+ internal DocumentError(string id, TextAnalyticsError error)
+ {
+ if (id == null)
+ {
+ throw new ArgumentNullException(nameof(id));
+ }
+ if (error == null)
+ {
+ throw new ArgumentNullException(nameof(error));
+ }
+
+ Id = id;
+ Error = error;
+ }
+
+ /// Document Id.
+ public string Id { get; }
+ /// Document Error.
+ public TextAnalyticsError Error { get; }
+ }
+}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DocumentHealthcareEntities.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DocumentHealthcareEntities.Serialization.cs
new file mode 100644
index 0000000000000..4f51863d8e338
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DocumentHealthcareEntities.Serialization.cs
@@ -0,0 +1,74 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.AI.TextAnalytics.Legacy
+{
+ internal partial class DocumentHealthcareEntities
+ {
+ internal static DocumentHealthcareEntities DeserializeDocumentHealthcareEntities(JsonElement element)
+ {
+ string id = default;
+ IReadOnlyList entities = default;
+ IReadOnlyList relations = default;
+ IReadOnlyList warnings = default;
+ Optional statistics = default;
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("id"))
+ {
+ id = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("entities"))
+ {
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(HealthcareEntity.DeserializeHealthcareEntity(item));
+ }
+ entities = array;
+ continue;
+ }
+ if (property.NameEquals("relations"))
+ {
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(HealthcareRelation.DeserializeHealthcareRelation(item));
+ }
+ relations = array;
+ continue;
+ }
+ if (property.NameEquals("warnings"))
+ {
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(TextAnalyticsWarning.DeserializeTextAnalyticsWarning(item));
+ }
+ warnings = array;
+ continue;
+ }
+ if (property.NameEquals("statistics"))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ property.ThrowNonNullablePropertyIsNull();
+ continue;
+ }
+ statistics = DocumentStatistics.DeserializeDocumentStatistics(property.Value);
+ continue;
+ }
+ }
+ return new DocumentHealthcareEntities(id, entities, relations, warnings, statistics.Value);
+ }
+ }
+}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentHealthcareEntitiesInternal.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DocumentHealthcareEntities.cs
similarity index 73%
rename from sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentHealthcareEntitiesInternal.cs
rename to sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DocumentHealthcareEntities.cs
index da45e52fe3219..ade22bf56ad30 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentHealthcareEntitiesInternal.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DocumentHealthcareEntities.cs
@@ -8,20 +8,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using Azure.AI.TextAnalytics;
-namespace Azure.AI.TextAnalytics.Models
+namespace Azure.AI.TextAnalytics.Legacy
{
/// The DocumentHealthcareEntities.
- internal partial class DocumentHealthcareEntitiesInternal
+ internal partial class DocumentHealthcareEntities
{
- /// Initializes a new instance of DocumentHealthcareEntitiesInternal.
+ /// Initializes a new instance of DocumentHealthcareEntities.
/// Unique, non-empty document identifier.
/// Healthcare entities.
/// Healthcare entity relations.
/// Warnings encountered while processing document.
/// , , or is null.
- internal DocumentHealthcareEntitiesInternal(string id, IEnumerable entities, IEnumerable relations, IEnumerable warnings)
+ internal DocumentHealthcareEntities(string id, IEnumerable entities, IEnumerable relations, IEnumerable warnings)
{
if (id == null)
{
@@ -46,13 +45,13 @@ internal DocumentHealthcareEntitiesInternal(string id, IEnumerable Initializes a new instance of DocumentHealthcareEntitiesInternal.
+ /// Initializes a new instance of DocumentHealthcareEntities.
/// Unique, non-empty document identifier.
/// Healthcare entities.
/// Healthcare entity relations.
/// Warnings encountered while processing document.
/// if showStats=true was specified in the request this field will contain information about the document payload.
- internal DocumentHealthcareEntitiesInternal(string id, IReadOnlyList entities, IReadOnlyList relations, IReadOnlyList warnings, TextDocumentStatistics? statistics)
+ internal DocumentHealthcareEntities(string id, IReadOnlyList entities, IReadOnlyList relations, IReadOnlyList warnings, DocumentStatistics statistics)
{
Id = id;
Entities = entities;
@@ -64,12 +63,12 @@ internal DocumentHealthcareEntitiesInternal(string id, IReadOnlyList Unique, non-empty document identifier.
public string Id { get; }
/// Healthcare entities.
- public IReadOnlyList Entities { get; }
+ public IReadOnlyList Entities { get; }
/// Healthcare entity relations.
- public IReadOnlyList Relations { get; }
+ public IReadOnlyList Relations { get; }
/// Warnings encountered while processing document.
- public IReadOnlyList Warnings { get; }
+ public IReadOnlyList Warnings { get; }
/// if showStats=true was specified in the request this field will contain information about the document payload.
- public TextDocumentStatistics? Statistics { get; }
+ public DocumentStatistics Statistics { get; }
}
}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentKeyPhrases.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DocumentKeyPhrases.Serialization.cs
similarity index 75%
rename from sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentKeyPhrases.Serialization.cs
rename to sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DocumentKeyPhrases.Serialization.cs
index d28fedaa6b9be..4ac706e7e64eb 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentKeyPhrases.Serialization.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DocumentKeyPhrases.Serialization.cs
@@ -7,10 +7,9 @@
using System.Collections.Generic;
using System.Text.Json;
-using Azure.AI.TextAnalytics;
using Azure.Core;
-namespace Azure.AI.TextAnalytics.Models
+namespace Azure.AI.TextAnalytics.Legacy
{
internal partial class DocumentKeyPhrases
{
@@ -18,8 +17,8 @@ internal static DocumentKeyPhrases DeserializeDocumentKeyPhrases(JsonElement ele
{
string id = default;
IReadOnlyList keyPhrases = default;
- IReadOnlyList warnings = default;
- Optional statistics = default;
+ IReadOnlyList warnings = default;
+ Optional statistics = default;
foreach (var property in element.EnumerateObject())
{
if (property.NameEquals("id"))
@@ -39,10 +38,10 @@ internal static DocumentKeyPhrases DeserializeDocumentKeyPhrases(JsonElement ele
}
if (property.NameEquals("warnings"))
{
- List array = new List();
+ List array = new List();
foreach (var item in property.Value.EnumerateArray())
{
- array.Add(TextAnalyticsWarningInternal.DeserializeTextAnalyticsWarningInternal(item));
+ array.Add(TextAnalyticsWarning.DeserializeTextAnalyticsWarning(item));
}
warnings = array;
continue;
@@ -54,11 +53,11 @@ internal static DocumentKeyPhrases DeserializeDocumentKeyPhrases(JsonElement ele
property.ThrowNonNullablePropertyIsNull();
continue;
}
- statistics = TextDocumentStatistics.DeserializeTextDocumentStatistics(property.Value);
+ statistics = DocumentStatistics.DeserializeDocumentStatistics(property.Value);
continue;
}
}
- return new DocumentKeyPhrases(id, keyPhrases, warnings, Optional.ToNullable(statistics));
+ return new DocumentKeyPhrases(id, keyPhrases, warnings, statistics.Value);
}
}
}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentKeyPhrases.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DocumentKeyPhrases.cs
similarity index 88%
rename from sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentKeyPhrases.cs
rename to sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DocumentKeyPhrases.cs
index 1d78761ccd4fc..cc674d8cb4257 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentKeyPhrases.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DocumentKeyPhrases.cs
@@ -8,9 +8,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using Azure.AI.TextAnalytics;
-namespace Azure.AI.TextAnalytics.Models
+namespace Azure.AI.TextAnalytics.Legacy
{
/// The DocumentKeyPhrases.
internal partial class DocumentKeyPhrases
@@ -20,7 +19,7 @@ internal partial class DocumentKeyPhrases
/// A list of representative words or phrases. The number of key phrases returned is proportional to the number of words in the input document.
/// Warnings encountered while processing document.
/// , or is null.
- internal DocumentKeyPhrases(string id, IEnumerable keyPhrases, IEnumerable warnings)
+ internal DocumentKeyPhrases(string id, IEnumerable keyPhrases, IEnumerable warnings)
{
if (id == null)
{
@@ -45,7 +44,7 @@ internal DocumentKeyPhrases(string id, IEnumerable keyPhrases, IEnumerab
/// A list of representative words or phrases. The number of key phrases returned is proportional to the number of words in the input document.
/// Warnings encountered while processing document.
/// if showStats=true was specified in the request this field will contain information about the document payload.
- internal DocumentKeyPhrases(string id, IReadOnlyList keyPhrases, IReadOnlyList warnings, TextDocumentStatistics? statistics)
+ internal DocumentKeyPhrases(string id, IReadOnlyList keyPhrases, IReadOnlyList warnings, DocumentStatistics statistics)
{
Id = id;
KeyPhrases = keyPhrases;
@@ -58,8 +57,8 @@ internal DocumentKeyPhrases(string id, IReadOnlyList keyPhrases, IReadOn
/// A list of representative words or phrases. The number of key phrases returned is proportional to the number of words in the input document.
public IReadOnlyList KeyPhrases { get; }
/// Warnings encountered while processing document.
- public IReadOnlyList Warnings { get; }
+ public IReadOnlyList Warnings { get; }
/// if showStats=true was specified in the request this field will contain information about the document payload.
- public TextDocumentStatistics? Statistics { get; }
+ public DocumentStatistics Statistics { get; }
}
}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentLanguage.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DocumentLanguage.Serialization.cs
similarity index 66%
rename from sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentLanguage.Serialization.cs
rename to sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DocumentLanguage.Serialization.cs
index f29355b6e5de2..3bbb0c2768189 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentLanguage.Serialization.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DocumentLanguage.Serialization.cs
@@ -7,19 +7,18 @@
using System.Collections.Generic;
using System.Text.Json;
-using Azure.AI.TextAnalytics;
using Azure.Core;
-namespace Azure.AI.TextAnalytics.Models
+namespace Azure.AI.TextAnalytics.Legacy
{
internal partial class DocumentLanguage
{
internal static DocumentLanguage DeserializeDocumentLanguage(JsonElement element)
{
string id = default;
- DetectedLanguageInternal detectedLanguage = default;
- IReadOnlyList warnings = default;
- Optional statistics = default;
+ DetectedLanguage detectedLanguage = default;
+ IReadOnlyList warnings = default;
+ Optional statistics = default;
foreach (var property in element.EnumerateObject())
{
if (property.NameEquals("id"))
@@ -29,15 +28,15 @@ internal static DocumentLanguage DeserializeDocumentLanguage(JsonElement element
}
if (property.NameEquals("detectedLanguage"))
{
- detectedLanguage = DetectedLanguageInternal.DeserializeDetectedLanguageInternal(property.Value);
+ detectedLanguage = DetectedLanguage.DeserializeDetectedLanguage(property.Value);
continue;
}
if (property.NameEquals("warnings"))
{
- List array = new List();
+ List array = new List();
foreach (var item in property.Value.EnumerateArray())
{
- array.Add(TextAnalyticsWarningInternal.DeserializeTextAnalyticsWarningInternal(item));
+ array.Add(TextAnalyticsWarning.DeserializeTextAnalyticsWarning(item));
}
warnings = array;
continue;
@@ -49,11 +48,11 @@ internal static DocumentLanguage DeserializeDocumentLanguage(JsonElement element
property.ThrowNonNullablePropertyIsNull();
continue;
}
- statistics = TextDocumentStatistics.DeserializeTextDocumentStatistics(property.Value);
+ statistics = DocumentStatistics.DeserializeDocumentStatistics(property.Value);
continue;
}
}
- return new DocumentLanguage(id, detectedLanguage, warnings, Optional.ToNullable(statistics));
+ return new DocumentLanguage(id, detectedLanguage, warnings, statistics.Value);
}
}
}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentLanguage.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DocumentLanguage.cs
similarity index 73%
rename from sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentLanguage.cs
rename to sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DocumentLanguage.cs
index 4bfa460bedcbe..b742973ab681b 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentLanguage.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DocumentLanguage.cs
@@ -8,9 +8,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using Azure.AI.TextAnalytics;
-namespace Azure.AI.TextAnalytics.Models
+namespace Azure.AI.TextAnalytics.Legacy
{
/// The DocumentLanguage.
internal partial class DocumentLanguage
@@ -19,13 +18,17 @@ internal partial class DocumentLanguage
/// Unique, non-empty document identifier.
/// Detected Language.
/// Warnings encountered while processing document.
- /// or is null.
- internal DocumentLanguage(string id, DetectedLanguageInternal detectedLanguage, IEnumerable warnings)
+ /// , or is null.
+ internal DocumentLanguage(string id, DetectedLanguage detectedLanguage, IEnumerable warnings)
{
if (id == null)
{
throw new ArgumentNullException(nameof(id));
}
+ if (detectedLanguage == null)
+ {
+ throw new ArgumentNullException(nameof(detectedLanguage));
+ }
if (warnings == null)
{
throw new ArgumentNullException(nameof(warnings));
@@ -41,7 +44,7 @@ internal DocumentLanguage(string id, DetectedLanguageInternal detectedLanguage,
/// Detected Language.
/// Warnings encountered while processing document.
/// if showStats=true was specified in the request this field will contain information about the document payload.
- internal DocumentLanguage(string id, DetectedLanguageInternal detectedLanguage, IReadOnlyList warnings, TextDocumentStatistics? statistics)
+ internal DocumentLanguage(string id, DetectedLanguage detectedLanguage, IReadOnlyList warnings, DocumentStatistics statistics)
{
Id = id;
DetectedLanguage = detectedLanguage;
@@ -52,10 +55,10 @@ internal DocumentLanguage(string id, DetectedLanguageInternal detectedLanguage,
/// Unique, non-empty document identifier.
public string Id { get; }
/// Detected Language.
- public DetectedLanguageInternal DetectedLanguage { get; }
+ public DetectedLanguage DetectedLanguage { get; }
/// Warnings encountered while processing document.
- public IReadOnlyList Warnings { get; }
+ public IReadOnlyList Warnings { get; }
/// if showStats=true was specified in the request this field will contain information about the document payload.
- public TextDocumentStatistics? Statistics { get; }
+ public DocumentStatistics Statistics { get; }
}
}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentLinkedEntities.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DocumentLinkedEntities.Serialization.cs
similarity index 76%
rename from sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentLinkedEntities.Serialization.cs
rename to sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DocumentLinkedEntities.Serialization.cs
index 62c1edf9ff2db..eedd30c42db3f 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentLinkedEntities.Serialization.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DocumentLinkedEntities.Serialization.cs
@@ -7,10 +7,9 @@
using System.Collections.Generic;
using System.Text.Json;
-using Azure.AI.TextAnalytics;
using Azure.Core;
-namespace Azure.AI.TextAnalytics.Models
+namespace Azure.AI.TextAnalytics.Legacy
{
internal partial class DocumentLinkedEntities
{
@@ -18,8 +17,8 @@ internal static DocumentLinkedEntities DeserializeDocumentLinkedEntities(JsonEle
{
string id = default;
IReadOnlyList entities = default;
- IReadOnlyList warnings = default;
- Optional statistics = default;
+ IReadOnlyList warnings = default;
+ Optional statistics = default;
foreach (var property in element.EnumerateObject())
{
if (property.NameEquals("id"))
@@ -39,10 +38,10 @@ internal static DocumentLinkedEntities DeserializeDocumentLinkedEntities(JsonEle
}
if (property.NameEquals("warnings"))
{
- List array = new List();
+ List array = new List();
foreach (var item in property.Value.EnumerateArray())
{
- array.Add(TextAnalyticsWarningInternal.DeserializeTextAnalyticsWarningInternal(item));
+ array.Add(TextAnalyticsWarning.DeserializeTextAnalyticsWarning(item));
}
warnings = array;
continue;
@@ -54,11 +53,11 @@ internal static DocumentLinkedEntities DeserializeDocumentLinkedEntities(JsonEle
property.ThrowNonNullablePropertyIsNull();
continue;
}
- statistics = TextDocumentStatistics.DeserializeTextDocumentStatistics(property.Value);
+ statistics = DocumentStatistics.DeserializeDocumentStatistics(property.Value);
continue;
}
}
- return new DocumentLinkedEntities(id, entities, warnings, Optional.ToNullable(statistics));
+ return new DocumentLinkedEntities(id, entities, warnings, statistics.Value);
}
}
}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentLinkedEntities.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DocumentLinkedEntities.cs
similarity index 86%
rename from sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentLinkedEntities.cs
rename to sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DocumentLinkedEntities.cs
index 7896a3aacdf1d..4ed05b0630416 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentLinkedEntities.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DocumentLinkedEntities.cs
@@ -8,9 +8,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using Azure.AI.TextAnalytics;
-namespace Azure.AI.TextAnalytics.Models
+namespace Azure.AI.TextAnalytics.Legacy
{
/// The DocumentLinkedEntities.
internal partial class DocumentLinkedEntities
@@ -20,7 +19,7 @@ internal partial class DocumentLinkedEntities
/// Recognized well known entities in the document.
/// Warnings encountered while processing document.
/// , or is null.
- internal DocumentLinkedEntities(string id, IEnumerable entities, IEnumerable warnings)
+ internal DocumentLinkedEntities(string id, IEnumerable entities, IEnumerable warnings)
{
if (id == null)
{
@@ -45,7 +44,7 @@ internal DocumentLinkedEntities(string id, IEnumerable entities, I
/// Recognized well known entities in the document.
/// Warnings encountered while processing document.
/// if showStats=true was specified in the request this field will contain information about the document payload.
- internal DocumentLinkedEntities(string id, IReadOnlyList entities, IReadOnlyList warnings, TextDocumentStatistics? statistics)
+ internal DocumentLinkedEntities(string id, IReadOnlyList entities, IReadOnlyList warnings, DocumentStatistics statistics)
{
Id = id;
Entities = entities;
@@ -58,8 +57,8 @@ internal DocumentLinkedEntities(string id, IReadOnlyList entities,
/// Recognized well known entities in the document.
public IReadOnlyList Entities { get; }
/// Warnings encountered while processing document.
- public IReadOnlyList Warnings { get; }
+ public IReadOnlyList Warnings { get; }
/// if showStats=true was specified in the request this field will contain information about the document payload.
- public TextDocumentStatistics? Statistics { get; }
+ public DocumentStatistics Statistics { get; }
}
}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DocumentSentiment.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DocumentSentiment.Serialization.cs
new file mode 100644
index 0000000000000..eea8e42a74c25
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DocumentSentiment.Serialization.cs
@@ -0,0 +1,76 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure.AI.TextAnalytics.Legacy.Models;
+using Azure.Core;
+
+namespace Azure.AI.TextAnalytics.Legacy
+{
+ internal partial class DocumentSentiment
+ {
+ internal static DocumentSentiment DeserializeDocumentSentiment(JsonElement element)
+ {
+ string id = default;
+ DocumentSentimentValue sentiment = default;
+ Optional statistics = default;
+ SentimentConfidenceScorePerLabel confidenceScores = default;
+ IReadOnlyList sentences = default;
+ IReadOnlyList warnings = default;
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("id"))
+ {
+ id = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("sentiment"))
+ {
+ sentiment = property.Value.GetString().ToDocumentSentimentValue();
+ continue;
+ }
+ if (property.NameEquals("statistics"))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ property.ThrowNonNullablePropertyIsNull();
+ continue;
+ }
+ statistics = DocumentStatistics.DeserializeDocumentStatistics(property.Value);
+ continue;
+ }
+ if (property.NameEquals("confidenceScores"))
+ {
+ confidenceScores = SentimentConfidenceScorePerLabel.DeserializeSentimentConfidenceScorePerLabel(property.Value);
+ continue;
+ }
+ if (property.NameEquals("sentences"))
+ {
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(SentenceSentiment.DeserializeSentenceSentiment(item));
+ }
+ sentences = array;
+ continue;
+ }
+ if (property.NameEquals("warnings"))
+ {
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(TextAnalyticsWarning.DeserializeTextAnalyticsWarning(item));
+ }
+ warnings = array;
+ continue;
+ }
+ }
+ return new DocumentSentiment(id, sentiment, statistics.Value, confidenceScores, sentences, warnings);
+ }
+ }
+}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentSentimentInternal.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DocumentSentiment.cs
similarity index 73%
rename from sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentSentimentInternal.cs
rename to sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DocumentSentiment.cs
index 8fbc353d95dbe..c6634c6cb8229 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentSentimentInternal.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DocumentSentiment.cs
@@ -8,22 +8,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using Azure.AI.TextAnalytics;
+using Azure.AI.TextAnalytics.Legacy.Models;
-namespace Azure.AI.TextAnalytics.Models
+namespace Azure.AI.TextAnalytics.Legacy
{
/// The DocumentSentiment.
- internal readonly partial struct DocumentSentimentInternal
+ internal partial class DocumentSentiment
{
- /// Initializes a new instance of DocumentSentimentInternal.
+ /// Initializes a new instance of DocumentSentiment.
/// Unique, non-empty document identifier.
/// Predicted sentiment for document (Negative, Neutral, Positive, or Mixed).
- /// if showStats=true was specified in the request this field will contain information about the document payload.
/// Document level sentiment confidence scores between 0 and 1 for each sentiment class.
/// Sentence level sentiment analysis.
/// Warnings encountered while processing document.
/// , , or is null.
- internal DocumentSentimentInternal(string id, TextSentiment sentiment, TextDocumentStatistics? statistics, SentimentConfidenceScores confidenceScores, IEnumerable sentences, IEnumerable warnings)
+ internal DocumentSentiment(string id, DocumentSentimentValue sentiment, SentimentConfidenceScorePerLabel confidenceScores, IEnumerable sentences, IEnumerable warnings)
{
if (id == null)
{
@@ -44,20 +43,19 @@ internal DocumentSentimentInternal(string id, TextSentiment sentiment, TextDocum
Id = id;
Sentiment = sentiment;
- Statistics = statistics;
ConfidenceScores = confidenceScores;
Sentences = sentences.ToList();
Warnings = warnings.ToList();
}
- /// Initializes a new instance of DocumentSentimentInternal.
+ /// Initializes a new instance of DocumentSentiment.
/// Unique, non-empty document identifier.
/// Predicted sentiment for document (Negative, Neutral, Positive, or Mixed).
/// if showStats=true was specified in the request this field will contain information about the document payload.
/// Document level sentiment confidence scores between 0 and 1 for each sentiment class.
/// Sentence level sentiment analysis.
/// Warnings encountered while processing document.
- internal DocumentSentimentInternal(string id, TextSentiment sentiment, TextDocumentStatistics? statistics, SentimentConfidenceScores confidenceScores, IReadOnlyList sentences, IReadOnlyList warnings)
+ internal DocumentSentiment(string id, DocumentSentimentValue sentiment, DocumentStatistics statistics, SentimentConfidenceScorePerLabel confidenceScores, IReadOnlyList sentences, IReadOnlyList warnings)
{
Id = id;
Sentiment = sentiment;
@@ -70,14 +68,14 @@ internal DocumentSentimentInternal(string id, TextSentiment sentiment, TextDocum
/// Unique, non-empty document identifier.
public string Id { get; }
/// Predicted sentiment for document (Negative, Neutral, Positive, or Mixed).
- public TextSentiment Sentiment { get; }
+ public DocumentSentimentValue Sentiment { get; }
/// if showStats=true was specified in the request this field will contain information about the document payload.
- public TextDocumentStatistics? Statistics { get; }
+ public DocumentStatistics Statistics { get; }
/// Document level sentiment confidence scores between 0 and 1 for each sentiment class.
- public SentimentConfidenceScores ConfidenceScores { get; }
+ public SentimentConfidenceScorePerLabel ConfidenceScores { get; }
/// Sentence level sentiment analysis.
- public IReadOnlyList Sentences { get; }
+ public IReadOnlyList Sentences { get; }
/// Warnings encountered while processing document.
- public IReadOnlyList Warnings { get; }
+ public IReadOnlyList Warnings { get; }
}
}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DocumentSentimentValue.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DocumentSentimentValue.Serialization.cs
new file mode 100644
index 0000000000000..444c1e85f6b63
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DocumentSentimentValue.Serialization.cs
@@ -0,0 +1,32 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+
+namespace Azure.AI.TextAnalytics.Legacy.Models
+{
+ internal static partial class DocumentSentimentValueExtensions
+ {
+ public static string ToSerialString(this DocumentSentimentValue value) => value switch
+ {
+ DocumentSentimentValue.Positive => "positive",
+ DocumentSentimentValue.Neutral => "neutral",
+ DocumentSentimentValue.Negative => "negative",
+ DocumentSentimentValue.Mixed => "mixed",
+ _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown DocumentSentimentValue value.")
+ };
+
+ public static DocumentSentimentValue ToDocumentSentimentValue(this string value)
+ {
+ if (string.Equals(value, "positive", StringComparison.InvariantCultureIgnoreCase)) return DocumentSentimentValue.Positive;
+ if (string.Equals(value, "neutral", StringComparison.InvariantCultureIgnoreCase)) return DocumentSentimentValue.Neutral;
+ if (string.Equals(value, "negative", StringComparison.InvariantCultureIgnoreCase)) return DocumentSentimentValue.Negative;
+ if (string.Equals(value, "mixed", StringComparison.InvariantCultureIgnoreCase)) return DocumentSentimentValue.Mixed;
+ throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown DocumentSentimentValue value.");
+ }
+ }
+}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DocumentStatistics.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DocumentStatistics.Serialization.cs
new file mode 100644
index 0000000000000..9432c9cfa1534
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DocumentStatistics.Serialization.cs
@@ -0,0 +1,35 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.AI.TextAnalytics.Legacy
+{
+ internal partial class DocumentStatistics
+ {
+ internal static DocumentStatistics DeserializeDocumentStatistics(JsonElement element)
+ {
+ int charactersCount = default;
+ int transactionsCount = default;
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("charactersCount"))
+ {
+ charactersCount = property.Value.GetInt32();
+ continue;
+ }
+ if (property.NameEquals("transactionsCount"))
+ {
+ transactionsCount = property.Value.GetInt32();
+ continue;
+ }
+ }
+ return new DocumentStatistics(charactersCount, transactionsCount);
+ }
+ }
+}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DocumentStatistics.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DocumentStatistics.cs
new file mode 100644
index 0000000000000..a585646d24ede
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/DocumentStatistics.cs
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+namespace Azure.AI.TextAnalytics.Legacy
+{
+ /// if showStats=true was specified in the request this field will contain information about the document payload.
+ internal partial class DocumentStatistics
+ {
+ /// Initializes a new instance of DocumentStatistics.
+ /// Number of text elements recognized in the document.
+ /// Number of transactions for the document.
+ internal DocumentStatistics(int charactersCount, int transactionsCount)
+ {
+ CharactersCount = charactersCount;
+ TransactionsCount = transactionsCount;
+ }
+
+ /// Number of text elements recognized in the document.
+ public int CharactersCount { get; }
+ /// Number of transactions for the document.
+ public int TransactionsCount { get; }
+ }
+}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/EntitiesResult.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/EntitiesResult.Serialization.cs
new file mode 100644
index 0000000000000..21fa80dced9e3
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/EntitiesResult.Serialization.cs
@@ -0,0 +1,63 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.AI.TextAnalytics.Legacy
+{
+ internal partial class EntitiesResult
+ {
+ internal static EntitiesResult DeserializeEntitiesResult(JsonElement element)
+ {
+ IReadOnlyList documents = default;
+ IReadOnlyList errors = default;
+ Optional statistics = default;
+ string modelVersion = default;
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("documents"))
+ {
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(DocumentEntities.DeserializeDocumentEntities(item));
+ }
+ documents = array;
+ continue;
+ }
+ if (property.NameEquals("errors"))
+ {
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(DocumentError.DeserializeDocumentError(item));
+ }
+ errors = array;
+ continue;
+ }
+ if (property.NameEquals("statistics"))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ property.ThrowNonNullablePropertyIsNull();
+ continue;
+ }
+ statistics = RequestStatistics.DeserializeRequestStatistics(property.Value);
+ continue;
+ }
+ if (property.NameEquals("modelVersion"))
+ {
+ modelVersion = property.Value.GetString();
+ continue;
+ }
+ }
+ return new EntitiesResult(documents, errors, statistics.Value, modelVersion);
+ }
+ }
+}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/EntitiesResult.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/EntitiesResult.cs
new file mode 100644
index 0000000000000..f8cd48a1536fb
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/EntitiesResult.cs
@@ -0,0 +1,64 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace Azure.AI.TextAnalytics.Legacy
+{
+ /// The EntitiesResult.
+ internal partial class EntitiesResult
+ {
+ /// Initializes a new instance of EntitiesResult.
+ /// Response by document.
+ /// Errors by document id.
+ /// This field indicates which model is used for scoring.
+ /// , or is null.
+ internal EntitiesResult(IEnumerable documents, IEnumerable errors, string modelVersion)
+ {
+ if (documents == null)
+ {
+ throw new ArgumentNullException(nameof(documents));
+ }
+ if (errors == null)
+ {
+ throw new ArgumentNullException(nameof(errors));
+ }
+ if (modelVersion == null)
+ {
+ throw new ArgumentNullException(nameof(modelVersion));
+ }
+
+ Documents = documents.ToList();
+ Errors = errors.ToList();
+ ModelVersion = modelVersion;
+ }
+
+ /// Initializes a new instance of EntitiesResult.
+ /// Response by document.
+ /// Errors by document id.
+ /// if showStats=true was specified in the request this field will contain information about the request payload.
+ /// This field indicates which model is used for scoring.
+ internal EntitiesResult(IReadOnlyList documents, IReadOnlyList errors, RequestStatistics statistics, string modelVersion)
+ {
+ Documents = documents;
+ Errors = errors;
+ Statistics = statistics;
+ ModelVersion = modelVersion;
+ }
+
+ /// Response by document.
+ public IReadOnlyList Documents { get; }
+ /// Errors by document id.
+ public IReadOnlyList Errors { get; }
+ /// if showStats=true was specified in the request this field will contain information about the request payload.
+ public RequestStatistics Statistics { get; }
+ /// This field indicates which model is used for scoring.
+ public string ModelVersion { get; }
+ }
+}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/EntitiesTask.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/EntitiesTask.Serialization.cs
similarity index 95%
rename from sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/EntitiesTask.Serialization.cs
rename to sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/EntitiesTask.Serialization.cs
index bdd14813fafa9..259d3b795520a 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/EntitiesTask.Serialization.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/EntitiesTask.Serialization.cs
@@ -8,7 +8,7 @@
using System.Text.Json;
using Azure.Core;
-namespace Azure.AI.TextAnalytics.Models
+namespace Azure.AI.TextAnalytics.Legacy
{
internal partial class EntitiesTask : IUtf8JsonSerializable
{
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/EntitiesTask.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/EntitiesTask.cs
similarity index 87%
rename from sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/EntitiesTask.cs
rename to sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/EntitiesTask.cs
index 6529309282e08..9c80d5d08fa0b 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/EntitiesTask.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/EntitiesTask.cs
@@ -5,7 +5,9 @@
#nullable disable
-namespace Azure.AI.TextAnalytics.Models
+using Azure.AI.TextAnalytics.Legacy.Models;
+
+namespace Azure.AI.TextAnalytics.Legacy
{
/// The EntitiesTask.
internal partial class EntitiesTask
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/EntitiesTaskParameters.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/EntitiesTaskParameters.Serialization.cs
new file mode 100644
index 0000000000000..354da872f20c1
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/EntitiesTaskParameters.Serialization.cs
@@ -0,0 +1,36 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.AI.TextAnalytics.Legacy.Models
+{
+ internal partial class EntitiesTaskParameters : IUtf8JsonSerializable
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
+ {
+ writer.WriteStartObject();
+ if (Optional.IsDefined(ModelVersion))
+ {
+ writer.WritePropertyName("model-version");
+ writer.WriteStringValue(ModelVersion);
+ }
+ if (Optional.IsDefined(LoggingOptOut))
+ {
+ writer.WritePropertyName("loggingOptOut");
+ writer.WriteBooleanValue(LoggingOptOut.Value);
+ }
+ if (Optional.IsDefined(StringIndexType))
+ {
+ writer.WritePropertyName("stringIndexType");
+ writer.WriteStringValue(StringIndexType.Value.ToString());
+ }
+ writer.WriteEndObject();
+ }
+ }
+}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/EntitiesTaskParameters.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/EntitiesTaskParameters.cs
new file mode 100644
index 0000000000000..851efe9776303
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/EntitiesTaskParameters.cs
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using Azure.AI.TextAnalytics.Legacy;
+
+namespace Azure.AI.TextAnalytics.Legacy.Models
+{
+ /// The EntitiesTaskParameters.
+ internal partial class EntitiesTaskParameters
+ {
+ /// Initializes a new instance of EntitiesTaskParameters.
+ public EntitiesTaskParameters()
+ {
+ }
+
+ /// Gets or sets the model version.
+ public string ModelVersion { get; set; }
+ /// Gets or sets the logging opt out.
+ public bool? LoggingOptOut { get; set; }
+ /// Gets or sets the string index type.
+ public StringIndexType? StringIndexType { get; set; }
+ }
+}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/EntitiesTaskResult.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/EntitiesTaskResult.Serialization.cs
new file mode 100644
index 0000000000000..a68fe54a46d5b
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/EntitiesTaskResult.Serialization.cs
@@ -0,0 +1,34 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.AI.TextAnalytics.Legacy
+{
+ internal partial class EntitiesTaskResult
+ {
+ internal static EntitiesTaskResult DeserializeEntitiesTaskResult(JsonElement element)
+ {
+ Optional results = default;
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("results"))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ property.ThrowNonNullablePropertyIsNull();
+ continue;
+ }
+ results = EntitiesResult.DeserializeEntitiesResult(property.Value);
+ continue;
+ }
+ }
+ return new EntitiesTaskResult(results.Value);
+ }
+ }
+}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/EntitiesTaskResult.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/EntitiesTaskResult.cs
new file mode 100644
index 0000000000000..7f7f81e234865
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/EntitiesTaskResult.cs
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+namespace Azure.AI.TextAnalytics.Legacy
+{
+ /// The EntitiesTaskResult.
+ internal partial class EntitiesTaskResult
+ {
+ /// Initializes a new instance of EntitiesTaskResult.
+ internal EntitiesTaskResult()
+ {
+ }
+
+ /// Initializes a new instance of EntitiesTaskResult.
+ ///
+ internal EntitiesTaskResult(EntitiesResult results)
+ {
+ Results = results;
+ }
+
+ /// Gets the results.
+ public EntitiesResult Results { get; }
+ }
+}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/Entity.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/Entity.Serialization.cs
new file mode 100644
index 0000000000000..10945e57b3f35
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/Entity.Serialization.cs
@@ -0,0 +1,59 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.AI.TextAnalytics.Legacy
+{
+ internal partial class Entity
+ {
+ internal static Entity DeserializeEntity(JsonElement element)
+ {
+ string text = default;
+ string category = default;
+ Optional subcategory = default;
+ int offset = default;
+ int length = default;
+ double confidenceScore = default;
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("text"))
+ {
+ text = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("category"))
+ {
+ category = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("subcategory"))
+ {
+ subcategory = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("offset"))
+ {
+ offset = property.Value.GetInt32();
+ continue;
+ }
+ if (property.NameEquals("length"))
+ {
+ length = property.Value.GetInt32();
+ continue;
+ }
+ if (property.NameEquals("confidenceScore"))
+ {
+ confidenceScore = property.Value.GetDouble();
+ continue;
+ }
+ }
+ return new Entity(text, category, subcategory.Value, offset, length, confidenceScore);
+ }
+ }
+}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/Entity.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/Entity.cs
new file mode 100644
index 0000000000000..1093c06857d55
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/Entity.cs
@@ -0,0 +1,70 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+
+namespace Azure.AI.TextAnalytics.Legacy
+{
+ /// The Entity.
+ internal partial class Entity
+ {
+ /// Initializes a new instance of Entity.
+ /// Entity text as appears in the request.
+ /// Entity type.
+ /// Start position for the entity text. Use of different 'stringIndexType' values can affect the offset returned.
+ /// Length for the entity text. Use of different 'stringIndexType' values can affect the length returned.
+ /// Confidence score between 0 and 1 of the extracted entity.
+ /// or is null.
+ internal Entity(string text, string category, int offset, int length, double confidenceScore)
+ {
+ if (text == null)
+ {
+ throw new ArgumentNullException(nameof(text));
+ }
+ if (category == null)
+ {
+ throw new ArgumentNullException(nameof(category));
+ }
+
+ Text = text;
+ Category = category;
+ Offset = offset;
+ Length = length;
+ ConfidenceScore = confidenceScore;
+ }
+
+ /// Initializes a new instance of Entity.
+ /// Entity text as appears in the request.
+ /// Entity type.
+ /// (Optional) Entity sub type.
+ /// Start position for the entity text. Use of different 'stringIndexType' values can affect the offset returned.
+ /// Length for the entity text. Use of different 'stringIndexType' values can affect the length returned.
+ /// Confidence score between 0 and 1 of the extracted entity.
+ internal Entity(string text, string category, string subcategory, int offset, int length, double confidenceScore)
+ {
+ Text = text;
+ Category = category;
+ Subcategory = subcategory;
+ Offset = offset;
+ Length = length;
+ ConfidenceScore = confidenceScore;
+ }
+
+ /// Entity text as appears in the request.
+ public string Text { get; }
+ /// Entity type.
+ public string Category { get; }
+ /// (Optional) Entity sub type.
+ public string Subcategory { get; }
+ /// Start position for the entity text. Use of different 'stringIndexType' values can affect the offset returned.
+ public int Offset { get; }
+ /// Length for the entity text. Use of different 'stringIndexType' values can affect the length returned.
+ public int Length { get; }
+ /// Confidence score between 0 and 1 of the extracted entity.
+ public double ConfidenceScore { get; }
+ }
+}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/EntityLinkingResult.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/EntityLinkingResult.Serialization.cs
new file mode 100644
index 0000000000000..0f54866561860
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/EntityLinkingResult.Serialization.cs
@@ -0,0 +1,63 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.AI.TextAnalytics.Legacy
+{
+ internal partial class EntityLinkingResult
+ {
+ internal static EntityLinkingResult DeserializeEntityLinkingResult(JsonElement element)
+ {
+ IReadOnlyList documents = default;
+ IReadOnlyList errors = default;
+ Optional statistics = default;
+ string modelVersion = default;
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("documents"))
+ {
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(DocumentLinkedEntities.DeserializeDocumentLinkedEntities(item));
+ }
+ documents = array;
+ continue;
+ }
+ if (property.NameEquals("errors"))
+ {
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(DocumentError.DeserializeDocumentError(item));
+ }
+ errors = array;
+ continue;
+ }
+ if (property.NameEquals("statistics"))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ property.ThrowNonNullablePropertyIsNull();
+ continue;
+ }
+ statistics = RequestStatistics.DeserializeRequestStatistics(property.Value);
+ continue;
+ }
+ if (property.NameEquals("modelVersion"))
+ {
+ modelVersion = property.Value.GetString();
+ continue;
+ }
+ }
+ return new EntityLinkingResult(documents, errors, statistics.Value, modelVersion);
+ }
+ }
+}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/EntityLinkingResult.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/EntityLinkingResult.cs
new file mode 100644
index 0000000000000..1d2f91e28cc6a
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/EntityLinkingResult.cs
@@ -0,0 +1,64 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace Azure.AI.TextAnalytics.Legacy
+{
+ /// The EntityLinkingResult.
+ internal partial class EntityLinkingResult
+ {
+ /// Initializes a new instance of EntityLinkingResult.
+ /// Response by document.
+ /// Errors by document id.
+ /// This field indicates which model is used for scoring.
+ /// , or is null.
+ internal EntityLinkingResult(IEnumerable documents, IEnumerable errors, string modelVersion)
+ {
+ if (documents == null)
+ {
+ throw new ArgumentNullException(nameof(documents));
+ }
+ if (errors == null)
+ {
+ throw new ArgumentNullException(nameof(errors));
+ }
+ if (modelVersion == null)
+ {
+ throw new ArgumentNullException(nameof(modelVersion));
+ }
+
+ Documents = documents.ToList();
+ Errors = errors.ToList();
+ ModelVersion = modelVersion;
+ }
+
+ /// Initializes a new instance of EntityLinkingResult.
+ /// Response by document.
+ /// Errors by document id.
+ /// if showStats=true was specified in the request this field will contain information about the request payload.
+ /// This field indicates which model is used for scoring.
+ internal EntityLinkingResult(IReadOnlyList documents, IReadOnlyList errors, RequestStatistics statistics, string modelVersion)
+ {
+ Documents = documents;
+ Errors = errors;
+ Statistics = statistics;
+ ModelVersion = modelVersion;
+ }
+
+ /// Response by document.
+ public IReadOnlyList Documents { get; }
+ /// Errors by document id.
+ public IReadOnlyList Errors { get; }
+ /// if showStats=true was specified in the request this field will contain information about the request payload.
+ public RequestStatistics Statistics { get; }
+ /// This field indicates which model is used for scoring.
+ public string ModelVersion { get; }
+ }
+}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/EntityLinkingTask.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/EntityLinkingTask.Serialization.cs
similarity index 95%
rename from sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/EntityLinkingTask.Serialization.cs
rename to sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/EntityLinkingTask.Serialization.cs
index bc86e03bfdf6d..10735ee520369 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/EntityLinkingTask.Serialization.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/EntityLinkingTask.Serialization.cs
@@ -8,7 +8,7 @@
using System.Text.Json;
using Azure.Core;
-namespace Azure.AI.TextAnalytics.Models
+namespace Azure.AI.TextAnalytics.Legacy
{
internal partial class EntityLinkingTask : IUtf8JsonSerializable
{
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/EntityLinkingTask.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/EntityLinkingTask.cs
similarity index 88%
rename from sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/EntityLinkingTask.cs
rename to sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/EntityLinkingTask.cs
index f35ce7ef91327..c7367dc351cbd 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/EntityLinkingTask.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/EntityLinkingTask.cs
@@ -5,7 +5,9 @@
#nullable disable
-namespace Azure.AI.TextAnalytics.Models
+using Azure.AI.TextAnalytics.Legacy.Models;
+
+namespace Azure.AI.TextAnalytics.Legacy
{
/// The EntityLinkingTask.
internal partial class EntityLinkingTask
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/EntityLinkingTaskParameters.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/EntityLinkingTaskParameters.Serialization.cs
new file mode 100644
index 0000000000000..fba9fe1391bfc
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/EntityLinkingTaskParameters.Serialization.cs
@@ -0,0 +1,36 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.AI.TextAnalytics.Legacy.Models
+{
+ internal partial class EntityLinkingTaskParameters : IUtf8JsonSerializable
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
+ {
+ writer.WriteStartObject();
+ if (Optional.IsDefined(ModelVersion))
+ {
+ writer.WritePropertyName("model-version");
+ writer.WriteStringValue(ModelVersion);
+ }
+ if (Optional.IsDefined(LoggingOptOut))
+ {
+ writer.WritePropertyName("loggingOptOut");
+ writer.WriteBooleanValue(LoggingOptOut.Value);
+ }
+ if (Optional.IsDefined(StringIndexType))
+ {
+ writer.WritePropertyName("stringIndexType");
+ writer.WriteStringValue(StringIndexType.Value.ToString());
+ }
+ writer.WriteEndObject();
+ }
+ }
+}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/EntityLinkingTaskParameters.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/EntityLinkingTaskParameters.cs
new file mode 100644
index 0000000000000..31bf6a2b379ef
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/EntityLinkingTaskParameters.cs
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using Azure.AI.TextAnalytics.Legacy;
+
+namespace Azure.AI.TextAnalytics.Legacy.Models
+{
+ /// The EntityLinkingTaskParameters.
+ internal partial class EntityLinkingTaskParameters
+ {
+ /// Initializes a new instance of EntityLinkingTaskParameters.
+ public EntityLinkingTaskParameters()
+ {
+ }
+
+ /// Gets or sets the model version.
+ public string ModelVersion { get; set; }
+ /// Gets or sets the logging opt out.
+ public bool? LoggingOptOut { get; set; }
+ /// Gets or sets the string index type.
+ public StringIndexType? StringIndexType { get; set; }
+ }
+}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/EntityLinkingTaskResult.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/EntityLinkingTaskResult.Serialization.cs
new file mode 100644
index 0000000000000..89b2eaeadab1b
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/EntityLinkingTaskResult.Serialization.cs
@@ -0,0 +1,34 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.AI.TextAnalytics.Legacy
+{
+ internal partial class EntityLinkingTaskResult
+ {
+ internal static EntityLinkingTaskResult DeserializeEntityLinkingTaskResult(JsonElement element)
+ {
+ Optional results = default;
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("results"))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ property.ThrowNonNullablePropertyIsNull();
+ continue;
+ }
+ results = EntityLinkingResult.DeserializeEntityLinkingResult(property.Value);
+ continue;
+ }
+ }
+ return new EntityLinkingTaskResult(results.Value);
+ }
+ }
+}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/EntityLinkingTaskResult.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/EntityLinkingTaskResult.cs
new file mode 100644
index 0000000000000..85c270d888470
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/EntityLinkingTaskResult.cs
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+namespace Azure.AI.TextAnalytics.Legacy
+{
+ /// The EntityLinkingTaskResult.
+ internal partial class EntityLinkingTaskResult
+ {
+ /// Initializes a new instance of EntityLinkingTaskResult.
+ internal EntityLinkingTaskResult()
+ {
+ }
+
+ /// Initializes a new instance of EntityLinkingTaskResult.
+ ///
+ internal EntityLinkingTaskResult(EntityLinkingResult results)
+ {
+ Results = results;
+ }
+
+ /// Gets the results.
+ public EntityLinkingResult Results { get; }
+ }
+}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/ErrorCodeValue.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/ErrorCodeValue.cs
new file mode 100644
index 0000000000000..a17b2852afa53
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/ErrorCodeValue.cs
@@ -0,0 +1,60 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ComponentModel;
+
+namespace Azure.AI.TextAnalytics.Legacy.Models
+{
+ /// Error code.
+ internal readonly partial struct ErrorCodeValue : IEquatable
+ {
+ private readonly string _value;
+
+ /// Initializes a new instance of .
+ /// is null.
+ public ErrorCodeValue(string value)
+ {
+ _value = value ?? throw new ArgumentNullException(nameof(value));
+ }
+
+ private const string InvalidRequestValue = "InvalidRequest";
+ private const string InvalidArgumentValue = "InvalidArgument";
+ private const string InternalServerErrorValue = "InternalServerError";
+ private const string ServiceUnavailableValue = "ServiceUnavailable";
+ private const string NotFoundValue = "NotFound";
+
+ /// InvalidRequest.
+ public static ErrorCodeValue InvalidRequest { get; } = new ErrorCodeValue(InvalidRequestValue);
+ /// InvalidArgument.
+ public static ErrorCodeValue InvalidArgument { get; } = new ErrorCodeValue(InvalidArgumentValue);
+ /// InternalServerError.
+ public static ErrorCodeValue InternalServerError { get; } = new ErrorCodeValue(InternalServerErrorValue);
+ /// ServiceUnavailable.
+ public static ErrorCodeValue ServiceUnavailable { get; } = new ErrorCodeValue(ServiceUnavailableValue);
+ /// NotFound.
+ public static ErrorCodeValue NotFound { get; } = new ErrorCodeValue(NotFoundValue);
+ /// Determines if two values are the same.
+ public static bool operator ==(ErrorCodeValue left, ErrorCodeValue right) => left.Equals(right);
+ /// Determines if two values are not the same.
+ public static bool operator !=(ErrorCodeValue left, ErrorCodeValue right) => !left.Equals(right);
+ /// Converts a string to a .
+ public static implicit operator ErrorCodeValue(string value) => new ErrorCodeValue(value);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool Equals(object obj) => obj is ErrorCodeValue other && Equals(other);
+ ///
+ public bool Equals(ErrorCodeValue other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override int GetHashCode() => _value?.GetHashCode() ?? 0;
+ ///
+ public override string ToString() => _value;
+ }
+}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/ErrorResponse.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/ErrorResponse.Serialization.cs
new file mode 100644
index 0000000000000..8d55002ac05bd
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/ErrorResponse.Serialization.cs
@@ -0,0 +1,29 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.AI.TextAnalytics.Legacy
+{
+ internal partial class ErrorResponse
+ {
+ internal static ErrorResponse DeserializeErrorResponse(JsonElement element)
+ {
+ TextAnalyticsError error = default;
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("error"))
+ {
+ error = TextAnalyticsError.DeserializeTextAnalyticsError(property.Value);
+ continue;
+ }
+ }
+ return new ErrorResponse(error);
+ }
+ }
+}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/ErrorResponse.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/ErrorResponse.cs
new file mode 100644
index 0000000000000..c10fc7cb98d9a
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/ErrorResponse.cs
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+
+namespace Azure.AI.TextAnalytics.Legacy
+{
+ /// The ErrorResponse.
+ internal partial class ErrorResponse
+ {
+ /// Initializes a new instance of ErrorResponse.
+ /// Document Error.
+ /// is null.
+ internal ErrorResponse(TextAnalyticsError error)
+ {
+ if (error == null)
+ {
+ throw new ArgumentNullException(nameof(error));
+ }
+
+ Error = error;
+ }
+
+ /// Document Error.
+ public TextAnalyticsError Error { get; }
+ }
+}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/ExtractedDocumentSummary.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/ExtractedDocumentSummary.Serialization.cs
similarity index 76%
rename from sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/ExtractedDocumentSummary.Serialization.cs
rename to sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/ExtractedDocumentSummary.Serialization.cs
index 6bcbd03b5044c..c8fc3ba5f0f46 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/ExtractedDocumentSummary.Serialization.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/ExtractedDocumentSummary.Serialization.cs
@@ -7,10 +7,9 @@
using System.Collections.Generic;
using System.Text.Json;
-using Azure.AI.TextAnalytics;
using Azure.Core;
-namespace Azure.AI.TextAnalytics.Models
+namespace Azure.AI.TextAnalytics.Legacy
{
internal partial class ExtractedDocumentSummary
{
@@ -18,8 +17,8 @@ internal static ExtractedDocumentSummary DeserializeExtractedDocumentSummary(Jso
{
string id = default;
IReadOnlyList sentences = default;
- IReadOnlyList warnings = default;
- Optional statistics = default;
+ IReadOnlyList warnings = default;
+ Optional statistics = default;
foreach (var property in element.EnumerateObject())
{
if (property.NameEquals("id"))
@@ -39,10 +38,10 @@ internal static ExtractedDocumentSummary DeserializeExtractedDocumentSummary(Jso
}
if (property.NameEquals("warnings"))
{
- List array = new List();
+ List array = new List();
foreach (var item in property.Value.EnumerateArray())
{
- array.Add(TextAnalyticsWarningInternal.DeserializeTextAnalyticsWarningInternal(item));
+ array.Add(TextAnalyticsWarning.DeserializeTextAnalyticsWarning(item));
}
warnings = array;
continue;
@@ -54,11 +53,11 @@ internal static ExtractedDocumentSummary DeserializeExtractedDocumentSummary(Jso
property.ThrowNonNullablePropertyIsNull();
continue;
}
- statistics = TextDocumentStatistics.DeserializeTextDocumentStatistics(property.Value);
+ statistics = DocumentStatistics.DeserializeDocumentStatistics(property.Value);
continue;
}
}
- return new ExtractedDocumentSummary(id, sentences, warnings, Optional.ToNullable(statistics));
+ return new ExtractedDocumentSummary(id, sentences, warnings, statistics.Value);
}
}
}
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/ExtractedDocumentSummary.cs b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/ExtractedDocumentSummary.cs
similarity index 90%
rename from sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/ExtractedDocumentSummary.cs
rename to sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/ExtractedDocumentSummary.cs
index 57d1926220b43..bddeb22fa3dd6 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/ExtractedDocumentSummary.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Generated/Models/ExtractedDocumentSummary.cs
@@ -8,9 +8,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using Azure.AI.TextAnalytics;
-namespace Azure.AI.TextAnalytics.Models
+namespace Azure.AI.TextAnalytics.Legacy
{
/// The ExtractedDocumentSummary.
internal partial class ExtractedDocumentSummary
@@ -20,7 +19,7 @@ internal partial class ExtractedDocumentSummary
/// A ranked list of sentences representing the extracted summary.
/// Warnings encountered while processing document.
/// , or is null.
- internal ExtractedDocumentSummary(string id, IEnumerable sentences, IEnumerable warnings)
+ internal ExtractedDocumentSummary(string id, IEnumerable sentences, IEnumerable warnings)
{
if (id == null)
{
@@ -45,7 +44,7 @@ internal ExtractedDocumentSummary(string id, IEnumerable A ranked list of sentences representing the extracted summary.
/// Warnings encountered while processing document.
/// if showStats=true was specified in the request this field will contain information about the document payload.
- internal ExtractedDocumentSummary(string id, IReadOnlyList sentences, IReadOnlyList warnings, TextDocumentStatistics? statistics)
+ internal ExtractedDocumentSummary(string id, IReadOnlyList