diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 97a866d241eb..3999c923e4ef 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -181,7 +181,6 @@ /sdk/cognitiveservices/Vision.Face/ @JinyuID @dipidoo @SteveMSFT @msyache @longli0 @ShaoAnLin @lulululululu # PRLabel: %Cognitive - Form Recognizer -/sdk/documentintelligence/ @kinelski @pallavit @joseharriaga /sdk/formrecognizer/ @kinelski @pallavit @joseharriaga # ServiceLabel: %Cognitive - Form Recognizer %Service Attention diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/Azure.AI.DocumentIntelligence.sln b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/Azure.AI.DocumentIntelligence.sln deleted file mode 100644 index aef15a7d054d..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/Azure.AI.DocumentIntelligence.sln +++ /dev/null @@ -1,36 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.7.34031.279 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.TestFramework", "..\..\core\Azure.Core.TestFramework\src\Azure.Core.TestFramework.csproj", "{ECC730C1-4AEA-420C-916A-66B19B79E4DC}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.AI.DocumentIntelligence", "src\Azure.AI.DocumentIntelligence.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.AI.DocumentIntelligence.Tests", "tests\Azure.AI.DocumentIntelligence.Tests.csproj", "{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Release|Any CPU.Build.0 = Release|Any CPU - {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU - {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU - {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU - {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} - EndGlobalSection -EndGlobal diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/CHANGELOG.md b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/CHANGELOG.md deleted file mode 100644 index 13dd08af78ab..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/CHANGELOG.md +++ /dev/null @@ -1,11 +0,0 @@ -# Release History - -## 1.0.0-beta.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/Directory.Build.props b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/Directory.Build.props deleted file mode 100644 index 63bd836ad44b..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/Directory.Build.props +++ /dev/null @@ -1,6 +0,0 @@ - - - - diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/README.md b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/README.md deleted file mode 100644 index 87f8cd1d929e..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/README.md +++ /dev/null @@ -1,86 +0,0 @@ -# Azure.NewProject.TypeSpec client library for .NET - -Azure.NewProject.TypeSpec is a managed service that helps developers get secret simply and securely. - -Use the client library for to: - -* [Get secret](https://docs.microsoft.com/azure) - -[Source code][source_root] | [Package (NuGet)][package] | [API reference documentation][reference_docs] | [Product documentation][azconfig_docs] | [Samples][source_samples] - - [Source code](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/newprojecttypespec/Azure.NewProject.TypeSpec/src) | [Package (NuGet)](https://www.nuget.org/packages) | [API reference documentation](https://azure.github.io/azure-sdk-for-net) | [Product documentation](https://docs.microsoft.com/azure) - -## Getting started - -This section should include everything a developer needs to do to install and create their first client connection *very quickly*. - -### Install the package - -First, provide instruction for obtaining and installing the package or library. This section might include only a single line of code, like `dotnet add package package-name`, but should enable a developer to successfully install the package from NuGet, npm, or even cloning a GitHub repository. - -Install the client library for .NET with [NuGet](https://www.nuget.org/ ): - -```dotnetcli -dotnet add package Azure.NewProject.TypeSpec --prerelease -``` - -### Prerequisites - -Include a section after the install command that details any requirements that must be satisfied before a developer can [authenticate](#authenticate-the-client) and test all of the snippets in the [Examples](#examples) section. For example, for Cosmos DB: - -> You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and [Cosmos DB account](https://docs.microsoft.com/azure/cosmos-db/account-overview) (SQL API). In order to take advantage of the C# 8.0 syntax, it is recommended that you compile using the [.NET Core SDK](https://dotnet.microsoft.com/download) 3.0 or higher with a [language version](https://docs.microsoft.com/dotnet/csharp/language-reference/configure-language-version#override-a-default) of `latest`. It is also possible to compile with the .NET Core SDK 2.1.x using a language version of `preview`. - -### Authenticate the client - -If your library requires authentication for use, such as for Azure services, include instructions and example code needed for initializing and authenticating. - -For example, include details on obtaining an account key and endpoint URI, setting environment variables for each, and initializing the client object. - -## Key concepts - -The *Key concepts* section should describe the functionality of the main classes. Point out the most important and useful classes in the package (with links to their reference pages) and explain how those classes work together. Feel free to use bulleted lists, tables, code blocks, or even diagrams for clarity. - -Include the *Thread safety* and *Additional concepts* sections below at the end of your *Key concepts* section. You may remove or add links depending on what your library makes use of: - -### Thread safety - -We guarantee that all client instance methods are thread-safe and independent of each other ([guideline](https://azure.github.io/azure-sdk/dotnet_introduction.html#dotnet-service-methods-thread-safety)). This ensures that the recommendation of reusing client instances is always safe, even across threads. - -### Additional concepts - -[Client options](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#configuring-service-clients-using-clientoptions) | -[Accessing the response](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#accessing-http-response-details-using-responset) | -[Long-running operations](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#consuming-long-running-operations-using-operationt) | -[Handling failures](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#reporting-errors-requestfailedexception) | -[Diagnostics](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md) | -[Mocking](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#mocking) | -[Client lifetime](https://devblogs.microsoft.com/azure-sdk/lifetime-management-and-thread-safety-guarantees-of-azure-sdk-net-clients/) - - -## Examples - -You can familiarize yourself with different APIs using [Samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/newprojecttypespec/Azure.NewProject.TypeSpec/samples). - -## Troubleshooting - -Describe common errors and exceptions, how to "unpack" them if necessary, and include guidance for graceful handling and recovery. - -Provide information to help developers avoid throttling or other service-enforced errors they might encounter. For example, provide guidance and examples for using retry or connection policies in the API. - -If the package or a related package supports it, include tips for logging or enabling instrumentation to help them debug their code. - -## Next steps - -* Provide a link to additional code examples, ideally to those sitting alongside the README in the package's `/samples` directory. -* If appropriate, point users to other packages that might be useful. -* If you think there's a good chance that developers might stumble across your package in error (because they're searching for specific functionality and mistakenly think the package provides that functionality), point them to the packages they might be looking for. - -## Contributing - -This is a template, but your SDK readme should include details on how to contribute code to the repo/package. - - -[style-guide-msft]: https://docs.microsoft.com/style-guide/capitalization -[style-guide-cloud]: https://aka.ms/azsdk/cloud-style-guide - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/newprojecttypespec/Azure.NewProject.TypeSpec/README.png) diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/api/Azure.AI.DocumentIntelligence.netstandard2.0.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/api/Azure.AI.DocumentIntelligence.netstandard2.0.cs deleted file mode 100644 index da1ba23d9c2e..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/api/Azure.AI.DocumentIntelligence.netstandard2.0.cs +++ /dev/null @@ -1,939 +0,0 @@ -namespace Azure.AI.DocumentIntelligence -{ - public partial class AddressValue - { - internal AddressValue() { } - public string City { get { throw null; } } - public string CityDistrict { get { throw null; } } - public string CountryRegion { get { throw null; } } - public string House { get { throw null; } } - public string HouseNumber { get { throw null; } } - public string Level { get { throw null; } } - public string PoBox { get { throw null; } } - public string PostalCode { get { throw null; } } - public string Road { get { throw null; } } - public string State { get { throw null; } } - public string StateDistrict { get { throw null; } } - public string StreetAddress { get { throw null; } } - public string Suburb { get { throw null; } } - public string Unit { get { throw null; } } - } - public static partial class AIDocumentIntelligenceModelFactory - { - public static Azure.AI.DocumentIntelligence.AddressValue AddressValue(string houseNumber = null, string poBox = null, string road = null, string city = null, string state = null, string postalCode = null, string countryRegion = null, string streetAddress = null, string unit = null, string cityDistrict = null, string stateDistrict = null, string suburb = null, string house = null, string level = null) { throw null; } - public static Azure.AI.DocumentIntelligence.AnalyzedDocument AnalyzedDocument(string docType = null, System.Collections.Generic.IEnumerable boundingRegions = null, System.Collections.Generic.IEnumerable spans = null, System.Collections.Generic.IReadOnlyDictionary fields = null, float confidence = 0f) { throw null; } - public static Azure.AI.DocumentIntelligence.AnalyzeResult AnalyzeResult(string apiVersion = null, string modelId = null, Azure.AI.DocumentIntelligence.StringIndexType stringIndexType = default(Azure.AI.DocumentIntelligence.StringIndexType), Azure.AI.DocumentIntelligence.ContentFormat? contentFormat = default(Azure.AI.DocumentIntelligence.ContentFormat?), string content = null, System.Collections.Generic.IEnumerable pages = null, System.Collections.Generic.IEnumerable paragraphs = null, System.Collections.Generic.IEnumerable tables = null, System.Collections.Generic.IEnumerable figures = null, System.Collections.Generic.IEnumerable lists = null, System.Collections.Generic.IEnumerable sections = null, System.Collections.Generic.IEnumerable keyValuePairs = null, System.Collections.Generic.IEnumerable styles = null, System.Collections.Generic.IEnumerable languages = null, System.Collections.Generic.IEnumerable documents = null) { throw null; } - public static Azure.AI.DocumentIntelligence.BoundingRegion BoundingRegion(int pageNumber = 0, System.Collections.Generic.IEnumerable polygon = null) { throw null; } - public static Azure.AI.DocumentIntelligence.CurrencyValue CurrencyValue(double amount = 0, string currencySymbol = null, string currencyCode = null) { throw null; } - public static Azure.AI.DocumentIntelligence.CustomDocumentModelsDetails CustomDocumentModelsDetails(int count = 0, int limit = 0) { throw null; } - public static Azure.AI.DocumentIntelligence.DocumentBarcode DocumentBarcode(Azure.AI.DocumentIntelligence.DocumentBarcodeKind kind = default(Azure.AI.DocumentIntelligence.DocumentBarcodeKind), string value = null, System.Collections.Generic.IEnumerable polygon = null, Azure.AI.DocumentIntelligence.DocumentSpan span = null, float confidence = 0f) { throw null; } - public static Azure.AI.DocumentIntelligence.DocumentCaption DocumentCaption(string content = null, System.Collections.Generic.IEnumerable boundingRegions = null, System.Collections.Generic.IEnumerable spans = null, System.Collections.Generic.IEnumerable elements = null) { throw null; } - public static Azure.AI.DocumentIntelligence.DocumentClassifierBuildOperationDetails DocumentClassifierBuildOperationDetails(System.Guid operationId = default(System.Guid), Azure.AI.DocumentIntelligence.OperationStatus status = default(Azure.AI.DocumentIntelligence.OperationStatus), int? percentCompleted = default(int?), System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.Uri resourceLocation = null, string apiVersion = null, System.Collections.Generic.IReadOnlyDictionary tags = null, Azure.AI.DocumentIntelligence.DocumentIntelligenceError error = null, Azure.AI.DocumentIntelligence.DocumentClassifierDetails result = null) { throw null; } - public static Azure.AI.DocumentIntelligence.DocumentClassifierDetails DocumentClassifierDetails(string classifierId = null, string description = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), string apiVersion = null, System.Collections.Generic.IReadOnlyDictionary docTypes = null) { throw null; } - public static Azure.AI.DocumentIntelligence.DocumentField DocumentField(Azure.AI.DocumentIntelligence.DocumentFieldType type = default(Azure.AI.DocumentIntelligence.DocumentFieldType), string valueString = null, System.DateTimeOffset? valueDate = default(System.DateTimeOffset?), System.TimeSpan? valueTime = default(System.TimeSpan?), string valuePhoneNumber = null, double? valueNumber = default(double?), long? valueInteger = default(long?), Azure.AI.DocumentIntelligence.DocumentSelectionMarkState? valueSelectionMark = default(Azure.AI.DocumentIntelligence.DocumentSelectionMarkState?), Azure.AI.DocumentIntelligence.DocumentSignatureType? valueSignature = default(Azure.AI.DocumentIntelligence.DocumentSignatureType?), string valueCountryRegion = null, System.Collections.Generic.IEnumerable valueArray = null, System.Collections.Generic.IReadOnlyDictionary valueObject = null, Azure.AI.DocumentIntelligence.CurrencyValue valueCurrency = null, Azure.AI.DocumentIntelligence.AddressValue valueAddress = null, bool? valueBoolean = default(bool?), string content = null, System.Collections.Generic.IEnumerable boundingRegions = null, System.Collections.Generic.IEnumerable spans = null, float? confidence = default(float?)) { throw null; } - public static Azure.AI.DocumentIntelligence.DocumentFieldSchema DocumentFieldSchema(Azure.AI.DocumentIntelligence.DocumentFieldType type = default(Azure.AI.DocumentIntelligence.DocumentFieldType), string description = null, string example = null, Azure.AI.DocumentIntelligence.DocumentFieldSchema items = null, System.Collections.Generic.IReadOnlyDictionary properties = null) { throw null; } - public static Azure.AI.DocumentIntelligence.DocumentFigure DocumentFigure(System.Collections.Generic.IEnumerable boundingRegions = null, System.Collections.Generic.IEnumerable spans = null, System.Collections.Generic.IEnumerable elements = null, Azure.AI.DocumentIntelligence.DocumentCaption caption = null, System.Collections.Generic.IEnumerable footnotes = null) { throw null; } - public static Azure.AI.DocumentIntelligence.DocumentFootnote DocumentFootnote(string content = null, System.Collections.Generic.IEnumerable boundingRegions = null, System.Collections.Generic.IEnumerable spans = null, System.Collections.Generic.IEnumerable elements = null) { throw null; } - public static Azure.AI.DocumentIntelligence.DocumentFormula DocumentFormula(Azure.AI.DocumentIntelligence.DocumentFormulaKind kind = default(Azure.AI.DocumentIntelligence.DocumentFormulaKind), string value = null, System.Collections.Generic.IEnumerable polygon = null, Azure.AI.DocumentIntelligence.DocumentSpan span = null, float confidence = 0f) { throw null; } - public static Azure.AI.DocumentIntelligence.DocumentIntelligenceError DocumentIntelligenceError(string code = null, string message = null, string target = null, System.Collections.Generic.IEnumerable details = null, Azure.AI.DocumentIntelligence.InnerError innererror = null) { throw null; } - public static Azure.AI.DocumentIntelligence.DocumentKeyValueElement DocumentKeyValueElement(string content = null, System.Collections.Generic.IEnumerable boundingRegions = null, System.Collections.Generic.IEnumerable spans = null) { throw null; } - public static Azure.AI.DocumentIntelligence.DocumentKeyValuePair DocumentKeyValuePair(Azure.AI.DocumentIntelligence.DocumentKeyValueElement key = null, Azure.AI.DocumentIntelligence.DocumentKeyValueElement value = null, float confidence = 0f) { throw null; } - public static Azure.AI.DocumentIntelligence.DocumentLanguage DocumentLanguage(string locale = null, System.Collections.Generic.IEnumerable spans = null, float confidence = 0f) { throw null; } - public static Azure.AI.DocumentIntelligence.DocumentLine DocumentLine(string content = null, System.Collections.Generic.IEnumerable polygon = null, System.Collections.Generic.IEnumerable spans = null) { throw null; } - public static Azure.AI.DocumentIntelligence.DocumentList DocumentList(System.Collections.Generic.IEnumerable spans = null, System.Collections.Generic.IEnumerable items = null) { throw null; } - public static Azure.AI.DocumentIntelligence.DocumentListItem DocumentListItem(int level = 0, string content = null, System.Collections.Generic.IEnumerable boundingRegions = null, System.Collections.Generic.IEnumerable spans = null, System.Collections.Generic.IEnumerable elements = null) { throw null; } - public static Azure.AI.DocumentIntelligence.DocumentModelBuildOperationDetails DocumentModelBuildOperationDetails(System.Guid operationId = default(System.Guid), Azure.AI.DocumentIntelligence.OperationStatus status = default(Azure.AI.DocumentIntelligence.OperationStatus), int? percentCompleted = default(int?), System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.Uri resourceLocation = null, string apiVersion = null, System.Collections.Generic.IReadOnlyDictionary tags = null, Azure.AI.DocumentIntelligence.DocumentIntelligenceError error = null, Azure.AI.DocumentIntelligence.DocumentModelDetails result = null) { throw null; } - public static Azure.AI.DocumentIntelligence.DocumentModelComposeOperationDetails DocumentModelComposeOperationDetails(System.Guid operationId = default(System.Guid), Azure.AI.DocumentIntelligence.OperationStatus status = default(Azure.AI.DocumentIntelligence.OperationStatus), int? percentCompleted = default(int?), System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.Uri resourceLocation = null, string apiVersion = null, System.Collections.Generic.IReadOnlyDictionary tags = null, Azure.AI.DocumentIntelligence.DocumentIntelligenceError error = null, Azure.AI.DocumentIntelligence.DocumentModelDetails result = null) { throw null; } - public static Azure.AI.DocumentIntelligence.DocumentModelCopyToOperationDetails DocumentModelCopyToOperationDetails(System.Guid operationId = default(System.Guid), Azure.AI.DocumentIntelligence.OperationStatus status = default(Azure.AI.DocumentIntelligence.OperationStatus), int? percentCompleted = default(int?), System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.Uri resourceLocation = null, string apiVersion = null, System.Collections.Generic.IReadOnlyDictionary tags = null, Azure.AI.DocumentIntelligence.DocumentIntelligenceError error = null, Azure.AI.DocumentIntelligence.DocumentModelDetails result = null) { throw null; } - public static Azure.AI.DocumentIntelligence.DocumentModelDetails DocumentModelDetails(string modelId = null, string description = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), string apiVersion = null, System.Collections.Generic.IReadOnlyDictionary tags = null, Azure.AI.DocumentIntelligence.DocumentBuildMode? buildMode = default(Azure.AI.DocumentIntelligence.DocumentBuildMode?), Azure.AI.DocumentIntelligence.AzureBlobContentSource azureBlobSource = null, Azure.AI.DocumentIntelligence.AzureBlobFileListContentSource azureBlobFileListSource = null, System.Collections.Generic.IReadOnlyDictionary docTypes = null) { throw null; } - public static Azure.AI.DocumentIntelligence.DocumentPage DocumentPage(int pageNumber = 0, float? angle = default(float?), float? width = default(float?), float? height = default(float?), Azure.AI.DocumentIntelligence.LengthUnit? unit = default(Azure.AI.DocumentIntelligence.LengthUnit?), System.Collections.Generic.IEnumerable spans = null, System.Collections.Generic.IEnumerable words = null, System.Collections.Generic.IEnumerable selectionMarks = null, System.Collections.Generic.IEnumerable lines = null, System.Collections.Generic.IEnumerable barcodes = null, System.Collections.Generic.IEnumerable formulas = null) { throw null; } - public static Azure.AI.DocumentIntelligence.DocumentParagraph DocumentParagraph(Azure.AI.DocumentIntelligence.ParagraphRole? role = default(Azure.AI.DocumentIntelligence.ParagraphRole?), string content = null, System.Collections.Generic.IEnumerable boundingRegions = null, System.Collections.Generic.IEnumerable spans = null) { throw null; } - public static Azure.AI.DocumentIntelligence.DocumentSection DocumentSection(System.Collections.Generic.IEnumerable spans = null, System.Collections.Generic.IEnumerable elements = null) { throw null; } - public static Azure.AI.DocumentIntelligence.DocumentSelectionMark DocumentSelectionMark(Azure.AI.DocumentIntelligence.DocumentSelectionMarkState state = default(Azure.AI.DocumentIntelligence.DocumentSelectionMarkState), System.Collections.Generic.IEnumerable polygon = null, Azure.AI.DocumentIntelligence.DocumentSpan span = null, float confidence = 0f) { throw null; } - public static Azure.AI.DocumentIntelligence.DocumentSpan DocumentSpan(int offset = 0, int length = 0) { throw null; } - public static Azure.AI.DocumentIntelligence.DocumentStyle DocumentStyle(bool? isHandwritten = default(bool?), string similarFontFamily = null, Azure.AI.DocumentIntelligence.FontStyle? fontStyle = default(Azure.AI.DocumentIntelligence.FontStyle?), Azure.AI.DocumentIntelligence.FontWeight? fontWeight = default(Azure.AI.DocumentIntelligence.FontWeight?), string color = null, string backgroundColor = null, System.Collections.Generic.IEnumerable spans = null, float confidence = 0f) { throw null; } - public static Azure.AI.DocumentIntelligence.DocumentTable DocumentTable(int rowCount = 0, int columnCount = 0, System.Collections.Generic.IEnumerable cells = null, System.Collections.Generic.IEnumerable boundingRegions = null, System.Collections.Generic.IEnumerable spans = null, Azure.AI.DocumentIntelligence.DocumentCaption caption = null, System.Collections.Generic.IEnumerable footnotes = null) { throw null; } - public static Azure.AI.DocumentIntelligence.DocumentTableCell DocumentTableCell(Azure.AI.DocumentIntelligence.DocumentTableCellKind? kind = default(Azure.AI.DocumentIntelligence.DocumentTableCellKind?), int rowIndex = 0, int columnIndex = 0, int? rowSpan = default(int?), int? columnSpan = default(int?), string content = null, System.Collections.Generic.IEnumerable boundingRegions = null, System.Collections.Generic.IEnumerable spans = null, System.Collections.Generic.IEnumerable elements = null) { throw null; } - public static Azure.AI.DocumentIntelligence.DocumentTypeDetails DocumentTypeDetails(string description = null, Azure.AI.DocumentIntelligence.DocumentBuildMode? buildMode = default(Azure.AI.DocumentIntelligence.DocumentBuildMode?), System.Collections.Generic.IReadOnlyDictionary fieldSchema = null, System.Collections.Generic.IReadOnlyDictionary fieldConfidence = null) { throw null; } - public static Azure.AI.DocumentIntelligence.DocumentWord DocumentWord(string content = null, System.Collections.Generic.IEnumerable polygon = null, Azure.AI.DocumentIntelligence.DocumentSpan span = null, float confidence = 0f) { throw null; } - public static Azure.AI.DocumentIntelligence.InnerError InnerError(string code = null, string message = null, Azure.AI.DocumentIntelligence.InnerError innerErrorObject = null) { throw null; } - public static Azure.AI.DocumentIntelligence.OperationDetails OperationDetails(System.Guid operationId = default(System.Guid), Azure.AI.DocumentIntelligence.OperationStatus status = default(Azure.AI.DocumentIntelligence.OperationStatus), int? percentCompleted = default(int?), System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), string kind = "Unknown", System.Uri resourceLocation = null, string apiVersion = null, System.Collections.Generic.IReadOnlyDictionary tags = null, Azure.AI.DocumentIntelligence.DocumentIntelligenceError error = null) { throw null; } - public static Azure.AI.DocumentIntelligence.QuotaDetails QuotaDetails(int used = 0, int quota = 0, System.DateTimeOffset quotaResetDateTime = default(System.DateTimeOffset)) { throw null; } - public static Azure.AI.DocumentIntelligence.ResourceDetails ResourceDetails(Azure.AI.DocumentIntelligence.CustomDocumentModelsDetails customDocumentModels = null, Azure.AI.DocumentIntelligence.QuotaDetails customNeuralDocumentModelBuilds = null) { throw null; } - } - public partial class AnalyzedDocument - { - internal AnalyzedDocument() { } - public System.Collections.Generic.IReadOnlyList BoundingRegions { get { throw null; } } - public float Confidence { get { throw null; } } - public string DocType { get { throw null; } } - public System.Collections.Generic.IReadOnlyDictionary Fields { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Spans { get { throw null; } } - } - public partial class AnalyzeDocumentRequest - { - public AnalyzeDocumentRequest() { } - public System.BinaryData Base64Source { get { throw null; } set { } } - public System.Uri UrlSource { get { throw null; } set { } } - } - public partial class AnalyzeResult - { - internal AnalyzeResult() { } - public string ApiVersion { get { throw null; } } - public string Content { get { throw null; } } - public Azure.AI.DocumentIntelligence.ContentFormat? ContentFormat { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Documents { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Figures { get { throw null; } } - public System.Collections.Generic.IReadOnlyList KeyValuePairs { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Languages { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Lists { get { throw null; } } - public string ModelId { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Pages { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Paragraphs { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Sections { get { throw null; } } - public Azure.AI.DocumentIntelligence.StringIndexType StringIndexType { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Styles { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Tables { get { throw null; } } - } - public partial class AuthorizeCopyRequest - { - public AuthorizeCopyRequest(string modelId) { } - public string Description { get { throw null; } set { } } - public string ModelId { get { throw null; } } - public System.Collections.Generic.IDictionary Tags { get { throw null; } } - } - public partial class AzureAIDocumentIntelligenceClientOptions : Azure.Core.ClientOptions - { - public AzureAIDocumentIntelligenceClientOptions(Azure.AI.DocumentIntelligence.AzureAIDocumentIntelligenceClientOptions.ServiceVersion version = Azure.AI.DocumentIntelligence.AzureAIDocumentIntelligenceClientOptions.ServiceVersion.V2023_10_31_Preview) { } - public enum ServiceVersion - { - V2023_10_31_Preview = 1, - } - } - public partial class AzureBlobContentSource - { - public AzureBlobContentSource(System.Uri containerUrl) { } - public System.Uri ContainerUrl { get { throw null; } set { } } - public string Prefix { get { throw null; } set { } } - } - public partial class AzureBlobFileListContentSource - { - public AzureBlobFileListContentSource(System.Uri containerUrl, string fileList) { } - public System.Uri ContainerUrl { get { throw null; } set { } } - public string FileList { get { throw null; } set { } } - } - public partial class BoundingRegion - { - internal BoundingRegion() { } - public int PageNumber { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Polygon { get { throw null; } } - } - public partial class BuildDocumentClassifierRequest - { - public BuildDocumentClassifierRequest(string classifierId, System.Collections.Generic.IDictionary docTypes) { } - public string ClassifierId { get { throw null; } } - public string Description { get { throw null; } set { } } - public System.Collections.Generic.IDictionary DocTypes { get { throw null; } } - } - public partial class BuildDocumentModelRequest - { - public BuildDocumentModelRequest(string modelId, Azure.AI.DocumentIntelligence.DocumentBuildMode buildMode) { } - public Azure.AI.DocumentIntelligence.AzureBlobFileListContentSource AzureBlobFileListSource { get { throw null; } set { } } - public Azure.AI.DocumentIntelligence.AzureBlobContentSource AzureBlobSource { get { throw null; } set { } } - public Azure.AI.DocumentIntelligence.DocumentBuildMode BuildMode { get { throw null; } } - public string Description { get { throw null; } set { } } - public string ModelId { get { throw null; } } - public System.Collections.Generic.IDictionary Tags { get { throw null; } } - } - public partial class ClassifierDocumentTypeDetails - { - public ClassifierDocumentTypeDetails() { } - public Azure.AI.DocumentIntelligence.AzureBlobFileListContentSource AzureBlobFileListSource { get { throw null; } set { } } - public Azure.AI.DocumentIntelligence.AzureBlobContentSource AzureBlobSource { get { throw null; } set { } } - public Azure.AI.DocumentIntelligence.ContentSourceKind? SourceKind { get { throw null; } set { } } - } - public partial class ClassifyDocumentRequest - { - public ClassifyDocumentRequest() { } - public System.BinaryData Base64Source { get { throw null; } set { } } - public System.Uri UrlSource { get { throw null; } set { } } - } - public partial class ComponentDocumentModelDetails - { - public ComponentDocumentModelDetails(string modelId) { } - public string ModelId { get { throw null; } } - } - public partial class ComposeDocumentModelRequest - { - public ComposeDocumentModelRequest(string modelId, System.Collections.Generic.IEnumerable componentModels) { } - public System.Collections.Generic.IList ComponentModels { get { throw null; } } - public string Description { get { throw null; } set { } } - public string ModelId { get { throw null; } } - public System.Collections.Generic.IDictionary Tags { get { throw null; } } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct ContentFormat : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public ContentFormat(string value) { throw null; } - public static Azure.AI.DocumentIntelligence.ContentFormat Markdown { get { throw null; } } - public static Azure.AI.DocumentIntelligence.ContentFormat Text { get { throw null; } } - public bool Equals(Azure.AI.DocumentIntelligence.ContentFormat other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.AI.DocumentIntelligence.ContentFormat left, Azure.AI.DocumentIntelligence.ContentFormat right) { throw null; } - public static implicit operator Azure.AI.DocumentIntelligence.ContentFormat (string value) { throw null; } - public static bool operator !=(Azure.AI.DocumentIntelligence.ContentFormat left, Azure.AI.DocumentIntelligence.ContentFormat right) { throw null; } - public override string ToString() { throw null; } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct ContentSourceKind : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public ContentSourceKind(string value) { throw null; } - public static Azure.AI.DocumentIntelligence.ContentSourceKind AzureBlob { get { throw null; } } - public static Azure.AI.DocumentIntelligence.ContentSourceKind AzureBlobFileList { get { throw null; } } - public static Azure.AI.DocumentIntelligence.ContentSourceKind Base64 { get { throw null; } } - public static Azure.AI.DocumentIntelligence.ContentSourceKind Url { get { throw null; } } - public bool Equals(Azure.AI.DocumentIntelligence.ContentSourceKind other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.AI.DocumentIntelligence.ContentSourceKind left, Azure.AI.DocumentIntelligence.ContentSourceKind right) { throw null; } - public static implicit operator Azure.AI.DocumentIntelligence.ContentSourceKind (string value) { throw null; } - public static bool operator !=(Azure.AI.DocumentIntelligence.ContentSourceKind left, Azure.AI.DocumentIntelligence.ContentSourceKind right) { throw null; } - public override string ToString() { throw null; } - } - public partial class CopyAuthorization - { - public CopyAuthorization(string targetResourceId, string targetResourceRegion, string targetModelId, System.Uri targetModelLocation, string accessToken, System.DateTimeOffset expirationDateTime) { } - public string AccessToken { get { throw null; } set { } } - public System.DateTimeOffset ExpirationDateTime { get { throw null; } set { } } - public string TargetModelId { get { throw null; } set { } } - public System.Uri TargetModelLocation { get { throw null; } set { } } - public string TargetResourceId { get { throw null; } set { } } - public string TargetResourceRegion { get { throw null; } set { } } - } - public partial class CurrencyValue - { - internal CurrencyValue() { } - public double Amount { get { throw null; } } - public string CurrencyCode { get { throw null; } } - public string CurrencySymbol { get { throw null; } } - } - public partial class CustomDocumentModelsDetails - { - internal CustomDocumentModelsDetails() { } - public int Count { get { throw null; } } - public int Limit { get { throw null; } } - } - public partial class DocumentAnalysisClient - { - protected DocumentAnalysisClient() { } - public DocumentAnalysisClient(System.Uri endpoint, Azure.AzureKeyCredential credential) { } - public DocumentAnalysisClient(System.Uri endpoint, Azure.AzureKeyCredential credential, Azure.AI.DocumentIntelligence.AzureAIDocumentIntelligenceClientOptions options) { } - public DocumentAnalysisClient(System.Uri endpoint, Azure.Core.TokenCredential credential) { } - public DocumentAnalysisClient(System.Uri endpoint, Azure.Core.TokenCredential credential, Azure.AI.DocumentIntelligence.AzureAIDocumentIntelligenceClientOptions options) { } - public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } } - public virtual Azure.Operation AnalyzeDocument(Azure.WaitUntil waitUntil, string modelId, Azure.AI.DocumentIntelligence.AnalyzeDocumentRequest analyzeRequest = null, string pages = null, string locale = null, Azure.AI.DocumentIntelligence.StringIndexType? stringIndexType = default(Azure.AI.DocumentIntelligence.StringIndexType?), System.Collections.Generic.IEnumerable features = null, System.Collections.Generic.IEnumerable queryFields = null, Azure.AI.DocumentIntelligence.ContentFormat? outputContentFormat = default(Azure.AI.DocumentIntelligence.ContentFormat?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Operation AnalyzeDocument(Azure.WaitUntil waitUntil, string modelId, Azure.Core.RequestContent content, string pages = null, string locale = null, string stringIndexType = null, System.Collections.Generic.IEnumerable features = null, System.Collections.Generic.IEnumerable queryFields = null, string outputContentFormat = null, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task> AnalyzeDocumentAsync(Azure.WaitUntil waitUntil, string modelId, Azure.AI.DocumentIntelligence.AnalyzeDocumentRequest analyzeRequest = null, string pages = null, string locale = null, Azure.AI.DocumentIntelligence.StringIndexType? stringIndexType = default(Azure.AI.DocumentIntelligence.StringIndexType?), System.Collections.Generic.IEnumerable features = null, System.Collections.Generic.IEnumerable queryFields = null, Azure.AI.DocumentIntelligence.ContentFormat? outputContentFormat = default(Azure.AI.DocumentIntelligence.ContentFormat?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> AnalyzeDocumentAsync(Azure.WaitUntil waitUntil, string modelId, Azure.Core.RequestContent content, string pages = null, string locale = null, string stringIndexType = null, System.Collections.Generic.IEnumerable features = null, System.Collections.Generic.IEnumerable queryFields = null, string outputContentFormat = null, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Operation ClassifyDocument(Azure.WaitUntil waitUntil, string classifierId, Azure.AI.DocumentIntelligence.ClassifyDocumentRequest classifyRequest, Azure.AI.DocumentIntelligence.StringIndexType? stringIndexType = default(Azure.AI.DocumentIntelligence.StringIndexType?), Azure.AI.DocumentIntelligence.SplitMode? split = default(Azure.AI.DocumentIntelligence.SplitMode?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Operation ClassifyDocument(Azure.WaitUntil waitUntil, string classifierId, Azure.Core.RequestContent content, string stringIndexType = null, string split = null, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task> ClassifyDocumentAsync(Azure.WaitUntil waitUntil, string classifierId, Azure.AI.DocumentIntelligence.ClassifyDocumentRequest classifyRequest, Azure.AI.DocumentIntelligence.StringIndexType? stringIndexType = default(Azure.AI.DocumentIntelligence.StringIndexType?), Azure.AI.DocumentIntelligence.SplitMode? split = default(Azure.AI.DocumentIntelligence.SplitMode?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> ClassifyDocumentAsync(Azure.WaitUntil waitUntil, string classifierId, Azure.Core.RequestContent content, string stringIndexType = null, string split = null, Azure.RequestContext context = null) { throw null; } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct DocumentAnalysisFeature : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public DocumentAnalysisFeature(string value) { throw null; } - public static Azure.AI.DocumentIntelligence.DocumentAnalysisFeature Barcodes { get { throw null; } } - public static Azure.AI.DocumentIntelligence.DocumentAnalysisFeature Formulas { get { throw null; } } - public static Azure.AI.DocumentIntelligence.DocumentAnalysisFeature KeyValuePairs { get { throw null; } } - public static Azure.AI.DocumentIntelligence.DocumentAnalysisFeature Languages { get { throw null; } } - public static Azure.AI.DocumentIntelligence.DocumentAnalysisFeature OcrHighResolution { get { throw null; } } - public static Azure.AI.DocumentIntelligence.DocumentAnalysisFeature QueryFields { get { throw null; } } - public static Azure.AI.DocumentIntelligence.DocumentAnalysisFeature StyleFont { get { throw null; } } - public bool Equals(Azure.AI.DocumentIntelligence.DocumentAnalysisFeature other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.AI.DocumentIntelligence.DocumentAnalysisFeature left, Azure.AI.DocumentIntelligence.DocumentAnalysisFeature right) { throw null; } - public static implicit operator Azure.AI.DocumentIntelligence.DocumentAnalysisFeature (string value) { throw null; } - public static bool operator !=(Azure.AI.DocumentIntelligence.DocumentAnalysisFeature left, Azure.AI.DocumentIntelligence.DocumentAnalysisFeature right) { throw null; } - public override string ToString() { throw null; } - } - public partial class DocumentBarcode - { - internal DocumentBarcode() { } - public float Confidence { get { throw null; } } - public Azure.AI.DocumentIntelligence.DocumentBarcodeKind Kind { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Polygon { get { throw null; } } - public Azure.AI.DocumentIntelligence.DocumentSpan Span { get { throw null; } } - public string Value { get { throw null; } } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct DocumentBarcodeKind : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public DocumentBarcodeKind(string value) { throw null; } - public static Azure.AI.DocumentIntelligence.DocumentBarcodeKind Aztec { get { throw null; } } - public static Azure.AI.DocumentIntelligence.DocumentBarcodeKind Codabar { get { throw null; } } - public static Azure.AI.DocumentIntelligence.DocumentBarcodeKind Code128 { get { throw null; } } - public static Azure.AI.DocumentIntelligence.DocumentBarcodeKind Code39 { get { throw null; } } - public static Azure.AI.DocumentIntelligence.DocumentBarcodeKind Code93 { get { throw null; } } - public static Azure.AI.DocumentIntelligence.DocumentBarcodeKind DataBar { get { throw null; } } - public static Azure.AI.DocumentIntelligence.DocumentBarcodeKind DataBarExpanded { get { throw null; } } - public static Azure.AI.DocumentIntelligence.DocumentBarcodeKind DataMatrix { get { throw null; } } - public static Azure.AI.DocumentIntelligence.DocumentBarcodeKind EAN13 { get { throw null; } } - public static Azure.AI.DocumentIntelligence.DocumentBarcodeKind EAN8 { get { throw null; } } - public static Azure.AI.DocumentIntelligence.DocumentBarcodeKind ITF { get { throw null; } } - public static Azure.AI.DocumentIntelligence.DocumentBarcodeKind MaxiCode { get { throw null; } } - public static Azure.AI.DocumentIntelligence.DocumentBarcodeKind MicroQRCode { get { throw null; } } - public static Azure.AI.DocumentIntelligence.DocumentBarcodeKind PDF417 { get { throw null; } } - public static Azure.AI.DocumentIntelligence.DocumentBarcodeKind QRCode { get { throw null; } } - public static Azure.AI.DocumentIntelligence.DocumentBarcodeKind UPCA { get { throw null; } } - public static Azure.AI.DocumentIntelligence.DocumentBarcodeKind UPCE { get { throw null; } } - public bool Equals(Azure.AI.DocumentIntelligence.DocumentBarcodeKind other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.AI.DocumentIntelligence.DocumentBarcodeKind left, Azure.AI.DocumentIntelligence.DocumentBarcodeKind right) { throw null; } - public static implicit operator Azure.AI.DocumentIntelligence.DocumentBarcodeKind (string value) { throw null; } - public static bool operator !=(Azure.AI.DocumentIntelligence.DocumentBarcodeKind left, Azure.AI.DocumentIntelligence.DocumentBarcodeKind right) { throw null; } - public override string ToString() { throw null; } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct DocumentBuildMode : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public DocumentBuildMode(string value) { throw null; } - public static Azure.AI.DocumentIntelligence.DocumentBuildMode Neural { get { throw null; } } - public static Azure.AI.DocumentIntelligence.DocumentBuildMode Template { get { throw null; } } - public bool Equals(Azure.AI.DocumentIntelligence.DocumentBuildMode other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.AI.DocumentIntelligence.DocumentBuildMode left, Azure.AI.DocumentIntelligence.DocumentBuildMode right) { throw null; } - public static implicit operator Azure.AI.DocumentIntelligence.DocumentBuildMode (string value) { throw null; } - public static bool operator !=(Azure.AI.DocumentIntelligence.DocumentBuildMode left, Azure.AI.DocumentIntelligence.DocumentBuildMode right) { throw null; } - public override string ToString() { throw null; } - } - public partial class DocumentCaption - { - internal DocumentCaption() { } - public System.Collections.Generic.IReadOnlyList BoundingRegions { get { throw null; } } - public string Content { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Elements { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Spans { get { throw null; } } - } - public partial class DocumentClassifierBuildOperationDetails : Azure.AI.DocumentIntelligence.OperationDetails - { - internal DocumentClassifierBuildOperationDetails() : base (default(System.Guid), default(Azure.AI.DocumentIntelligence.OperationStatus), default(System.DateTimeOffset), default(System.DateTimeOffset), default(System.Uri)) { } - public Azure.AI.DocumentIntelligence.DocumentClassifierDetails Result { get { throw null; } } - } - public partial class DocumentClassifierDetails - { - internal DocumentClassifierDetails() { } - public string ApiVersion { get { throw null; } } - public string ClassifierId { get { throw null; } } - public System.DateTimeOffset CreatedDateTime { get { throw null; } } - public string Description { get { throw null; } } - public System.Collections.Generic.IReadOnlyDictionary DocTypes { get { throw null; } } - public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } - } - public partial class DocumentField - { - internal DocumentField() { } - public System.Collections.Generic.IReadOnlyList BoundingRegions { get { throw null; } } - public float? Confidence { get { throw null; } } - public string Content { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Spans { get { throw null; } } - public Azure.AI.DocumentIntelligence.DocumentFieldType Type { get { throw null; } } - public Azure.AI.DocumentIntelligence.AddressValue ValueAddress { get { throw null; } } - public System.Collections.Generic.IReadOnlyList ValueArray { get { throw null; } } - public bool? ValueBoolean { get { throw null; } } - public string ValueCountryRegion { get { throw null; } } - public Azure.AI.DocumentIntelligence.CurrencyValue ValueCurrency { get { throw null; } } - public System.DateTimeOffset? ValueDate { get { throw null; } } - public long? ValueInteger { get { throw null; } } - public double? ValueNumber { get { throw null; } } - public System.Collections.Generic.IReadOnlyDictionary ValueObject { get { throw null; } } - public string ValuePhoneNumber { get { throw null; } } - public Azure.AI.DocumentIntelligence.DocumentSelectionMarkState? ValueSelectionMark { get { throw null; } } - public Azure.AI.DocumentIntelligence.DocumentSignatureType? ValueSignature { get { throw null; } } - public string ValueString { get { throw null; } } - public System.TimeSpan? ValueTime { get { throw null; } } - } - public partial class DocumentFieldSchema - { - internal DocumentFieldSchema() { } - public string Description { get { throw null; } } - public string Example { get { throw null; } } - public Azure.AI.DocumentIntelligence.DocumentFieldSchema Items { get { throw null; } } - public System.Collections.Generic.IReadOnlyDictionary Properties { get { throw null; } } - public Azure.AI.DocumentIntelligence.DocumentFieldType Type { get { throw null; } } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct DocumentFieldType : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public DocumentFieldType(string value) { throw null; } - public static Azure.AI.DocumentIntelligence.DocumentFieldType Address { get { throw null; } } - public static Azure.AI.DocumentIntelligence.DocumentFieldType Array { get { throw null; } } - public static Azure.AI.DocumentIntelligence.DocumentFieldType Boolean { get { throw null; } } - public static Azure.AI.DocumentIntelligence.DocumentFieldType CountryRegion { get { throw null; } } - public static Azure.AI.DocumentIntelligence.DocumentFieldType Currency { get { throw null; } } - public static Azure.AI.DocumentIntelligence.DocumentFieldType Date { get { throw null; } } - public static Azure.AI.DocumentIntelligence.DocumentFieldType Integer { get { throw null; } } - public static Azure.AI.DocumentIntelligence.DocumentFieldType Number { get { throw null; } } - public static Azure.AI.DocumentIntelligence.DocumentFieldType Object { get { throw null; } } - public static Azure.AI.DocumentIntelligence.DocumentFieldType PhoneNumber { get { throw null; } } - public static Azure.AI.DocumentIntelligence.DocumentFieldType SelectionMark { get { throw null; } } - public static Azure.AI.DocumentIntelligence.DocumentFieldType Signature { get { throw null; } } - public static Azure.AI.DocumentIntelligence.DocumentFieldType String { get { throw null; } } - public static Azure.AI.DocumentIntelligence.DocumentFieldType Time { get { throw null; } } - public bool Equals(Azure.AI.DocumentIntelligence.DocumentFieldType other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.AI.DocumentIntelligence.DocumentFieldType left, Azure.AI.DocumentIntelligence.DocumentFieldType right) { throw null; } - public static implicit operator Azure.AI.DocumentIntelligence.DocumentFieldType (string value) { throw null; } - public static bool operator !=(Azure.AI.DocumentIntelligence.DocumentFieldType left, Azure.AI.DocumentIntelligence.DocumentFieldType right) { throw null; } - public override string ToString() { throw null; } - } - public partial class DocumentFigure - { - internal DocumentFigure() { } - public System.Collections.Generic.IReadOnlyList BoundingRegions { get { throw null; } } - public Azure.AI.DocumentIntelligence.DocumentCaption Caption { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Elements { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Footnotes { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Spans { get { throw null; } } - } - public partial class DocumentFootnote - { - internal DocumentFootnote() { } - public System.Collections.Generic.IReadOnlyList BoundingRegions { get { throw null; } } - public string Content { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Elements { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Spans { get { throw null; } } - } - public partial class DocumentFormula - { - internal DocumentFormula() { } - public float Confidence { get { throw null; } } - public Azure.AI.DocumentIntelligence.DocumentFormulaKind Kind { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Polygon { get { throw null; } } - public Azure.AI.DocumentIntelligence.DocumentSpan Span { get { throw null; } } - public string Value { get { throw null; } } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct DocumentFormulaKind : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public DocumentFormulaKind(string value) { throw null; } - public static Azure.AI.DocumentIntelligence.DocumentFormulaKind Display { get { throw null; } } - public static Azure.AI.DocumentIntelligence.DocumentFormulaKind Inline { get { throw null; } } - public bool Equals(Azure.AI.DocumentIntelligence.DocumentFormulaKind other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.AI.DocumentIntelligence.DocumentFormulaKind left, Azure.AI.DocumentIntelligence.DocumentFormulaKind right) { throw null; } - public static implicit operator Azure.AI.DocumentIntelligence.DocumentFormulaKind (string value) { throw null; } - public static bool operator !=(Azure.AI.DocumentIntelligence.DocumentFormulaKind left, Azure.AI.DocumentIntelligence.DocumentFormulaKind right) { throw null; } - public override string ToString() { throw null; } - } - public partial class DocumentIntelligenceError - { - internal DocumentIntelligenceError() { } - public string Code { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Details { get { throw null; } } - public Azure.AI.DocumentIntelligence.InnerError Innererror { get { throw null; } } - public string Message { get { throw null; } } - public string Target { get { throw null; } } - } - public partial class DocumentKeyValueElement - { - internal DocumentKeyValueElement() { } - public System.Collections.Generic.IReadOnlyList BoundingRegions { get { throw null; } } - public string Content { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Spans { get { throw null; } } - } - public partial class DocumentKeyValuePair - { - internal DocumentKeyValuePair() { } - public float Confidence { get { throw null; } } - public Azure.AI.DocumentIntelligence.DocumentKeyValueElement Key { get { throw null; } } - public Azure.AI.DocumentIntelligence.DocumentKeyValueElement Value { get { throw null; } } - } - public partial class DocumentLanguage - { - internal DocumentLanguage() { } - public float Confidence { get { throw null; } } - public string Locale { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Spans { get { throw null; } } - } - public partial class DocumentLine - { - internal DocumentLine() { } - public string Content { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Polygon { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Spans { get { throw null; } } - } - public partial class DocumentList - { - internal DocumentList() { } - public System.Collections.Generic.IReadOnlyList Items { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Spans { get { throw null; } } - } - public partial class DocumentListItem - { - internal DocumentListItem() { } - public System.Collections.Generic.IReadOnlyList BoundingRegions { get { throw null; } } - public string Content { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Elements { get { throw null; } } - public int Level { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Spans { get { throw null; } } - } - public partial class DocumentModelAdministrationClient - { - protected DocumentModelAdministrationClient() { } - public DocumentModelAdministrationClient(System.Uri endpoint, Azure.AzureKeyCredential credential) { } - public DocumentModelAdministrationClient(System.Uri endpoint, Azure.AzureKeyCredential credential, Azure.AI.DocumentIntelligence.AzureAIDocumentIntelligenceClientOptions options) { } - public DocumentModelAdministrationClient(System.Uri endpoint, Azure.Core.TokenCredential credential) { } - public DocumentModelAdministrationClient(System.Uri endpoint, Azure.Core.TokenCredential credential, Azure.AI.DocumentIntelligence.AzureAIDocumentIntelligenceClientOptions options) { } - public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } } - public virtual Azure.Response AuthorizeModelCopy(Azure.AI.DocumentIntelligence.AuthorizeCopyRequest authorizeCopyRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response AuthorizeModelCopy(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task> AuthorizeModelCopyAsync(Azure.AI.DocumentIntelligence.AuthorizeCopyRequest authorizeCopyRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task AuthorizeModelCopyAsync(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Operation BuildClassifier(Azure.WaitUntil waitUntil, Azure.AI.DocumentIntelligence.BuildDocumentClassifierRequest buildRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Operation BuildClassifier(Azure.WaitUntil waitUntil, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task> BuildClassifierAsync(Azure.WaitUntil waitUntil, Azure.AI.DocumentIntelligence.BuildDocumentClassifierRequest buildRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> BuildClassifierAsync(Azure.WaitUntil waitUntil, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Operation BuildDocumentModel(Azure.WaitUntil waitUntil, Azure.AI.DocumentIntelligence.BuildDocumentModelRequest buildRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Operation BuildDocumentModel(Azure.WaitUntil waitUntil, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task> BuildDocumentModelAsync(Azure.WaitUntil waitUntil, Azure.AI.DocumentIntelligence.BuildDocumentModelRequest buildRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> BuildDocumentModelAsync(Azure.WaitUntil waitUntil, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Operation ComposeModel(Azure.WaitUntil waitUntil, Azure.AI.DocumentIntelligence.ComposeDocumentModelRequest composeRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Operation ComposeModel(Azure.WaitUntil waitUntil, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task> ComposeModelAsync(Azure.WaitUntil waitUntil, Azure.AI.DocumentIntelligence.ComposeDocumentModelRequest composeRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> ComposeModelAsync(Azure.WaitUntil waitUntil, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Operation CopyModelTo(Azure.WaitUntil waitUntil, string modelId, Azure.AI.DocumentIntelligence.CopyAuthorization copyToRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Operation CopyModelTo(Azure.WaitUntil waitUntil, string modelId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task> CopyModelToAsync(Azure.WaitUntil waitUntil, string modelId, Azure.AI.DocumentIntelligence.CopyAuthorization copyToRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CopyModelToAsync(Azure.WaitUntil waitUntil, string modelId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response DeleteClassifier(string classifierId, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task DeleteClassifierAsync(string classifierId, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response DeleteModel(string modelId, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task DeleteModelAsync(string modelId, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response GetClassifier(string classifierId, Azure.RequestContext context) { throw null; } - public virtual Azure.Response GetClassifier(string classifierId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task GetClassifierAsync(string classifierId, Azure.RequestContext context) { throw null; } - public virtual System.Threading.Tasks.Task> GetClassifierAsync(string classifierId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetClassifiers(Azure.RequestContext context) { throw null; } - public virtual Azure.Pageable GetClassifiers(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetClassifiersAsync(Azure.RequestContext context) { throw null; } - public virtual Azure.AsyncPageable GetClassifiersAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response GetModel(string modelId, Azure.RequestContext context) { throw null; } - public virtual Azure.Response GetModel(string modelId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task GetModelAsync(string modelId, Azure.RequestContext context) { throw null; } - public virtual System.Threading.Tasks.Task> GetModelAsync(string modelId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetModels(Azure.RequestContext context) { throw null; } - public virtual Azure.Pageable GetModels(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetModelsAsync(Azure.RequestContext context) { throw null; } - public virtual Azure.AsyncPageable GetModelsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response GetOperation(System.Guid operationId, Azure.RequestContext context) { throw null; } - public virtual Azure.Response GetOperation(System.Guid operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task GetOperationAsync(System.Guid operationId, Azure.RequestContext context) { throw null; } - public virtual System.Threading.Tasks.Task> GetOperationAsync(System.Guid operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetOperations(Azure.RequestContext context) { throw null; } - public virtual Azure.Pageable GetOperations(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetOperationsAsync(Azure.RequestContext context) { throw null; } - public virtual Azure.AsyncPageable GetOperationsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response GetResourceInfo(Azure.RequestContext context) { throw null; } - public virtual Azure.Response GetResourceInfo(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task GetResourceInfoAsync(Azure.RequestContext context) { throw null; } - public virtual System.Threading.Tasks.Task> GetResourceInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - } - public partial class DocumentModelBuildOperationDetails : Azure.AI.DocumentIntelligence.OperationDetails - { - internal DocumentModelBuildOperationDetails() : base (default(System.Guid), default(Azure.AI.DocumentIntelligence.OperationStatus), default(System.DateTimeOffset), default(System.DateTimeOffset), default(System.Uri)) { } - public Azure.AI.DocumentIntelligence.DocumentModelDetails Result { get { throw null; } } - } - public partial class DocumentModelComposeOperationDetails : Azure.AI.DocumentIntelligence.OperationDetails - { - internal DocumentModelComposeOperationDetails() : base (default(System.Guid), default(Azure.AI.DocumentIntelligence.OperationStatus), default(System.DateTimeOffset), default(System.DateTimeOffset), default(System.Uri)) { } - public Azure.AI.DocumentIntelligence.DocumentModelDetails Result { get { throw null; } } - } - public partial class DocumentModelCopyToOperationDetails : Azure.AI.DocumentIntelligence.OperationDetails - { - internal DocumentModelCopyToOperationDetails() : base (default(System.Guid), default(Azure.AI.DocumentIntelligence.OperationStatus), default(System.DateTimeOffset), default(System.DateTimeOffset), default(System.Uri)) { } - public Azure.AI.DocumentIntelligence.DocumentModelDetails Result { get { throw null; } } - } - public partial class DocumentModelDetails - { - internal DocumentModelDetails() { } - public string ApiVersion { get { throw null; } } - public Azure.AI.DocumentIntelligence.AzureBlobFileListContentSource AzureBlobFileListSource { get { throw null; } } - public Azure.AI.DocumentIntelligence.AzureBlobContentSource AzureBlobSource { get { throw null; } } - public Azure.AI.DocumentIntelligence.DocumentBuildMode? BuildMode { get { throw null; } } - public System.DateTimeOffset CreatedDateTime { get { throw null; } } - public string Description { get { throw null; } } - public System.Collections.Generic.IReadOnlyDictionary DocTypes { get { throw null; } } - public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } - public string ModelId { get { throw null; } } - public System.Collections.Generic.IReadOnlyDictionary Tags { get { throw null; } } - } - public partial class DocumentPage - { - internal DocumentPage() { } - public float? Angle { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Barcodes { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Formulas { get { throw null; } } - public float? Height { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Lines { get { throw null; } } - public int PageNumber { get { throw null; } } - public System.Collections.Generic.IReadOnlyList SelectionMarks { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Spans { get { throw null; } } - public Azure.AI.DocumentIntelligence.LengthUnit? Unit { get { throw null; } } - public float? Width { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Words { get { throw null; } } - } - public partial class DocumentParagraph - { - internal DocumentParagraph() { } - public System.Collections.Generic.IReadOnlyList BoundingRegions { get { throw null; } } - public string Content { get { throw null; } } - public Azure.AI.DocumentIntelligence.ParagraphRole? Role { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Spans { get { throw null; } } - } - public partial class DocumentSection - { - internal DocumentSection() { } - public System.Collections.Generic.IReadOnlyList Elements { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Spans { get { throw null; } } - } - public partial class DocumentSelectionMark - { - internal DocumentSelectionMark() { } - public float Confidence { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Polygon { get { throw null; } } - public Azure.AI.DocumentIntelligence.DocumentSpan Span { get { throw null; } } - public Azure.AI.DocumentIntelligence.DocumentSelectionMarkState State { get { throw null; } } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct DocumentSelectionMarkState : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public DocumentSelectionMarkState(string value) { throw null; } - public static Azure.AI.DocumentIntelligence.DocumentSelectionMarkState Selected { get { throw null; } } - public static Azure.AI.DocumentIntelligence.DocumentSelectionMarkState Unselected { get { throw null; } } - public bool Equals(Azure.AI.DocumentIntelligence.DocumentSelectionMarkState other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.AI.DocumentIntelligence.DocumentSelectionMarkState left, Azure.AI.DocumentIntelligence.DocumentSelectionMarkState right) { throw null; } - public static implicit operator Azure.AI.DocumentIntelligence.DocumentSelectionMarkState (string value) { throw null; } - public static bool operator !=(Azure.AI.DocumentIntelligence.DocumentSelectionMarkState left, Azure.AI.DocumentIntelligence.DocumentSelectionMarkState right) { throw null; } - public override string ToString() { throw null; } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct DocumentSignatureType : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public DocumentSignatureType(string value) { throw null; } - public static Azure.AI.DocumentIntelligence.DocumentSignatureType Signed { get { throw null; } } - public static Azure.AI.DocumentIntelligence.DocumentSignatureType Unsigned { get { throw null; } } - public bool Equals(Azure.AI.DocumentIntelligence.DocumentSignatureType other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.AI.DocumentIntelligence.DocumentSignatureType left, Azure.AI.DocumentIntelligence.DocumentSignatureType right) { throw null; } - public static implicit operator Azure.AI.DocumentIntelligence.DocumentSignatureType (string value) { throw null; } - public static bool operator !=(Azure.AI.DocumentIntelligence.DocumentSignatureType left, Azure.AI.DocumentIntelligence.DocumentSignatureType right) { throw null; } - public override string ToString() { throw null; } - } - public partial class DocumentSpan - { - internal DocumentSpan() { } - public int Length { get { throw null; } } - public int Offset { get { throw null; } } - } - public partial class DocumentStyle - { - internal DocumentStyle() { } - public string BackgroundColor { get { throw null; } } - public string Color { get { throw null; } } - public float Confidence { get { throw null; } } - public Azure.AI.DocumentIntelligence.FontStyle? FontStyle { get { throw null; } } - public Azure.AI.DocumentIntelligence.FontWeight? FontWeight { get { throw null; } } - public bool? IsHandwritten { get { throw null; } } - public string SimilarFontFamily { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Spans { get { throw null; } } - } - public partial class DocumentTable - { - internal DocumentTable() { } - public System.Collections.Generic.IReadOnlyList BoundingRegions { get { throw null; } } - public Azure.AI.DocumentIntelligence.DocumentCaption Caption { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Cells { get { throw null; } } - public int ColumnCount { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Footnotes { get { throw null; } } - public int RowCount { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Spans { get { throw null; } } - } - public partial class DocumentTableCell - { - internal DocumentTableCell() { } - public System.Collections.Generic.IReadOnlyList BoundingRegions { get { throw null; } } - public int ColumnIndex { get { throw null; } } - public int? ColumnSpan { get { throw null; } } - public string Content { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Elements { get { throw null; } } - public Azure.AI.DocumentIntelligence.DocumentTableCellKind? Kind { get { throw null; } } - public int RowIndex { get { throw null; } } - public int? RowSpan { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Spans { get { throw null; } } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct DocumentTableCellKind : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public DocumentTableCellKind(string value) { throw null; } - public static Azure.AI.DocumentIntelligence.DocumentTableCellKind ColumnHeader { get { throw null; } } - public static Azure.AI.DocumentIntelligence.DocumentTableCellKind Content { get { throw null; } } - public static Azure.AI.DocumentIntelligence.DocumentTableCellKind Description { get { throw null; } } - public static Azure.AI.DocumentIntelligence.DocumentTableCellKind RowHeader { get { throw null; } } - public static Azure.AI.DocumentIntelligence.DocumentTableCellKind StubHead { get { throw null; } } - public bool Equals(Azure.AI.DocumentIntelligence.DocumentTableCellKind other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.AI.DocumentIntelligence.DocumentTableCellKind left, Azure.AI.DocumentIntelligence.DocumentTableCellKind right) { throw null; } - public static implicit operator Azure.AI.DocumentIntelligence.DocumentTableCellKind (string value) { throw null; } - public static bool operator !=(Azure.AI.DocumentIntelligence.DocumentTableCellKind left, Azure.AI.DocumentIntelligence.DocumentTableCellKind right) { throw null; } - public override string ToString() { throw null; } - } - public partial class DocumentTypeDetails - { - internal DocumentTypeDetails() { } - public Azure.AI.DocumentIntelligence.DocumentBuildMode? BuildMode { get { throw null; } } - public string Description { get { throw null; } } - public System.Collections.Generic.IReadOnlyDictionary FieldConfidence { get { throw null; } } - public System.Collections.Generic.IReadOnlyDictionary FieldSchema { get { throw null; } } - } - public partial class DocumentWord - { - internal DocumentWord() { } - public float Confidence { get { throw null; } } - public string Content { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Polygon { get { throw null; } } - public Azure.AI.DocumentIntelligence.DocumentSpan Span { get { throw null; } } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct FontStyle : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public FontStyle(string value) { throw null; } - public static Azure.AI.DocumentIntelligence.FontStyle Italic { get { throw null; } } - public static Azure.AI.DocumentIntelligence.FontStyle Normal { get { throw null; } } - public bool Equals(Azure.AI.DocumentIntelligence.FontStyle other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.AI.DocumentIntelligence.FontStyle left, Azure.AI.DocumentIntelligence.FontStyle right) { throw null; } - public static implicit operator Azure.AI.DocumentIntelligence.FontStyle (string value) { throw null; } - public static bool operator !=(Azure.AI.DocumentIntelligence.FontStyle left, Azure.AI.DocumentIntelligence.FontStyle right) { throw null; } - public override string ToString() { throw null; } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct FontWeight : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public FontWeight(string value) { throw null; } - public static Azure.AI.DocumentIntelligence.FontWeight Bold { get { throw null; } } - public static Azure.AI.DocumentIntelligence.FontWeight Normal { get { throw null; } } - public bool Equals(Azure.AI.DocumentIntelligence.FontWeight other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.AI.DocumentIntelligence.FontWeight left, Azure.AI.DocumentIntelligence.FontWeight right) { throw null; } - public static implicit operator Azure.AI.DocumentIntelligence.FontWeight (string value) { throw null; } - public static bool operator !=(Azure.AI.DocumentIntelligence.FontWeight left, Azure.AI.DocumentIntelligence.FontWeight right) { throw null; } - public override string ToString() { throw null; } - } - public partial class InnerError - { - internal InnerError() { } - public string Code { get { throw null; } } - public Azure.AI.DocumentIntelligence.InnerError InnerErrorObject { get { throw null; } } - public string Message { get { throw null; } } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct LengthUnit : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public LengthUnit(string value) { throw null; } - public static Azure.AI.DocumentIntelligence.LengthUnit Inch { get { throw null; } } - public static Azure.AI.DocumentIntelligence.LengthUnit Pixel { get { throw null; } } - public bool Equals(Azure.AI.DocumentIntelligence.LengthUnit other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.AI.DocumentIntelligence.LengthUnit left, Azure.AI.DocumentIntelligence.LengthUnit right) { throw null; } - public static implicit operator Azure.AI.DocumentIntelligence.LengthUnit (string value) { throw null; } - public static bool operator !=(Azure.AI.DocumentIntelligence.LengthUnit left, Azure.AI.DocumentIntelligence.LengthUnit right) { throw null; } - public override string ToString() { throw null; } - } - public abstract partial class OperationDetails - { - protected OperationDetails(System.Guid operationId, Azure.AI.DocumentIntelligence.OperationStatus status, System.DateTimeOffset createdDateTime, System.DateTimeOffset lastUpdatedDateTime, System.Uri resourceLocation) { } - public string ApiVersion { get { throw null; } } - public System.DateTimeOffset CreatedDateTime { get { throw null; } } - public Azure.AI.DocumentIntelligence.DocumentIntelligenceError Error { get { throw null; } } - public System.DateTimeOffset LastUpdatedDateTime { get { throw null; } } - public System.Guid OperationId { get { throw null; } } - public int? PercentCompleted { get { throw null; } } - public System.Uri ResourceLocation { get { throw null; } } - public Azure.AI.DocumentIntelligence.OperationStatus Status { get { throw null; } } - public System.Collections.Generic.IReadOnlyDictionary Tags { get { throw null; } } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct OperationStatus : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public OperationStatus(string value) { throw null; } - public static Azure.AI.DocumentIntelligence.OperationStatus Canceled { get { throw null; } } - public static Azure.AI.DocumentIntelligence.OperationStatus Failed { get { throw null; } } - public static Azure.AI.DocumentIntelligence.OperationStatus NotStarted { get { throw null; } } - public static Azure.AI.DocumentIntelligence.OperationStatus Running { get { throw null; } } - public static Azure.AI.DocumentIntelligence.OperationStatus Succeeded { get { throw null; } } - public bool Equals(Azure.AI.DocumentIntelligence.OperationStatus other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.AI.DocumentIntelligence.OperationStatus left, Azure.AI.DocumentIntelligence.OperationStatus right) { throw null; } - public static implicit operator Azure.AI.DocumentIntelligence.OperationStatus (string value) { throw null; } - public static bool operator !=(Azure.AI.DocumentIntelligence.OperationStatus left, Azure.AI.DocumentIntelligence.OperationStatus right) { throw null; } - public override string ToString() { throw null; } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct ParagraphRole : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public ParagraphRole(string value) { throw null; } - public static Azure.AI.DocumentIntelligence.ParagraphRole Footnote { get { throw null; } } - public static Azure.AI.DocumentIntelligence.ParagraphRole FormulaBlock { get { throw null; } } - public static Azure.AI.DocumentIntelligence.ParagraphRole PageFooter { get { throw null; } } - public static Azure.AI.DocumentIntelligence.ParagraphRole PageHeader { get { throw null; } } - public static Azure.AI.DocumentIntelligence.ParagraphRole PageNumber { get { throw null; } } - public static Azure.AI.DocumentIntelligence.ParagraphRole SectionHeading { get { throw null; } } - public static Azure.AI.DocumentIntelligence.ParagraphRole Title { get { throw null; } } - public bool Equals(Azure.AI.DocumentIntelligence.ParagraphRole other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.AI.DocumentIntelligence.ParagraphRole left, Azure.AI.DocumentIntelligence.ParagraphRole right) { throw null; } - public static implicit operator Azure.AI.DocumentIntelligence.ParagraphRole (string value) { throw null; } - public static bool operator !=(Azure.AI.DocumentIntelligence.ParagraphRole left, Azure.AI.DocumentIntelligence.ParagraphRole right) { throw null; } - public override string ToString() { throw null; } - } - public partial class QuotaDetails - { - internal QuotaDetails() { } - public int Quota { get { throw null; } } - public System.DateTimeOffset QuotaResetDateTime { get { throw null; } } - public int Used { get { throw null; } } - } - public partial class ResourceDetails - { - internal ResourceDetails() { } - public Azure.AI.DocumentIntelligence.CustomDocumentModelsDetails CustomDocumentModels { get { throw null; } } - public Azure.AI.DocumentIntelligence.QuotaDetails CustomNeuralDocumentModelBuilds { get { throw null; } } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct SplitMode : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public SplitMode(string value) { throw null; } - public static Azure.AI.DocumentIntelligence.SplitMode Auto { get { throw null; } } - public static Azure.AI.DocumentIntelligence.SplitMode None { get { throw null; } } - public static Azure.AI.DocumentIntelligence.SplitMode PerPage { get { throw null; } } - public bool Equals(Azure.AI.DocumentIntelligence.SplitMode other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.AI.DocumentIntelligence.SplitMode left, Azure.AI.DocumentIntelligence.SplitMode right) { throw null; } - public static implicit operator Azure.AI.DocumentIntelligence.SplitMode (string value) { throw null; } - public static bool operator !=(Azure.AI.DocumentIntelligence.SplitMode left, Azure.AI.DocumentIntelligence.SplitMode right) { throw null; } - public override string ToString() { throw null; } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct StringIndexType : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public StringIndexType(string value) { throw null; } - public static Azure.AI.DocumentIntelligence.StringIndexType TextElements { get { throw null; } } - public static Azure.AI.DocumentIntelligence.StringIndexType UnicodeCodePoint { get { throw null; } } - public static Azure.AI.DocumentIntelligence.StringIndexType Utf16CodeUnit { get { throw null; } } - public bool Equals(Azure.AI.DocumentIntelligence.StringIndexType other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.AI.DocumentIntelligence.StringIndexType left, Azure.AI.DocumentIntelligence.StringIndexType right) { throw null; } - public static implicit operator Azure.AI.DocumentIntelligence.StringIndexType (string value) { throw null; } - public static bool operator !=(Azure.AI.DocumentIntelligence.StringIndexType left, Azure.AI.DocumentIntelligence.StringIndexType right) { throw null; } - public override string ToString() { throw null; } - } -} -namespace Microsoft.Extensions.Azure -{ - public static partial class AIDocumentIntelligenceClientBuilderExtensions - { - public static Azure.Core.Extensions.IAzureClientBuilder AddDocumentAnalysisClient(this TBuilder builder, System.Uri endpoint) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithCredential { throw null; } - public static Azure.Core.Extensions.IAzureClientBuilder AddDocumentAnalysisClient(this TBuilder builder, System.Uri endpoint, Azure.AzureKeyCredential credential) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilder { throw null; } - public static Azure.Core.Extensions.IAzureClientBuilder AddDocumentAnalysisClient(this TBuilder builder, TConfiguration configuration) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithConfiguration { throw null; } - public static Azure.Core.Extensions.IAzureClientBuilder AddDocumentModelAdministrationClient(this TBuilder builder, System.Uri endpoint) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithCredential { throw null; } - public static Azure.Core.Extensions.IAzureClientBuilder AddDocumentModelAdministrationClient(this TBuilder builder, System.Uri endpoint, Azure.AzureKeyCredential credential) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilder { throw null; } - public static Azure.Core.Extensions.IAzureClientBuilder AddDocumentModelAdministrationClient(this TBuilder builder, TConfiguration configuration) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithConfiguration { throw null; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/assets.json b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/assets.json deleted file mode 100644 index f723b071ebfa..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/assets.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "AssetsRepo": "Azure/azure-sdk-assets", - "AssetsRepoPrefixPath": "net", - "TagPrefix": "net/documentintelligence/Azure.AI.DocumentIntelligence", - "Tag": "net/documentintelligence/Azure.AI.DocumentIntelligence_f6b061e70f" -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/AnalyzeResult.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/AnalyzeResult.Serialization.cs deleted file mode 100644 index 8759380c6140..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/AnalyzeResult.Serialization.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -namespace Azure.AI.DocumentIntelligence -{ - public partial class AnalyzeResult - { - // AnalyzeResult.FromResponse was not included in the generated code, but it should be. - // This is just a workaround while this issue is not fixed or while we don't implement - // deserialization manually. - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AnalyzeResult FromResponse(Response response) - { - return DeserializationHelpers.FromOperationResponse(response, DeserializeAnalyzeResult, "analyzeResult"); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Azure.AI.DocumentIntelligence.csproj b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Azure.AI.DocumentIntelligence.csproj deleted file mode 100644 index ffd4805b6279..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Azure.AI.DocumentIntelligence.csproj +++ /dev/null @@ -1,21 +0,0 @@ - - - This is the Azure.AI.DocumentIntelligence client library for developing .NET applications with rich experience. - Azure SDK Code Generation Azure.AI.DocumentIntelligence for Azure Data Plane - 1.0.0-beta.1 - Microsoft Azure Document Intelligence Cognitive Services Applied AI Form Recognizer - $(RequiredTargetFrameworks) - true - - - - - - - - - - - - - diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/DeserializationHelpers.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/DeserializationHelpers.cs deleted file mode 100644 index 560291a68f7f..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/DeserializationHelpers.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Text.Json; - -namespace Azure.AI.DocumentIntelligence -{ - internal static class DeserializationHelpers - { - internal static T FromOperationResponse(Response response, Func deserializationFunc, string resultPropertyName) - { - using var document = JsonDocument.Parse(response.Content); - - // If this response is the outcome of a long-running operation, the result of the operation - // needs to be deserialized from the "result" property instead of the root element. Without - // this workaround, the generated code fails for long-running operations. - - if (document.RootElement.TryGetProperty(resultPropertyName, out var result)) - { - return deserializationFunc(result); - } - else - { - return deserializationFunc(document.RootElement); - } - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/DocumentClassifierDetails.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/DocumentClassifierDetails.Serialization.cs deleted file mode 100644 index 201e2e3a5b0a..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/DocumentClassifierDetails.Serialization.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -namespace Azure.AI.DocumentIntelligence -{ - public partial class DocumentClassifierDetails - { - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static DocumentClassifierDetails FromResponse(Response response) - { - return DeserializationHelpers.FromOperationResponse(response, DeserializeDocumentClassifierDetails, "result"); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/DocumentModelDetails.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/DocumentModelDetails.Serialization.cs deleted file mode 100644 index 73668f2cde96..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/DocumentModelDetails.Serialization.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -namespace Azure.AI.DocumentIntelligence -{ - public partial class DocumentModelDetails - { - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static DocumentModelDetails FromResponse(Response response) - { - return DeserializationHelpers.FromOperationResponse(response, DeserializeDocumentModelDetails, "result"); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AIDocumentIntelligenceClientBuilderExtensions.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AIDocumentIntelligenceClientBuilderExtensions.cs deleted file mode 100644 index da4454841db7..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AIDocumentIntelligenceClientBuilderExtensions.cs +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using Azure; -using Azure.AI.DocumentIntelligence; -using Azure.Core.Extensions; - -namespace Microsoft.Extensions.Azure -{ - /// Extension methods to add , to client builder. - public static partial class AIDocumentIntelligenceClientBuilderExtensions - { - /// Registers a instance. - /// The builder to register with. - /// The Document Intelligence service endpoint. - /// A credential used to authenticate to an Azure Service. - public static IAzureClientBuilder AddDocumentAnalysisClient(this TBuilder builder, Uri endpoint, AzureKeyCredential credential) - where TBuilder : IAzureClientFactoryBuilder - { - return builder.RegisterClientFactory((options) => new DocumentAnalysisClient(endpoint, credential, options)); - } - - /// Registers a instance. - /// The builder to register with. - /// The Document Intelligence service endpoint. - public static IAzureClientBuilder AddDocumentAnalysisClient(this TBuilder builder, Uri endpoint) - where TBuilder : IAzureClientFactoryBuilderWithCredential - { - return builder.RegisterClientFactory((options, cred) => new DocumentAnalysisClient(endpoint, cred, options)); - } - - /// Registers a instance. - /// The builder to register with. - /// The Document Intelligence service endpoint. - /// A credential used to authenticate to an Azure Service. - public static IAzureClientBuilder AddDocumentModelAdministrationClient(this TBuilder builder, Uri endpoint, AzureKeyCredential credential) - where TBuilder : IAzureClientFactoryBuilder - { - return builder.RegisterClientFactory((options) => new DocumentModelAdministrationClient(endpoint, credential, options)); - } - - /// Registers a instance. - /// The builder to register with. - /// The Document Intelligence service endpoint. - public static IAzureClientBuilder AddDocumentModelAdministrationClient(this TBuilder builder, Uri endpoint) - where TBuilder : IAzureClientFactoryBuilderWithCredential - { - return builder.RegisterClientFactory((options, cred) => new DocumentModelAdministrationClient(endpoint, cred, options)); - } - - /// Registers a instance. - /// The builder to register with. - /// The configuration values. - public static IAzureClientBuilder AddDocumentAnalysisClient(this TBuilder builder, TConfiguration configuration) - where TBuilder : IAzureClientFactoryBuilderWithConfiguration - { - return builder.RegisterClientFactory(configuration); - } - /// Registers a instance. - /// The builder to register with. - /// The configuration values. - public static IAzureClientBuilder AddDocumentModelAdministrationClient(this TBuilder builder, TConfiguration configuration) - where TBuilder : IAzureClientFactoryBuilderWithConfiguration - { - return builder.RegisterClientFactory(configuration); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AIDocumentIntelligenceModelFactory.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AIDocumentIntelligenceModelFactory.cs deleted file mode 100644 index b67ed9604540..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AIDocumentIntelligenceModelFactory.cs +++ /dev/null @@ -1,712 +0,0 @@ -// 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.DocumentIntelligence -{ - /// Model factory for models. - public static partial class AIDocumentIntelligenceModelFactory - { - /// Initializes a new instance of AnalyzeResult. - /// API version used to produce this result. - /// Document model ID used to produce this result. - /// Method used to compute string offset and length. - /// Format of the analyze result top-level content. - /// - /// Concatenate string representation of all textual and visual elements in reading - /// order. - /// - /// Analyzed pages. - /// Extracted paragraphs. - /// Extracted tables. - /// Extracted figures. - /// Extracted lists. - /// Extracted sections. - /// Extracted key-value pairs. - /// Extracted font styles. - /// Detected languages. - /// Extracted documents. - /// A new instance for mocking. - public static AnalyzeResult AnalyzeResult(string apiVersion = null, string modelId = null, StringIndexType stringIndexType = default, ContentFormat? contentFormat = null, string content = null, IEnumerable pages = null, IEnumerable paragraphs = null, IEnumerable tables = null, IEnumerable figures = null, IEnumerable lists = null, IEnumerable sections = null, IEnumerable keyValuePairs = null, IEnumerable styles = null, IEnumerable languages = null, IEnumerable documents = null) - { - pages ??= new List(); - paragraphs ??= new List(); - tables ??= new List(); - figures ??= new List(); - lists ??= new List(); - sections ??= new List(); - keyValuePairs ??= new List(); - styles ??= new List(); - languages ??= new List(); - documents ??= new List(); - - return new AnalyzeResult(apiVersion, modelId, stringIndexType, contentFormat, content, pages?.ToList(), paragraphs?.ToList(), tables?.ToList(), figures?.ToList(), lists?.ToList(), sections?.ToList(), keyValuePairs?.ToList(), styles?.ToList(), languages?.ToList(), documents?.ToList()); - } - - /// Initializes a new instance of DocumentPage. - /// 1-based page number in the input document. - /// - /// The general orientation of the content in clockwise direction, measured in - /// degrees between (-180, 180]. - /// - /// The width of the image/PDF in pixels/inches, respectively. - /// The height of the image/PDF in pixels/inches, respectively. - /// - /// The unit used by the width, height, and polygon properties. For images, the - /// unit is "pixel". For PDF, the unit is "inch". - /// - /// Location of the page in the reading order concatenated content. - /// Extracted words from the page. - /// Extracted selection marks from the page. - /// - /// Extracted lines from the page, potentially containing both textual and visual - /// elements. - /// - /// Extracted barcodes from the page. - /// Extracted formulas from the page. - /// A new instance for mocking. - public static DocumentPage DocumentPage(int pageNumber = default, float? angle = null, float? width = null, float? height = null, LengthUnit? unit = null, IEnumerable spans = null, IEnumerable words = null, IEnumerable selectionMarks = null, IEnumerable lines = null, IEnumerable barcodes = null, IEnumerable formulas = null) - { - spans ??= new List(); - words ??= new List(); - selectionMarks ??= new List(); - lines ??= new List(); - barcodes ??= new List(); - formulas ??= new List(); - - return new DocumentPage(pageNumber, angle, width, height, unit, spans?.ToList(), words?.ToList(), selectionMarks?.ToList(), lines?.ToList(), barcodes?.ToList(), formulas?.ToList()); - } - - /// Initializes a new instance of DocumentSpan. - /// Zero-based index of the content represented by the span. - /// Number of characters in the content represented by the span. - /// A new instance for mocking. - public static DocumentSpan DocumentSpan(int offset = default, int length = default) - { - return new DocumentSpan(offset, length); - } - - /// Initializes a new instance of DocumentWord. - /// Text content of the word. - /// - /// Bounding polygon of the word, with coordinates specified relative to the - /// top-left of the page. The numbers represent the x, y values of the polygon - /// vertices, clockwise from the left (-180 degrees inclusive) relative to the - /// element orientation. - /// - /// Location of the word in the reading order concatenated content. - /// Confidence of correctly extracting the word. - /// A new instance for mocking. - public static DocumentWord DocumentWord(string content = null, IEnumerable polygon = null, DocumentSpan span = null, float confidence = default) - { - polygon ??= new List(); - - return new DocumentWord(content, polygon?.ToList(), span, confidence); - } - - /// Initializes a new instance of DocumentSelectionMark. - /// State of the selection mark. - /// - /// Bounding polygon of the selection mark, with coordinates specified relative - /// to the top-left of the page. The numbers represent the x, y values of the - /// polygon vertices, clockwise from the left (-180 degrees inclusive) relative - /// to the element orientation. - /// - /// Location of the selection mark in the reading order concatenated content. - /// Confidence of correctly extracting the selection mark. - /// A new instance for mocking. - public static DocumentSelectionMark DocumentSelectionMark(DocumentSelectionMarkState state = default, IEnumerable polygon = null, DocumentSpan span = null, float confidence = default) - { - polygon ??= new List(); - - return new DocumentSelectionMark(state, polygon?.ToList(), span, confidence); - } - - /// Initializes a new instance of DocumentLine. - /// Concatenated content of the contained elements in reading order. - /// - /// Bounding polygon of the line, with coordinates specified relative to the - /// top-left of the page. The numbers represent the x, y values of the polygon - /// vertices, clockwise from the left (-180 degrees inclusive) relative to the - /// element orientation. - /// - /// Location of the line in the reading order concatenated content. - /// A new instance for mocking. - public static DocumentLine DocumentLine(string content = null, IEnumerable polygon = null, IEnumerable spans = null) - { - polygon ??= new List(); - spans ??= new List(); - - return new DocumentLine(content, polygon?.ToList(), spans?.ToList()); - } - - /// Initializes a new instance of DocumentBarcode. - /// Barcode kind. - /// Barcode value. - /// - /// Bounding polygon of the barcode, with coordinates specified relative to the - /// top-left of the page. The numbers represent the x, y values of the polygon - /// vertices, clockwise from the left (-180 degrees inclusive) relative to the - /// element orientation. - /// - /// Location of the barcode in the reading order concatenated content. - /// Confidence of correctly extracting the barcode. - /// A new instance for mocking. - public static DocumentBarcode DocumentBarcode(DocumentBarcodeKind kind = default, string value = null, IEnumerable polygon = null, DocumentSpan span = null, float confidence = default) - { - polygon ??= new List(); - - return new DocumentBarcode(kind, value, polygon?.ToList(), span, confidence); - } - - /// Initializes a new instance of DocumentFormula. - /// Formula kind. - /// LaTex expression describing the formula. - /// - /// Bounding polygon of the formula, with coordinates specified relative to the - /// top-left of the page. The numbers represent the x, y values of the polygon - /// vertices, clockwise from the left (-180 degrees inclusive) relative to the - /// element orientation. - /// - /// Location of the formula in the reading order concatenated content. - /// Confidence of correctly extracting the formula. - /// A new instance for mocking. - public static DocumentFormula DocumentFormula(DocumentFormulaKind kind = default, string value = null, IEnumerable polygon = null, DocumentSpan span = null, float confidence = default) - { - polygon ??= new List(); - - return new DocumentFormula(kind, value, polygon?.ToList(), span, confidence); - } - - /// Initializes a new instance of DocumentParagraph. - /// Semantic role of the paragraph. - /// Concatenated content of the paragraph in reading order. - /// Bounding regions covering the paragraph. - /// Location of the paragraph in the reading order concatenated content. - /// A new instance for mocking. - public static DocumentParagraph DocumentParagraph(ParagraphRole? role = null, string content = null, IEnumerable boundingRegions = null, IEnumerable spans = null) - { - boundingRegions ??= new List(); - spans ??= new List(); - - return new DocumentParagraph(role, content, boundingRegions?.ToList(), spans?.ToList()); - } - - /// Initializes a new instance of BoundingRegion. - /// 1-based page number of page containing the bounding region. - /// - /// Bounding polygon on the page, or the entire page if not specified. - /// Coordinates specified relative to the top-left of the page. The numbers - /// represent the x, y values of the polygon vertices, clockwise from the left - /// (-180 degrees inclusive) relative to the element orientation. - /// - /// A new instance for mocking. - public static BoundingRegion BoundingRegion(int pageNumber = default, IEnumerable polygon = null) - { - polygon ??= new List(); - - return new BoundingRegion(pageNumber, polygon?.ToList()); - } - - /// Initializes a new instance of DocumentTable. - /// Number of rows in the table. - /// Number of columns in the table. - /// Cells contained within the table. - /// Bounding regions covering the table. - /// Location of the table in the reading order concatenated content. - /// Caption associated with the table. - /// List of footnotes associated with the table. - /// A new instance for mocking. - public static DocumentTable DocumentTable(int rowCount = default, int columnCount = default, IEnumerable cells = null, IEnumerable boundingRegions = null, IEnumerable spans = null, DocumentCaption caption = null, IEnumerable footnotes = null) - { - cells ??= new List(); - boundingRegions ??= new List(); - spans ??= new List(); - footnotes ??= new List(); - - return new DocumentTable(rowCount, columnCount, cells?.ToList(), boundingRegions?.ToList(), spans?.ToList(), caption, footnotes?.ToList()); - } - - /// Initializes a new instance of DocumentTableCell. - /// Table cell kind. - /// Row index of the cell. - /// Column index of the cell. - /// Number of rows spanned by this cell. - /// Number of columns spanned by this cell. - /// Concatenated content of the table cell in reading order. - /// Bounding regions covering the table cell. - /// Location of the table cell in the reading order concatenated content. - /// Child elements of the table cell. - /// A new instance for mocking. - public static DocumentTableCell DocumentTableCell(DocumentTableCellKind? kind = null, int rowIndex = default, int columnIndex = default, int? rowSpan = null, int? columnSpan = null, string content = null, IEnumerable boundingRegions = null, IEnumerable spans = null, IEnumerable elements = null) - { - boundingRegions ??= new List(); - spans ??= new List(); - elements ??= new List(); - - return new DocumentTableCell(kind, rowIndex, columnIndex, rowSpan, columnSpan, content, boundingRegions?.ToList(), spans?.ToList(), elements?.ToList()); - } - - /// Initializes a new instance of DocumentCaption. - /// Content of the caption. - /// Bounding regions covering the caption. - /// Location of the caption in the reading order concatenated content. - /// Child elements of the caption. - /// A new instance for mocking. - public static DocumentCaption DocumentCaption(string content = null, IEnumerable boundingRegions = null, IEnumerable spans = null, IEnumerable elements = null) - { - boundingRegions ??= new List(); - spans ??= new List(); - elements ??= new List(); - - return new DocumentCaption(content, boundingRegions?.ToList(), spans?.ToList(), elements?.ToList()); - } - - /// Initializes a new instance of DocumentFootnote. - /// Content of the footnote. - /// Bounding regions covering the footnote. - /// Location of the footnote in the reading order concatenated content. - /// Child elements of the footnote. - /// A new instance for mocking. - public static DocumentFootnote DocumentFootnote(string content = null, IEnumerable boundingRegions = null, IEnumerable spans = null, IEnumerable elements = null) - { - boundingRegions ??= new List(); - spans ??= new List(); - elements ??= new List(); - - return new DocumentFootnote(content, boundingRegions?.ToList(), spans?.ToList(), elements?.ToList()); - } - - /// Initializes a new instance of DocumentFigure. - /// Bounding regions covering the figure. - /// Location of the figure in the reading order concatenated content. - /// Child elements of the figure, excluding any caption or footnotes. - /// Caption associated with the figure. - /// List of footnotes associated with the figure. - /// A new instance for mocking. - public static DocumentFigure DocumentFigure(IEnumerable boundingRegions = null, IEnumerable spans = null, IEnumerable elements = null, DocumentCaption caption = null, IEnumerable footnotes = null) - { - boundingRegions ??= new List(); - spans ??= new List(); - elements ??= new List(); - footnotes ??= new List(); - - return new DocumentFigure(boundingRegions?.ToList(), spans?.ToList(), elements?.ToList(), caption, footnotes?.ToList()); - } - - /// Initializes a new instance of DocumentList. - /// Location of the list in the reading order concatenated content. - /// Items in the list. - /// A new instance for mocking. - public static DocumentList DocumentList(IEnumerable spans = null, IEnumerable items = null) - { - spans ??= new List(); - items ??= new List(); - - return new DocumentList(spans?.ToList(), items?.ToList()); - } - - /// Initializes a new instance of DocumentListItem. - /// Level of the list item (1-indexed). - /// Content of the list item. - /// Bounding regions covering the list item. - /// Location of the list item in the reading order concatenated content. - /// Child elements of the list item. - /// A new instance for mocking. - public static DocumentListItem DocumentListItem(int level = default, string content = null, IEnumerable boundingRegions = null, IEnumerable spans = null, IEnumerable elements = null) - { - boundingRegions ??= new List(); - spans ??= new List(); - elements ??= new List(); - - return new DocumentListItem(level, content, boundingRegions?.ToList(), spans?.ToList(), elements?.ToList()); - } - - /// Initializes a new instance of DocumentSection. - /// Location of the section in the reading order concatenated content. - /// Child elements of the section. - /// A new instance for mocking. - public static DocumentSection DocumentSection(IEnumerable spans = null, IEnumerable elements = null) - { - spans ??= new List(); - elements ??= new List(); - - return new DocumentSection(spans?.ToList(), elements?.ToList()); - } - - /// Initializes a new instance of DocumentKeyValuePair. - /// Field label of the key-value pair. - /// Field value of the key-value pair. - /// Confidence of correctly extracting the key-value pair. - /// A new instance for mocking. - public static DocumentKeyValuePair DocumentKeyValuePair(DocumentKeyValueElement key = null, DocumentKeyValueElement value = null, float confidence = default) - { - return new DocumentKeyValuePair(key, value, confidence); - } - - /// Initializes a new instance of DocumentKeyValueElement. - /// Concatenated content of the key-value element in reading order. - /// Bounding regions covering the key-value element. - /// Location of the key-value element in the reading order concatenated content. - /// A new instance for mocking. - public static DocumentKeyValueElement DocumentKeyValueElement(string content = null, IEnumerable boundingRegions = null, IEnumerable spans = null) - { - boundingRegions ??= new List(); - spans ??= new List(); - - return new DocumentKeyValueElement(content, boundingRegions?.ToList(), spans?.ToList()); - } - - /// Initializes a new instance of DocumentStyle. - /// Is content handwritten?. - /// - /// Visually most similar font from among the set of supported font families, with - /// fallback fonts following CSS convention (ex. 'Arial, sans-serif'). - /// - /// Font style. - /// Font weight. - /// Foreground color in #rrggbb hexadecimal format. - /// Background color in #rrggbb hexadecimal format.. - /// Location of the text elements in the concatenated content the style applies to. - /// Confidence of correctly identifying the style. - /// A new instance for mocking. - public static DocumentStyle DocumentStyle(bool? isHandwritten = null, string similarFontFamily = null, FontStyle? fontStyle = null, FontWeight? fontWeight = null, string color = null, string backgroundColor = null, IEnumerable spans = null, float confidence = default) - { - spans ??= new List(); - - return new DocumentStyle(isHandwritten, similarFontFamily, fontStyle, fontWeight, color, backgroundColor, spans?.ToList(), confidence); - } - - /// Initializes a new instance of DocumentLanguage. - /// - /// Detected language. Value may an ISO 639-1 language code (ex. "en", "fr") - /// or BCP 47 language tag (ex. "zh-Hans"). - /// - /// - /// Location of the text elements in the concatenated content the language applies - /// to. - /// - /// Confidence of correctly identifying the language. - /// A new instance for mocking. - public static DocumentLanguage DocumentLanguage(string locale = null, IEnumerable spans = null, float confidence = default) - { - spans ??= new List(); - - return new DocumentLanguage(locale, spans?.ToList(), confidence); - } - - /// Initializes a new instance of AnalyzedDocument. - /// Document type. - /// Bounding regions covering the document. - /// Location of the document in the reading order concatenated content. - /// Dictionary of named field values. - /// Confidence of correctly extracting the document. - /// A new instance for mocking. - public static AnalyzedDocument AnalyzedDocument(string docType = null, IEnumerable boundingRegions = null, IEnumerable spans = null, IReadOnlyDictionary fields = null, float confidence = default) - { - boundingRegions ??= new List(); - spans ??= new List(); - fields ??= new Dictionary(); - - return new AnalyzedDocument(docType, boundingRegions?.ToList(), spans?.ToList(), fields, confidence); - } - - /// Initializes a new instance of DocumentField. - /// Data type of the field value. - /// String value. - /// Date value in YYYY-MM-DD format (ISO 8601). - /// Time value in hh:mm:ss format (ISO 8601). - /// Phone number value in E.164 format (ex. +19876543210). - /// Floating point value. - /// Integer value. - /// Selection mark value. - /// Presence of signature. - /// 3-letter country code value (ISO 3166-1 alpha-3). - /// Array of field values. - /// Dictionary of named field values. - /// Currency value. - /// Address value. - /// Boolean value. - /// Field content. - /// Bounding regions covering the field. - /// Location of the field in the reading order concatenated content. - /// Confidence of correctly extracting the field. - /// A new instance for mocking. - public static DocumentField DocumentField(DocumentFieldType type = default, string valueString = null, DateTimeOffset? valueDate = null, TimeSpan? valueTime = null, string valuePhoneNumber = null, double? valueNumber = null, long? valueInteger = null, DocumentSelectionMarkState? valueSelectionMark = null, DocumentSignatureType? valueSignature = null, string valueCountryRegion = null, IEnumerable valueArray = null, IReadOnlyDictionary valueObject = null, CurrencyValue valueCurrency = null, AddressValue valueAddress = null, bool? valueBoolean = null, string content = null, IEnumerable boundingRegions = null, IEnumerable spans = null, float? confidence = null) - { - valueArray ??= new List(); - valueObject ??= new Dictionary(); - boundingRegions ??= new List(); - spans ??= new List(); - - return new DocumentField(type, valueString, valueDate, valueTime, valuePhoneNumber, valueNumber, valueInteger, valueSelectionMark, valueSignature, valueCountryRegion, valueArray?.ToList(), valueObject, valueCurrency, valueAddress, valueBoolean, content, boundingRegions?.ToList(), spans?.ToList(), confidence); - } - - /// Initializes a new instance of CurrencyValue. - /// Currency amount. - /// Currency symbol label, if any. - /// Resolved currency code (ISO 4217), if any. - /// A new instance for mocking. - public static CurrencyValue CurrencyValue(double amount = default, string currencySymbol = null, string currencyCode = null) - { - return new CurrencyValue(amount, currencySymbol, currencyCode); - } - - /// Initializes a new instance of AddressValue. - /// House or building number. - /// Post office box number. - /// Street name. - /// Name of city, town, village, etc. - /// First-level administrative division. - /// Postal code used for mail sorting. - /// Country/region. - /// Street-level address, excluding city, state, countryRegion, and postalCode. - /// Apartment or office number. - /// - /// Districts or boroughs within a city, such as Brooklyn in New York City or City - /// of Westminster in London. - /// - /// Second-level administrative division used in certain locales. - /// Unofficial neighborhood name, like Chinatown. - /// Build name, such as World Trade Center. - /// Floor number, such as 3F. - /// A new instance for mocking. - public static AddressValue AddressValue(string houseNumber = null, string poBox = null, string road = null, string city = null, string state = null, string postalCode = null, string countryRegion = null, string streetAddress = null, string unit = null, string cityDistrict = null, string stateDistrict = null, string suburb = null, string house = null, string level = null) - { - return new AddressValue(houseNumber, poBox, road, city, state, postalCode, countryRegion, streetAddress, unit, cityDistrict, stateDistrict, suburb, house, level); - } - - /// Initializes a new instance of DocumentModelDetails. - /// Unique document model name. - /// Document model description. - /// Date and time (UTC) when the document model was created. - /// Date and time (UTC) when the document model will expire. - /// API version used to create this document model. - /// List of key-value tag attributes associated with the document model. - /// Custom document model build mode. - /// - /// Azure Blob Storage location containing the training data. Either - /// azureBlobSource or azureBlobFileListSource must be specified. - /// - /// - /// Azure Blob Storage file list specifying the training data. Either - /// azureBlobSource or azureBlobFileListSource must be specified. - /// - /// Supported document types. - /// A new instance for mocking. - public static DocumentModelDetails DocumentModelDetails(string modelId = null, string description = null, DateTimeOffset createdDateTime = default, DateTimeOffset? expirationDateTime = null, string apiVersion = null, IReadOnlyDictionary tags = null, DocumentBuildMode? buildMode = null, AzureBlobContentSource azureBlobSource = null, AzureBlobFileListContentSource azureBlobFileListSource = null, IReadOnlyDictionary docTypes = null) - { - tags ??= new Dictionary(); - docTypes ??= new Dictionary(); - - return new DocumentModelDetails(modelId, description, createdDateTime, expirationDateTime, apiVersion, tags, buildMode, azureBlobSource, azureBlobFileListSource, docTypes); - } - - /// Initializes a new instance of DocumentTypeDetails. - /// Document model description. - /// Custom document model build mode. - /// Description of the document semantic schema using a JSON Schema style syntax. - /// Estimated confidence for each field. - /// A new instance for mocking. - public static DocumentTypeDetails DocumentTypeDetails(string description = null, DocumentBuildMode? buildMode = null, IReadOnlyDictionary fieldSchema = null, IReadOnlyDictionary fieldConfidence = null) - { - fieldSchema ??= new Dictionary(); - fieldConfidence ??= new Dictionary(); - - return new DocumentTypeDetails(description, buildMode, fieldSchema, fieldConfidence); - } - - /// Initializes a new instance of DocumentFieldSchema. - /// Semantic data type of the field value. - /// Field description. - /// Example field content. - /// Field type schema of each array element. - /// Named sub-fields of the object field. - /// A new instance for mocking. - public static DocumentFieldSchema DocumentFieldSchema(DocumentFieldType type = default, string description = null, string example = null, DocumentFieldSchema items = null, IReadOnlyDictionary properties = null) - { - properties ??= new Dictionary(); - - return new DocumentFieldSchema(type, description, example, items, properties); - } - - /// Initializes a new instance of ResourceDetails. - /// Details regarding custom document models. - /// Quota used, limit, and next reset date/time. - /// or is null. - /// A new instance for mocking. - public static ResourceDetails ResourceDetails(CustomDocumentModelsDetails customDocumentModels = null, QuotaDetails customNeuralDocumentModelBuilds = null) - { - if (customDocumentModels == null) - { - throw new ArgumentNullException(nameof(customDocumentModels)); - } - if (customNeuralDocumentModelBuilds == null) - { - throw new ArgumentNullException(nameof(customNeuralDocumentModelBuilds)); - } - - return new ResourceDetails(customDocumentModels, customNeuralDocumentModelBuilds); - } - - /// Initializes a new instance of CustomDocumentModelsDetails. - /// Number of custom document models in the current resource. - /// Maximum number of custom document models supported in the current resource. - /// A new instance for mocking. - public static CustomDocumentModelsDetails CustomDocumentModelsDetails(int count = default, int limit = default) - { - return new CustomDocumentModelsDetails(count, limit); - } - - /// Initializes a new instance of QuotaDetails. - /// Amount of the resource quota used. - /// Resource quota limit. - /// Date/time when the resource quota usage will be reset. - /// A new instance for mocking. - public static QuotaDetails QuotaDetails(int used = default, int quota = default, DateTimeOffset quotaResetDateTime = default) - { - return new QuotaDetails(used, quota, quotaResetDateTime); - } - - /// Initializes a new instance of OperationDetails. - /// Operation ID. - /// Operation status. - /// Operation progress (0-100). - /// Date and time (UTC) when the operation was created. - /// Date and time (UTC) when the status was last updated. - /// Type of operation. - /// URL of the resource targeted by this operation. - /// API version used to create this operation. - /// List of key-value tag attributes associated with the document model. - /// Encountered error. - /// A new instance for mocking. - public static OperationDetails OperationDetails(Guid operationId = default, OperationStatus status = default, int? percentCompleted = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, string kind = "Unknown", Uri resourceLocation = null, string apiVersion = null, IReadOnlyDictionary tags = null, DocumentIntelligenceError error = null) - { - tags ??= new Dictionary(); - - return new UnknownOperationDetails(operationId, status, percentCompleted, createdDateTime, lastUpdatedDateTime, kind, resourceLocation, apiVersion, tags, error); - } - - /// Initializes a new instance of DocumentIntelligenceError. - /// One of a server-defined set of error codes. - /// A human-readable representation of the error. - /// The target of the error. - /// An array of details about specific errors that led to this reported error. - /// An object containing more specific information than the current object about the error. - /// A new instance for mocking. - public static DocumentIntelligenceError DocumentIntelligenceError(string code = null, string message = null, string target = null, IEnumerable details = null, InnerError innererror = null) - { - details ??= new List(); - - return new DocumentIntelligenceError(code, message, target, details?.ToList(), innererror); - } - - /// Initializes a new instance of InnerError. - /// One of a server-defined set of error codes. - /// A human-readable representation of the error. - /// Inner error. - /// A new instance for mocking. - public static InnerError InnerError(string code = null, string message = null, InnerError innerErrorObject = null) - { - return new InnerError(code, message, innerErrorObject); - } - - /// Initializes a new instance of DocumentModelBuildOperationDetails. - /// Operation ID. - /// Operation status. - /// Operation progress (0-100). - /// Date and time (UTC) when the operation was created. - /// Date and time (UTC) when the status was last updated. - /// URL of the resource targeted by this operation. - /// API version used to create this operation. - /// List of key-value tag attributes associated with the document model. - /// Encountered error. - /// Operation result upon success. - /// A new instance for mocking. - public static DocumentModelBuildOperationDetails DocumentModelBuildOperationDetails(Guid operationId = default, OperationStatus status = default, int? percentCompleted = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, Uri resourceLocation = null, string apiVersion = null, IReadOnlyDictionary tags = null, DocumentIntelligenceError error = null, DocumentModelDetails result = null) - { - tags ??= new Dictionary(); - - return new DocumentModelBuildOperationDetails(operationId, status, percentCompleted, createdDateTime, lastUpdatedDateTime, OperationKind.DocumentModelBuild, resourceLocation, apiVersion, tags, error, result); - } - - /// Initializes a new instance of DocumentModelComposeOperationDetails. - /// Operation ID. - /// Operation status. - /// Operation progress (0-100). - /// Date and time (UTC) when the operation was created. - /// Date and time (UTC) when the status was last updated. - /// URL of the resource targeted by this operation. - /// API version used to create this operation. - /// List of key-value tag attributes associated with the document model. - /// Encountered error. - /// Operation result upon success. - /// A new instance for mocking. - public static DocumentModelComposeOperationDetails DocumentModelComposeOperationDetails(Guid operationId = default, OperationStatus status = default, int? percentCompleted = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, Uri resourceLocation = null, string apiVersion = null, IReadOnlyDictionary tags = null, DocumentIntelligenceError error = null, DocumentModelDetails result = null) - { - tags ??= new Dictionary(); - - return new DocumentModelComposeOperationDetails(operationId, status, percentCompleted, createdDateTime, lastUpdatedDateTime, OperationKind.DocumentModelCompose, resourceLocation, apiVersion, tags, error, result); - } - - /// Initializes a new instance of DocumentModelCopyToOperationDetails. - /// Operation ID. - /// Operation status. - /// Operation progress (0-100). - /// Date and time (UTC) when the operation was created. - /// Date and time (UTC) when the status was last updated. - /// URL of the resource targeted by this operation. - /// API version used to create this operation. - /// List of key-value tag attributes associated with the document model. - /// Encountered error. - /// Operation result upon success. - /// A new instance for mocking. - public static DocumentModelCopyToOperationDetails DocumentModelCopyToOperationDetails(Guid operationId = default, OperationStatus status = default, int? percentCompleted = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, Uri resourceLocation = null, string apiVersion = null, IReadOnlyDictionary tags = null, DocumentIntelligenceError error = null, DocumentModelDetails result = null) - { - tags ??= new Dictionary(); - - return new DocumentModelCopyToOperationDetails(operationId, status, percentCompleted, createdDateTime, lastUpdatedDateTime, OperationKind.DocumentModelCopyTo, resourceLocation, apiVersion, tags, error, result); - } - - /// Initializes a new instance of DocumentClassifierBuildOperationDetails. - /// Operation ID. - /// Operation status. - /// Operation progress (0-100). - /// Date and time (UTC) when the operation was created. - /// Date and time (UTC) when the status was last updated. - /// URL of the resource targeted by this operation. - /// API version used to create this operation. - /// List of key-value tag attributes associated with the document model. - /// Encountered error. - /// Operation result upon success. - /// A new instance for mocking. - public static DocumentClassifierBuildOperationDetails DocumentClassifierBuildOperationDetails(Guid operationId = default, OperationStatus status = default, int? percentCompleted = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, Uri resourceLocation = null, string apiVersion = null, IReadOnlyDictionary tags = null, DocumentIntelligenceError error = null, DocumentClassifierDetails result = null) - { - tags ??= new Dictionary(); - - return new DocumentClassifierBuildOperationDetails(operationId, status, percentCompleted, createdDateTime, lastUpdatedDateTime, OperationKind.DocumentClassifierBuild, resourceLocation, apiVersion, tags, error, result); - } - - /// Initializes a new instance of DocumentClassifierDetails. - /// Unique document classifier name. - /// Document classifier description. - /// Date and time (UTC) when the document classifier was created. - /// Date and time (UTC) when the document classifier will expire. - /// API version used to create this document classifier. - /// List of document types to classify against. - /// A new instance for mocking. - public static DocumentClassifierDetails DocumentClassifierDetails(string classifierId = null, string description = null, DateTimeOffset createdDateTime = default, DateTimeOffset? expirationDateTime = null, string apiVersion = null, IReadOnlyDictionary docTypes = null) - { - docTypes ??= new Dictionary(); - - return new DocumentClassifierDetails(classifierId, description, createdDateTime, expirationDateTime, apiVersion, docTypes); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AddressValue.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AddressValue.Serialization.cs deleted file mode 100644 index 447bc6e75646..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AddressValue.Serialization.cs +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class AddressValue - { - internal static AddressValue DeserializeAddressValue(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional houseNumber = default; - Optional poBox = default; - Optional road = default; - Optional city = default; - Optional state = default; - Optional postalCode = default; - Optional countryRegion = default; - Optional streetAddress = default; - Optional unit = default; - Optional cityDistrict = default; - Optional stateDistrict = default; - Optional suburb = default; - Optional house = default; - Optional level = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("houseNumber"u8)) - { - houseNumber = property.Value.GetString(); - continue; - } - if (property.NameEquals("poBox"u8)) - { - poBox = property.Value.GetString(); - continue; - } - if (property.NameEquals("road"u8)) - { - road = property.Value.GetString(); - continue; - } - if (property.NameEquals("city"u8)) - { - city = property.Value.GetString(); - continue; - } - if (property.NameEquals("state"u8)) - { - state = property.Value.GetString(); - continue; - } - if (property.NameEquals("postalCode"u8)) - { - postalCode = property.Value.GetString(); - continue; - } - if (property.NameEquals("countryRegion"u8)) - { - countryRegion = property.Value.GetString(); - continue; - } - if (property.NameEquals("streetAddress"u8)) - { - streetAddress = property.Value.GetString(); - continue; - } - if (property.NameEquals("unit"u8)) - { - unit = property.Value.GetString(); - continue; - } - if (property.NameEquals("cityDistrict"u8)) - { - cityDistrict = property.Value.GetString(); - continue; - } - if (property.NameEquals("stateDistrict"u8)) - { - stateDistrict = property.Value.GetString(); - continue; - } - if (property.NameEquals("suburb"u8)) - { - suburb = property.Value.GetString(); - continue; - } - if (property.NameEquals("house"u8)) - { - house = property.Value.GetString(); - continue; - } - if (property.NameEquals("level"u8)) - { - level = property.Value.GetString(); - continue; - } - } - return new AddressValue(houseNumber.Value, poBox.Value, road.Value, city.Value, state.Value, postalCode.Value, countryRegion.Value, streetAddress.Value, unit.Value, cityDistrict.Value, stateDistrict.Value, suburb.Value, house.Value, level.Value); - } - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AddressValue FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeAddressValue(document.RootElement); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AddressValue.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AddressValue.cs deleted file mode 100644 index e7f45fcaa5cd..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AddressValue.cs +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.AI.DocumentIntelligence -{ - /// Address field value. - public partial class AddressValue - { - /// Initializes a new instance of AddressValue. - internal AddressValue() - { - } - - /// Initializes a new instance of AddressValue. - /// House or building number. - /// Post office box number. - /// Street name. - /// Name of city, town, village, etc. - /// First-level administrative division. - /// Postal code used for mail sorting. - /// Country/region. - /// Street-level address, excluding city, state, countryRegion, and postalCode. - /// Apartment or office number. - /// - /// Districts or boroughs within a city, such as Brooklyn in New York City or City - /// of Westminster in London. - /// - /// Second-level administrative division used in certain locales. - /// Unofficial neighborhood name, like Chinatown. - /// Build name, such as World Trade Center. - /// Floor number, such as 3F. - internal AddressValue(string houseNumber, string poBox, string road, string city, string state, string postalCode, string countryRegion, string streetAddress, string unit, string cityDistrict, string stateDistrict, string suburb, string house, string level) - { - HouseNumber = houseNumber; - PoBox = poBox; - Road = road; - City = city; - State = state; - PostalCode = postalCode; - CountryRegion = countryRegion; - StreetAddress = streetAddress; - Unit = unit; - CityDistrict = cityDistrict; - StateDistrict = stateDistrict; - Suburb = suburb; - House = house; - Level = level; - } - - /// House or building number. - public string HouseNumber { get; } - /// Post office box number. - public string PoBox { get; } - /// Street name. - public string Road { get; } - /// Name of city, town, village, etc. - public string City { get; } - /// First-level administrative division. - public string State { get; } - /// Postal code used for mail sorting. - public string PostalCode { get; } - /// Country/region. - public string CountryRegion { get; } - /// Street-level address, excluding city, state, countryRegion, and postalCode. - public string StreetAddress { get; } - /// Apartment or office number. - public string Unit { get; } - /// - /// Districts or boroughs within a city, such as Brooklyn in New York City or City - /// of Westminster in London. - /// - public string CityDistrict { get; } - /// Second-level administrative division used in certain locales. - public string StateDistrict { get; } - /// Unofficial neighborhood name, like Chinatown. - public string Suburb { get; } - /// Build name, such as World Trade Center. - public string House { get; } - /// Floor number, such as 3F. - public string Level { get; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeDocumentRequest.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeDocumentRequest.Serialization.cs deleted file mode 100644 index d6a7f0dcb4a6..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeDocumentRequest.Serialization.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class AnalyzeDocumentRequest : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(UrlSource)) - { - writer.WritePropertyName("urlSource"u8); - writer.WriteStringValue(UrlSource.AbsoluteUri); - } - if (Optional.IsDefined(Base64Source)) - { - writer.WritePropertyName("base64Source"u8); - writer.WriteBase64StringValue(Base64Source.ToArray(), "D"); - } - writer.WriteEndObject(); - } - - /// Convert into a Utf8JsonRequestContent. - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this); - return content; - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeDocumentRequest.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeDocumentRequest.cs deleted file mode 100644 index 9e86ebe7bad5..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeDocumentRequest.cs +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.AI.DocumentIntelligence -{ - /// Document analysis parameters. - public partial class AnalyzeDocumentRequest - { - /// Initializes a new instance of AnalyzeDocumentRequest. - public AnalyzeDocumentRequest() - { - } - - /// Initializes a new instance of AnalyzeDocumentRequest. - /// Document URL to analyze. Either urlSource or base64Source must be specified. - /// - /// Base64 encoding of the document to analyze. Either urlSource or base64Source - /// must be specified. - /// - internal AnalyzeDocumentRequest(Uri urlSource, BinaryData base64Source) - { - UrlSource = urlSource; - Base64Source = base64Source; - } - - /// Document URL to analyze. Either urlSource or base64Source must be specified. - public Uri UrlSource { get; set; } - /// - /// Base64 encoding of the document to analyze. Either urlSource or base64Source - /// must be specified. - /// - /// To assign a byte[] to this property use . - /// The byte[] will be serialized to a Base64 encoded string. - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromBytes(new byte[] { 1, 2, 3 }) - /// Creates a payload of "AQID". - /// - /// - /// - /// - public BinaryData Base64Source { get; set; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeResult.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeResult.Serialization.cs deleted file mode 100644 index 920bc0ade2df..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeResult.Serialization.cs +++ /dev/null @@ -1,209 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class AnalyzeResult - { - internal static AnalyzeResult DeserializeAnalyzeResult(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string apiVersion = default; - string modelId = default; - StringIndexType stringIndexType = default; - Optional contentFormat = default; - string content = default; - IReadOnlyList pages = default; - Optional> paragraphs = default; - Optional> tables = default; - Optional> figures = default; - Optional> lists = default; - Optional> sections = default; - Optional> keyValuePairs = default; - Optional> styles = default; - Optional> languages = default; - Optional> documents = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("apiVersion"u8)) - { - apiVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("modelId"u8)) - { - modelId = property.Value.GetString(); - continue; - } - if (property.NameEquals("stringIndexType"u8)) - { - stringIndexType = new StringIndexType(property.Value.GetString()); - continue; - } - if (property.NameEquals("contentFormat"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - contentFormat = new ContentFormat(property.Value.GetString()); - continue; - } - if (property.NameEquals("content"u8)) - { - content = property.Value.GetString(); - continue; - } - if (property.NameEquals("pages"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DocumentPage.DeserializeDocumentPage(item)); - } - pages = array; - continue; - } - if (property.NameEquals("paragraphs"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DocumentParagraph.DeserializeDocumentParagraph(item)); - } - paragraphs = array; - continue; - } - if (property.NameEquals("tables"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DocumentTable.DeserializeDocumentTable(item)); - } - tables = array; - continue; - } - if (property.NameEquals("figures"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DocumentFigure.DeserializeDocumentFigure(item)); - } - figures = array; - continue; - } - if (property.NameEquals("lists"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DocumentList.DeserializeDocumentList(item)); - } - lists = array; - continue; - } - if (property.NameEquals("sections"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DocumentSection.DeserializeDocumentSection(item)); - } - sections = array; - continue; - } - if (property.NameEquals("keyValuePairs"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DocumentKeyValuePair.DeserializeDocumentKeyValuePair(item)); - } - keyValuePairs = array; - continue; - } - if (property.NameEquals("styles"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DocumentStyle.DeserializeDocumentStyle(item)); - } - styles = array; - continue; - } - if (property.NameEquals("languages"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DocumentLanguage.DeserializeDocumentLanguage(item)); - } - languages = array; - continue; - } - if (property.NameEquals("documents"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(AnalyzedDocument.DeserializeAnalyzedDocument(item)); - } - documents = array; - continue; - } - } - return new AnalyzeResult(apiVersion, modelId, stringIndexType, Optional.ToNullable(contentFormat), content, pages, Optional.ToList(paragraphs), Optional.ToList(tables), Optional.ToList(figures), Optional.ToList(lists), Optional.ToList(sections), Optional.ToList(keyValuePairs), Optional.ToList(styles), Optional.ToList(languages), Optional.ToList(documents)); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeResult.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeResult.cs deleted file mode 100644 index ca0155252697..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeResult.cs +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - /// Document analysis result. - public partial class AnalyzeResult - { - /// Initializes a new instance of AnalyzeResult. - /// API version used to produce this result. - /// Document model ID used to produce this result. - /// Method used to compute string offset and length. - /// - /// Concatenate string representation of all textual and visual elements in reading - /// order. - /// - /// Analyzed pages. - /// , , or is null. - internal AnalyzeResult(string apiVersion, string modelId, StringIndexType stringIndexType, string content, IEnumerable pages) - { - Argument.AssertNotNull(apiVersion, nameof(apiVersion)); - Argument.AssertNotNull(modelId, nameof(modelId)); - Argument.AssertNotNull(content, nameof(content)); - Argument.AssertNotNull(pages, nameof(pages)); - - ApiVersion = apiVersion; - ModelId = modelId; - StringIndexType = stringIndexType; - Content = content; - Pages = pages.ToList(); - Paragraphs = new ChangeTrackingList(); - Tables = new ChangeTrackingList(); - Figures = new ChangeTrackingList(); - Lists = new ChangeTrackingList(); - Sections = new ChangeTrackingList(); - KeyValuePairs = new ChangeTrackingList(); - Styles = new ChangeTrackingList(); - Languages = new ChangeTrackingList(); - Documents = new ChangeTrackingList(); - } - - /// Initializes a new instance of AnalyzeResult. - /// API version used to produce this result. - /// Document model ID used to produce this result. - /// Method used to compute string offset and length. - /// Format of the analyze result top-level content. - /// - /// Concatenate string representation of all textual and visual elements in reading - /// order. - /// - /// Analyzed pages. - /// Extracted paragraphs. - /// Extracted tables. - /// Extracted figures. - /// Extracted lists. - /// Extracted sections. - /// Extracted key-value pairs. - /// Extracted font styles. - /// Detected languages. - /// Extracted documents. - internal AnalyzeResult(string apiVersion, string modelId, StringIndexType stringIndexType, ContentFormat? contentFormat, string content, IReadOnlyList pages, IReadOnlyList paragraphs, IReadOnlyList tables, IReadOnlyList figures, IReadOnlyList lists, IReadOnlyList sections, IReadOnlyList keyValuePairs, IReadOnlyList styles, IReadOnlyList languages, IReadOnlyList documents) - { - ApiVersion = apiVersion; - ModelId = modelId; - StringIndexType = stringIndexType; - ContentFormat = contentFormat; - Content = content; - Pages = pages; - Paragraphs = paragraphs; - Tables = tables; - Figures = figures; - Lists = lists; - Sections = sections; - KeyValuePairs = keyValuePairs; - Styles = styles; - Languages = languages; - Documents = documents; - } - - /// API version used to produce this result. - public string ApiVersion { get; } - /// Document model ID used to produce this result. - public string ModelId { get; } - /// Method used to compute string offset and length. - public StringIndexType StringIndexType { get; } - /// Format of the analyze result top-level content. - public ContentFormat? ContentFormat { get; } - /// - /// Concatenate string representation of all textual and visual elements in reading - /// order. - /// - public string Content { get; } - /// Analyzed pages. - public IReadOnlyList Pages { get; } - /// Extracted paragraphs. - public IReadOnlyList Paragraphs { get; } - /// Extracted tables. - public IReadOnlyList Tables { get; } - /// Extracted figures. - public IReadOnlyList Figures { get; } - /// Extracted lists. - public IReadOnlyList Lists { get; } - /// Extracted sections. - public IReadOnlyList Sections { get; } - /// Extracted key-value pairs. - public IReadOnlyList KeyValuePairs { get; } - /// Extracted font styles. - public IReadOnlyList Styles { get; } - /// Detected languages. - public IReadOnlyList Languages { get; } - /// Extracted documents. - public IReadOnlyList Documents { get; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzedDocument.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzedDocument.Serialization.cs deleted file mode 100644 index 5c002a19a6c7..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzedDocument.Serialization.cs +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class AnalyzedDocument - { - internal static AnalyzedDocument DeserializeAnalyzedDocument(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string docType = default; - Optional> boundingRegions = default; - IReadOnlyList spans = default; - Optional> fields = default; - float confidence = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("docType"u8)) - { - docType = property.Value.GetString(); - continue; - } - if (property.NameEquals("boundingRegions"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(BoundingRegion.DeserializeBoundingRegion(item)); - } - boundingRegions = array; - continue; - } - if (property.NameEquals("spans"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DocumentSpan.DeserializeDocumentSpan(item)); - } - spans = array; - continue; - } - if (property.NameEquals("fields"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, DocumentField.DeserializeDocumentField(property0.Value)); - } - fields = dictionary; - continue; - } - if (property.NameEquals("confidence"u8)) - { - confidence = property.Value.GetSingle(); - continue; - } - } - return new AnalyzedDocument(docType, Optional.ToList(boundingRegions), spans, Optional.ToDictionary(fields), confidence); - } - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AnalyzedDocument FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeAnalyzedDocument(document.RootElement); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzedDocument.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzedDocument.cs deleted file mode 100644 index 9c66ea29671a..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzedDocument.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - /// An object describing the location and semantic content of a document. - public partial class AnalyzedDocument - { - /// Initializes a new instance of AnalyzedDocument. - /// Document type. - /// Location of the document in the reading order concatenated content. - /// Confidence of correctly extracting the document. - /// or is null. - internal AnalyzedDocument(string docType, IEnumerable spans, float confidence) - { - Argument.AssertNotNull(docType, nameof(docType)); - Argument.AssertNotNull(spans, nameof(spans)); - - DocType = docType; - BoundingRegions = new ChangeTrackingList(); - Spans = spans.ToList(); - Fields = new ChangeTrackingDictionary(); - Confidence = confidence; - } - - /// Initializes a new instance of AnalyzedDocument. - /// Document type. - /// Bounding regions covering the document. - /// Location of the document in the reading order concatenated content. - /// Dictionary of named field values. - /// Confidence of correctly extracting the document. - internal AnalyzedDocument(string docType, IReadOnlyList boundingRegions, IReadOnlyList spans, IReadOnlyDictionary fields, float confidence) - { - DocType = docType; - BoundingRegions = boundingRegions; - Spans = spans; - Fields = fields; - Confidence = confidence; - } - - /// Document type. - public string DocType { get; } - /// Bounding regions covering the document. - public IReadOnlyList BoundingRegions { get; } - /// Location of the document in the reading order concatenated content. - public IReadOnlyList Spans { get; } - /// Dictionary of named field values. - public IReadOnlyDictionary Fields { get; } - /// Confidence of correctly extracting the document. - public float Confidence { get; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AuthorizeCopyRequest.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AuthorizeCopyRequest.Serialization.cs deleted file mode 100644 index df5b369a1607..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AuthorizeCopyRequest.Serialization.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class AuthorizeCopyRequest : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("modelId"u8); - writer.WriteStringValue(ModelId); - if (Optional.IsDefined(Description)) - { - writer.WritePropertyName("description"u8); - writer.WriteStringValue(Description); - } - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WriteEndObject(); - } - - /// Convert into a Utf8JsonRequestContent. - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this); - return content; - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AuthorizeCopyRequest.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AuthorizeCopyRequest.cs deleted file mode 100644 index dab2b56d63d0..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AuthorizeCopyRequest.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - /// Request body to authorize document model copy. - public partial class AuthorizeCopyRequest - { - /// Initializes a new instance of AuthorizeCopyRequest. - /// Unique document model name. - /// is null. - public AuthorizeCopyRequest(string modelId) - { - Argument.AssertNotNull(modelId, nameof(modelId)); - - ModelId = modelId; - Tags = new ChangeTrackingDictionary(); - } - - /// Initializes a new instance of AuthorizeCopyRequest. - /// Unique document model name. - /// Document model description. - /// List of key-value tag attributes associated with the document model. - internal AuthorizeCopyRequest(string modelId, string description, IDictionary tags) - { - ModelId = modelId; - Description = description; - Tags = tags; - } - - /// Unique document model name. - public string ModelId { get; } - /// Document model description. - public string Description { get; set; } - /// List of key-value tag attributes associated with the document model. - public IDictionary Tags { get; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AzureAIDocumentIntelligenceClientOptions.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AzureAIDocumentIntelligenceClientOptions.cs deleted file mode 100644 index 85b93e9d46bf..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AzureAIDocumentIntelligenceClientOptions.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - /// Client options for Azure.AI.DocumentIntelligence library clients. - public partial class AzureAIDocumentIntelligenceClientOptions : ClientOptions - { - private const ServiceVersion LatestVersion = ServiceVersion.V2023_10_31_Preview; - - /// The version of the service to use. - public enum ServiceVersion - { - /// Service version "2023-10-31-preview". - V2023_10_31_Preview = 1, - } - - internal string Version { get; } - - /// Initializes new instance of AzureAIDocumentIntelligenceClientOptions. - public AzureAIDocumentIntelligenceClientOptions(ServiceVersion version = LatestVersion) - { - Version = version switch - { - ServiceVersion.V2023_10_31_Preview => "2023-10-31-preview", - _ => throw new NotSupportedException() - }; - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AzureBlobContentSource.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AzureBlobContentSource.Serialization.cs deleted file mode 100644 index e6445bfde54a..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AzureBlobContentSource.Serialization.cs +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class AzureBlobContentSource : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("containerUrl"u8); - writer.WriteStringValue(ContainerUrl.AbsoluteUri); - if (Optional.IsDefined(Prefix)) - { - writer.WritePropertyName("prefix"u8); - writer.WriteStringValue(Prefix); - } - writer.WriteEndObject(); - } - - internal static AzureBlobContentSource DeserializeAzureBlobContentSource(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Uri containerUrl = default; - Optional prefix = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("containerUrl"u8)) - { - containerUrl = new Uri(property.Value.GetString()); - continue; - } - if (property.NameEquals("prefix"u8)) - { - prefix = property.Value.GetString(); - continue; - } - } - return new AzureBlobContentSource(containerUrl, prefix.Value); - } - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AzureBlobContentSource FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeAzureBlobContentSource(document.RootElement); - } - - /// Convert into a Utf8JsonRequestContent. - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this); - return content; - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AzureBlobContentSource.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AzureBlobContentSource.cs deleted file mode 100644 index c48977277eb8..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AzureBlobContentSource.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - /// Azure Blob Storage content. - public partial class AzureBlobContentSource - { - /// Initializes a new instance of AzureBlobContentSource. - /// Azure Blob Storage container URL. - /// is null. - public AzureBlobContentSource(Uri containerUrl) - { - Argument.AssertNotNull(containerUrl, nameof(containerUrl)); - - ContainerUrl = containerUrl; - } - - /// Initializes a new instance of AzureBlobContentSource. - /// Azure Blob Storage container URL. - /// Blob name prefix. - internal AzureBlobContentSource(Uri containerUrl, string prefix) - { - ContainerUrl = containerUrl; - Prefix = prefix; - } - - /// Azure Blob Storage container URL. - public Uri ContainerUrl { get; set; } - /// Blob name prefix. - public string Prefix { get; set; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AzureBlobFileListContentSource.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AzureBlobFileListContentSource.Serialization.cs deleted file mode 100644 index b19a9dbfdf64..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AzureBlobFileListContentSource.Serialization.cs +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class AzureBlobFileListContentSource : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("containerUrl"u8); - writer.WriteStringValue(ContainerUrl.AbsoluteUri); - writer.WritePropertyName("fileList"u8); - writer.WriteStringValue(FileList); - writer.WriteEndObject(); - } - - internal static AzureBlobFileListContentSource DeserializeAzureBlobFileListContentSource(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Uri containerUrl = default; - string fileList = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("containerUrl"u8)) - { - containerUrl = new Uri(property.Value.GetString()); - continue; - } - if (property.NameEquals("fileList"u8)) - { - fileList = property.Value.GetString(); - continue; - } - } - return new AzureBlobFileListContentSource(containerUrl, fileList); - } - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AzureBlobFileListContentSource FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeAzureBlobFileListContentSource(document.RootElement); - } - - /// Convert into a Utf8JsonRequestContent. - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this); - return content; - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AzureBlobFileListContentSource.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AzureBlobFileListContentSource.cs deleted file mode 100644 index 2573f8baca74..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AzureBlobFileListContentSource.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - /// File list in Azure Blob Storage. - public partial class AzureBlobFileListContentSource - { - /// Initializes a new instance of AzureBlobFileListContentSource. - /// Azure Blob Storage container URL. - /// Path to a JSONL file within the container specifying a subset of documents. - /// or is null. - public AzureBlobFileListContentSource(Uri containerUrl, string fileList) - { - Argument.AssertNotNull(containerUrl, nameof(containerUrl)); - Argument.AssertNotNull(fileList, nameof(fileList)); - - ContainerUrl = containerUrl; - FileList = fileList; - } - - /// Azure Blob Storage container URL. - public Uri ContainerUrl { get; set; } - /// Path to a JSONL file within the container specifying a subset of documents. - public string FileList { get; set; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BoundingRegion.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BoundingRegion.Serialization.cs deleted file mode 100644 index 8a14d1290280..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BoundingRegion.Serialization.cs +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class BoundingRegion - { - internal static BoundingRegion DeserializeBoundingRegion(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - int pageNumber = default; - IReadOnlyList polygon = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("pageNumber"u8)) - { - pageNumber = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("polygon"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetSingle()); - } - polygon = array; - continue; - } - } - return new BoundingRegion(pageNumber, polygon); - } - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static BoundingRegion FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeBoundingRegion(document.RootElement); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BoundingRegion.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BoundingRegion.cs deleted file mode 100644 index 127ba9a92005..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BoundingRegion.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - /// Bounding polygon on a specific page of the input. - public partial class BoundingRegion - { - /// Initializes a new instance of BoundingRegion. - /// 1-based page number of page containing the bounding region. - /// - /// Bounding polygon on the page, or the entire page if not specified. - /// Coordinates specified relative to the top-left of the page. The numbers - /// represent the x, y values of the polygon vertices, clockwise from the left - /// (-180 degrees inclusive) relative to the element orientation. - /// - /// is null. - internal BoundingRegion(int pageNumber, IEnumerable polygon) - { - Argument.AssertNotNull(polygon, nameof(polygon)); - - PageNumber = pageNumber; - Polygon = polygon.ToList(); - } - - /// Initializes a new instance of BoundingRegion. - /// 1-based page number of page containing the bounding region. - /// - /// Bounding polygon on the page, or the entire page if not specified. - /// Coordinates specified relative to the top-left of the page. The numbers - /// represent the x, y values of the polygon vertices, clockwise from the left - /// (-180 degrees inclusive) relative to the element orientation. - /// - internal BoundingRegion(int pageNumber, IReadOnlyList polygon) - { - PageNumber = pageNumber; - Polygon = polygon; - } - - /// 1-based page number of page containing the bounding region. - public int PageNumber { get; } - /// - /// Bounding polygon on the page, or the entire page if not specified. - /// Coordinates specified relative to the top-left of the page. The numbers - /// represent the x, y values of the polygon vertices, clockwise from the left - /// (-180 degrees inclusive) relative to the element orientation. - /// - public IReadOnlyList Polygon { get; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BuildDocumentClassifierRequest.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BuildDocumentClassifierRequest.Serialization.cs deleted file mode 100644 index ed47c74768ab..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BuildDocumentClassifierRequest.Serialization.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class BuildDocumentClassifierRequest : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("classifierId"u8); - writer.WriteStringValue(ClassifierId); - if (Optional.IsDefined(Description)) - { - writer.WritePropertyName("description"u8); - writer.WriteStringValue(Description); - } - writer.WritePropertyName("docTypes"u8); - writer.WriteStartObject(); - foreach (var item in DocTypes) - { - writer.WritePropertyName(item.Key); - writer.WriteObjectValue(item.Value); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - /// Convert into a Utf8JsonRequestContent. - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this); - return content; - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BuildDocumentClassifierRequest.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BuildDocumentClassifierRequest.cs deleted file mode 100644 index 111dcccba29f..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BuildDocumentClassifierRequest.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - /// Request body to build a new custom document classifier. - public partial class BuildDocumentClassifierRequest - { - /// Initializes a new instance of BuildDocumentClassifierRequest. - /// Unique document classifier name. - /// List of document types to classify against. - /// or is null. - public BuildDocumentClassifierRequest(string classifierId, IDictionary docTypes) - { - Argument.AssertNotNull(classifierId, nameof(classifierId)); - Argument.AssertNotNull(docTypes, nameof(docTypes)); - - ClassifierId = classifierId; - DocTypes = docTypes; - } - - /// Initializes a new instance of BuildDocumentClassifierRequest. - /// Unique document classifier name. - /// Document classifier description. - /// List of document types to classify against. - internal BuildDocumentClassifierRequest(string classifierId, string description, IDictionary docTypes) - { - ClassifierId = classifierId; - Description = description; - DocTypes = docTypes; - } - - /// Unique document classifier name. - public string ClassifierId { get; } - /// Document classifier description. - public string Description { get; set; } - /// List of document types to classify against. - public IDictionary DocTypes { get; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BuildDocumentModelRequest.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BuildDocumentModelRequest.Serialization.cs deleted file mode 100644 index 1f5b42049c39..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BuildDocumentModelRequest.Serialization.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class BuildDocumentModelRequest : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("modelId"u8); - writer.WriteStringValue(ModelId); - if (Optional.IsDefined(Description)) - { - writer.WritePropertyName("description"u8); - writer.WriteStringValue(Description); - } - writer.WritePropertyName("buildMode"u8); - writer.WriteStringValue(BuildMode.ToString()); - if (Optional.IsDefined(AzureBlobSource)) - { - writer.WritePropertyName("azureBlobSource"u8); - writer.WriteObjectValue(AzureBlobSource); - } - if (Optional.IsDefined(AzureBlobFileListSource)) - { - writer.WritePropertyName("azureBlobFileListSource"u8); - writer.WriteObjectValue(AzureBlobFileListSource); - } - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WriteEndObject(); - } - - /// Convert into a Utf8JsonRequestContent. - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this); - return content; - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BuildDocumentModelRequest.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BuildDocumentModelRequest.cs deleted file mode 100644 index 67f8f8a7eac8..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BuildDocumentModelRequest.cs +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - /// Request body to build a new custom document model. - public partial class BuildDocumentModelRequest - { - /// Initializes a new instance of BuildDocumentModelRequest. - /// Unique document model name. - /// Custom document model build mode. - /// is null. - public BuildDocumentModelRequest(string modelId, DocumentBuildMode buildMode) - { - Argument.AssertNotNull(modelId, nameof(modelId)); - - ModelId = modelId; - BuildMode = buildMode; - Tags = new ChangeTrackingDictionary(); - } - - /// Initializes a new instance of BuildDocumentModelRequest. - /// Unique document model name. - /// Document model description. - /// Custom document model build mode. - /// - /// Azure Blob Storage location containing the training data. Either - /// azureBlobSource or azureBlobFileListSource must be specified. - /// - /// - /// Azure Blob Storage file list specifying the training data. Either - /// azureBlobSource or azureBlobFileListSource must be specified. - /// - /// List of key-value tag attributes associated with the document model. - internal BuildDocumentModelRequest(string modelId, string description, DocumentBuildMode buildMode, AzureBlobContentSource azureBlobSource, AzureBlobFileListContentSource azureBlobFileListSource, IDictionary tags) - { - ModelId = modelId; - Description = description; - BuildMode = buildMode; - AzureBlobSource = azureBlobSource; - AzureBlobFileListSource = azureBlobFileListSource; - Tags = tags; - } - - /// Unique document model name. - public string ModelId { get; } - /// Document model description. - public string Description { get; set; } - /// Custom document model build mode. - public DocumentBuildMode BuildMode { get; } - /// - /// Azure Blob Storage location containing the training data. Either - /// azureBlobSource or azureBlobFileListSource must be specified. - /// - public AzureBlobContentSource AzureBlobSource { get; set; } - /// - /// Azure Blob Storage file list specifying the training data. Either - /// azureBlobSource or azureBlobFileListSource must be specified. - /// - public AzureBlobFileListContentSource AzureBlobFileListSource { get; set; } - /// List of key-value tag attributes associated with the document model. - public IDictionary Tags { get; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ClassifierDocumentTypeDetails.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ClassifierDocumentTypeDetails.Serialization.cs deleted file mode 100644 index 1b6abb0992ef..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ClassifierDocumentTypeDetails.Serialization.cs +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class ClassifierDocumentTypeDetails : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(SourceKind)) - { - writer.WritePropertyName("sourceKind"u8); - writer.WriteStringValue(SourceKind.Value.ToString()); - } - if (Optional.IsDefined(AzureBlobSource)) - { - writer.WritePropertyName("azureBlobSource"u8); - writer.WriteObjectValue(AzureBlobSource); - } - if (Optional.IsDefined(AzureBlobFileListSource)) - { - writer.WritePropertyName("azureBlobFileListSource"u8); - writer.WriteObjectValue(AzureBlobFileListSource); - } - writer.WriteEndObject(); - } - - internal static ClassifierDocumentTypeDetails DeserializeClassifierDocumentTypeDetails(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional sourceKind = default; - Optional azureBlobSource = default; - Optional azureBlobFileListSource = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("sourceKind"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - sourceKind = new ContentSourceKind(property.Value.GetString()); - continue; - } - if (property.NameEquals("azureBlobSource"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - azureBlobSource = AzureBlobContentSource.DeserializeAzureBlobContentSource(property.Value); - continue; - } - if (property.NameEquals("azureBlobFileListSource"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - azureBlobFileListSource = AzureBlobFileListContentSource.DeserializeAzureBlobFileListContentSource(property.Value); - continue; - } - } - return new ClassifierDocumentTypeDetails(Optional.ToNullable(sourceKind), azureBlobSource.Value, azureBlobFileListSource.Value); - } - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ClassifierDocumentTypeDetails FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeClassifierDocumentTypeDetails(document.RootElement); - } - - /// Convert into a Utf8JsonRequestContent. - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this); - return content; - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ClassifierDocumentTypeDetails.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ClassifierDocumentTypeDetails.cs deleted file mode 100644 index 2bde45f7aa09..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ClassifierDocumentTypeDetails.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.AI.DocumentIntelligence -{ - /// Classifier document type info. - public partial class ClassifierDocumentTypeDetails - { - /// Initializes a new instance of ClassifierDocumentTypeDetails. - public ClassifierDocumentTypeDetails() - { - } - - /// Initializes a new instance of ClassifierDocumentTypeDetails. - /// Type of training data source. - /// - /// Azure Blob Storage location containing the training data for a classifier - /// document type. Either azureBlobSource or azureBlobFileListSource must be - /// specified. - /// - /// - /// Azure Blob Storage file list specifying the training data for a classifier - /// document type. Either azureBlobSource or azureBlobFileListSource must be - /// specified. - /// - internal ClassifierDocumentTypeDetails(ContentSourceKind? sourceKind, AzureBlobContentSource azureBlobSource, AzureBlobFileListContentSource azureBlobFileListSource) - { - SourceKind = sourceKind; - AzureBlobSource = azureBlobSource; - AzureBlobFileListSource = azureBlobFileListSource; - } - - /// Type of training data source. - public ContentSourceKind? SourceKind { get; set; } - /// - /// Azure Blob Storage location containing the training data for a classifier - /// document type. Either azureBlobSource or azureBlobFileListSource must be - /// specified. - /// - public AzureBlobContentSource AzureBlobSource { get; set; } - /// - /// Azure Blob Storage file list specifying the training data for a classifier - /// document type. Either azureBlobSource or azureBlobFileListSource must be - /// specified. - /// - public AzureBlobFileListContentSource AzureBlobFileListSource { get; set; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ClassifyDocumentRequest.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ClassifyDocumentRequest.Serialization.cs deleted file mode 100644 index 7876238b122f..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ClassifyDocumentRequest.Serialization.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class ClassifyDocumentRequest : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(UrlSource)) - { - writer.WritePropertyName("urlSource"u8); - writer.WriteStringValue(UrlSource.AbsoluteUri); - } - if (Optional.IsDefined(Base64Source)) - { - writer.WritePropertyName("base64Source"u8); - writer.WriteBase64StringValue(Base64Source.ToArray(), "D"); - } - writer.WriteEndObject(); - } - - /// Convert into a Utf8JsonRequestContent. - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this); - return content; - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ClassifyDocumentRequest.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ClassifyDocumentRequest.cs deleted file mode 100644 index f82e8b8d9d46..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ClassifyDocumentRequest.cs +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.AI.DocumentIntelligence -{ - /// Document classification parameters. - public partial class ClassifyDocumentRequest - { - /// Initializes a new instance of ClassifyDocumentRequest. - public ClassifyDocumentRequest() - { - } - - /// Initializes a new instance of ClassifyDocumentRequest. - /// Document URL to classify. Either urlSource or base64Source must be specified. - /// - /// Base64 encoding of the document to classify. Either urlSource or base64Source - /// must be specified. - /// - internal ClassifyDocumentRequest(Uri urlSource, BinaryData base64Source) - { - UrlSource = urlSource; - Base64Source = base64Source; - } - - /// Document URL to classify. Either urlSource or base64Source must be specified. - public Uri UrlSource { get; set; } - /// - /// Base64 encoding of the document to classify. Either urlSource or base64Source - /// must be specified. - /// - /// To assign a byte[] to this property use . - /// The byte[] will be serialized to a Base64 encoded string. - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromBytes(new byte[] { 1, 2, 3 }) - /// Creates a payload of "AQID". - /// - /// - /// - /// - public BinaryData Base64Source { get; set; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ComponentDocumentModelDetails.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ComponentDocumentModelDetails.Serialization.cs deleted file mode 100644 index 9c83f38c8022..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ComponentDocumentModelDetails.Serialization.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class ComponentDocumentModelDetails : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("modelId"u8); - writer.WriteStringValue(ModelId); - writer.WriteEndObject(); - } - - /// Convert into a Utf8JsonRequestContent. - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this); - return content; - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ComponentDocumentModelDetails.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ComponentDocumentModelDetails.cs deleted file mode 100644 index b4c59df0440c..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ComponentDocumentModelDetails.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - /// A component of a composed document model. - public partial class ComponentDocumentModelDetails - { - /// Initializes a new instance of ComponentDocumentModelDetails. - /// Unique document model name. - /// is null. - public ComponentDocumentModelDetails(string modelId) - { - Argument.AssertNotNull(modelId, nameof(modelId)); - - ModelId = modelId; - } - - /// Unique document model name. - public string ModelId { get; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ComposeDocumentModelRequest.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ComposeDocumentModelRequest.Serialization.cs deleted file mode 100644 index 63159a2eb106..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ComposeDocumentModelRequest.Serialization.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class ComposeDocumentModelRequest : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("modelId"u8); - writer.WriteStringValue(ModelId); - if (Optional.IsDefined(Description)) - { - writer.WritePropertyName("description"u8); - writer.WriteStringValue(Description); - } - writer.WritePropertyName("componentModels"u8); - writer.WriteStartArray(); - foreach (var item in ComponentModels) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WriteEndObject(); - } - - /// Convert into a Utf8JsonRequestContent. - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this); - return content; - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ComposeDocumentModelRequest.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ComposeDocumentModelRequest.cs deleted file mode 100644 index bafe06c52c84..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ComposeDocumentModelRequest.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - /// Request body to create a composed document model from component document models. - public partial class ComposeDocumentModelRequest - { - /// Initializes a new instance of ComposeDocumentModelRequest. - /// Unique document model name. - /// List of component document models to compose. - /// or is null. - public ComposeDocumentModelRequest(string modelId, IEnumerable componentModels) - { - Argument.AssertNotNull(modelId, nameof(modelId)); - Argument.AssertNotNull(componentModels, nameof(componentModels)); - - ModelId = modelId; - ComponentModels = componentModels.ToList(); - Tags = new ChangeTrackingDictionary(); - } - - /// Initializes a new instance of ComposeDocumentModelRequest. - /// Unique document model name. - /// Document model description. - /// List of component document models to compose. - /// List of key-value tag attributes associated with the document model. - internal ComposeDocumentModelRequest(string modelId, string description, IList componentModels, IDictionary tags) - { - ModelId = modelId; - Description = description; - ComponentModels = componentModels; - Tags = tags; - } - - /// Unique document model name. - public string ModelId { get; } - /// Document model description. - public string Description { get; set; } - /// List of component document models to compose. - public IList ComponentModels { get; } - /// List of key-value tag attributes associated with the document model. - public IDictionary Tags { get; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ContentFormat.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ContentFormat.cs deleted file mode 100644 index 21477a866134..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ContentFormat.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.AI.DocumentIntelligence -{ - /// Format of the content in analyzed result. - public readonly partial struct ContentFormat : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ContentFormat(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string TextValue = "text"; - private const string MarkdownValue = "markdown"; - - /// Plain text representation of the document content without any formatting. - public static ContentFormat Text { get; } = new ContentFormat(TextValue); - /// - /// Markdown representation of the document content with section headings, tables, - /// etc. - /// - public static ContentFormat Markdown { get; } = new ContentFormat(MarkdownValue); - /// Determines if two values are the same. - public static bool operator ==(ContentFormat left, ContentFormat right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ContentFormat left, ContentFormat right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ContentFormat(string value) => new ContentFormat(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ContentFormat other && Equals(other); - /// - public bool Equals(ContentFormat 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/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ContentSourceKind.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ContentSourceKind.cs deleted file mode 100644 index 219e60abd79c..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ContentSourceKind.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.AI.DocumentIntelligence -{ - /// Type of content source. - public readonly partial struct ContentSourceKind : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ContentSourceKind(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string UrlValue = "url"; - private const string Base64Value = "base64"; - private const string AzureBlobValue = "azureBlob"; - private const string AzureBlobFileListValue = "azureBlobFileList"; - - /// Content at a specific URL. - public static ContentSourceKind Url { get; } = new ContentSourceKind(UrlValue); - /// Content represented via Base64 encoding. - public static ContentSourceKind Base64 { get; } = new ContentSourceKind(Base64Value); - /// Files in a path within an Azure Blob Storage container. - public static ContentSourceKind AzureBlob { get; } = new ContentSourceKind(AzureBlobValue); - /// A file list specifying individual files in an Azure Blob Storage container. - public static ContentSourceKind AzureBlobFileList { get; } = new ContentSourceKind(AzureBlobFileListValue); - /// Determines if two values are the same. - public static bool operator ==(ContentSourceKind left, ContentSourceKind right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ContentSourceKind left, ContentSourceKind right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ContentSourceKind(string value) => new ContentSourceKind(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ContentSourceKind other && Equals(other); - /// - public bool Equals(ContentSourceKind 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/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/CopyAuthorization.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/CopyAuthorization.Serialization.cs deleted file mode 100644 index 441b334c4b10..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/CopyAuthorization.Serialization.cs +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class CopyAuthorization : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("targetResourceId"u8); - writer.WriteStringValue(TargetResourceId); - writer.WritePropertyName("targetResourceRegion"u8); - writer.WriteStringValue(TargetResourceRegion); - writer.WritePropertyName("targetModelId"u8); - writer.WriteStringValue(TargetModelId); - writer.WritePropertyName("targetModelLocation"u8); - writer.WriteStringValue(TargetModelLocation.AbsoluteUri); - writer.WritePropertyName("accessToken"u8); - writer.WriteStringValue(AccessToken); - writer.WritePropertyName("expirationDateTime"u8); - writer.WriteStringValue(ExpirationDateTime, "O"); - writer.WriteEndObject(); - } - - internal static CopyAuthorization DeserializeCopyAuthorization(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string targetResourceId = default; - string targetResourceRegion = default; - string targetModelId = default; - Uri targetModelLocation = default; - string accessToken = default; - DateTimeOffset expirationDateTime = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("targetResourceId"u8)) - { - targetResourceId = property.Value.GetString(); - continue; - } - if (property.NameEquals("targetResourceRegion"u8)) - { - targetResourceRegion = property.Value.GetString(); - continue; - } - if (property.NameEquals("targetModelId"u8)) - { - targetModelId = property.Value.GetString(); - continue; - } - if (property.NameEquals("targetModelLocation"u8)) - { - targetModelLocation = new Uri(property.Value.GetString()); - continue; - } - if (property.NameEquals("accessToken"u8)) - { - accessToken = property.Value.GetString(); - continue; - } - if (property.NameEquals("expirationDateTime"u8)) - { - expirationDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - } - return new CopyAuthorization(targetResourceId, targetResourceRegion, targetModelId, targetModelLocation, accessToken, expirationDateTime); - } - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static CopyAuthorization FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeCopyAuthorization(document.RootElement); - } - - /// Convert into a Utf8JsonRequestContent. - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this); - return content; - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/CopyAuthorization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/CopyAuthorization.cs deleted file mode 100644 index b7e55095ed67..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/CopyAuthorization.cs +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - /// - /// Authorization to copy a document model to the specified target resource and - /// modelId. - /// - public partial class CopyAuthorization - { - /// Initializes a new instance of CopyAuthorization. - /// ID of the target Azure resource where the document model should be copied to. - /// - /// Location of the target Azure resource where the document model should be copied - /// to. - /// - /// Identifier of the target document model. - /// URL of the copied document model in the target account. - /// Token used to authorize the request. - /// Date/time when the access token expires. - /// , , , or is null. - public CopyAuthorization(string targetResourceId, string targetResourceRegion, string targetModelId, Uri targetModelLocation, string accessToken, DateTimeOffset expirationDateTime) - { - Argument.AssertNotNull(targetResourceId, nameof(targetResourceId)); - Argument.AssertNotNull(targetResourceRegion, nameof(targetResourceRegion)); - Argument.AssertNotNull(targetModelId, nameof(targetModelId)); - Argument.AssertNotNull(targetModelLocation, nameof(targetModelLocation)); - Argument.AssertNotNull(accessToken, nameof(accessToken)); - - TargetResourceId = targetResourceId; - TargetResourceRegion = targetResourceRegion; - TargetModelId = targetModelId; - TargetModelLocation = targetModelLocation; - AccessToken = accessToken; - ExpirationDateTime = expirationDateTime; - } - - /// ID of the target Azure resource where the document model should be copied to. - public string TargetResourceId { get; set; } - /// - /// Location of the target Azure resource where the document model should be copied - /// to. - /// - public string TargetResourceRegion { get; set; } - /// Identifier of the target document model. - public string TargetModelId { get; set; } - /// URL of the copied document model in the target account. - public Uri TargetModelLocation { get; set; } - /// Token used to authorize the request. - public string AccessToken { get; set; } - /// Date/time when the access token expires. - public DateTimeOffset ExpirationDateTime { get; set; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/CurrencyValue.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/CurrencyValue.Serialization.cs deleted file mode 100644 index d0e0852370c4..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/CurrencyValue.Serialization.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class CurrencyValue - { - internal static CurrencyValue DeserializeCurrencyValue(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - double amount = default; - Optional currencySymbol = default; - Optional currencyCode = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("amount"u8)) - { - amount = property.Value.GetDouble(); - continue; - } - if (property.NameEquals("currencySymbol"u8)) - { - currencySymbol = property.Value.GetString(); - continue; - } - if (property.NameEquals("currencyCode"u8)) - { - currencyCode = property.Value.GetString(); - continue; - } - } - return new CurrencyValue(amount, currencySymbol.Value, currencyCode.Value); - } - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static CurrencyValue FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeCurrencyValue(document.RootElement); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/CurrencyValue.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/CurrencyValue.cs deleted file mode 100644 index 314bda9ec479..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/CurrencyValue.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.AI.DocumentIntelligence -{ - /// Currency field value. - public partial class CurrencyValue - { - /// Initializes a new instance of CurrencyValue. - /// Currency amount. - internal CurrencyValue(double amount) - { - Amount = amount; - } - - /// Initializes a new instance of CurrencyValue. - /// Currency amount. - /// Currency symbol label, if any. - /// Resolved currency code (ISO 4217), if any. - internal CurrencyValue(double amount, string currencySymbol, string currencyCode) - { - Amount = amount; - CurrencySymbol = currencySymbol; - CurrencyCode = currencyCode; - } - - /// Currency amount. - public double Amount { get; } - /// Currency symbol label, if any. - public string CurrencySymbol { get; } - /// Resolved currency code (ISO 4217), if any. - public string CurrencyCode { get; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/CustomDocumentModelsDetails.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/CustomDocumentModelsDetails.Serialization.cs deleted file mode 100644 index 5f1e703991bf..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/CustomDocumentModelsDetails.Serialization.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class CustomDocumentModelsDetails - { - internal static CustomDocumentModelsDetails DeserializeCustomDocumentModelsDetails(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - int count = default; - int limit = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("count"u8)) - { - count = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("limit"u8)) - { - limit = property.Value.GetInt32(); - continue; - } - } - return new CustomDocumentModelsDetails(count, limit); - } - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static CustomDocumentModelsDetails FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeCustomDocumentModelsDetails(document.RootElement); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/CustomDocumentModelsDetails.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/CustomDocumentModelsDetails.cs deleted file mode 100644 index 79d111b76ffc..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/CustomDocumentModelsDetails.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.AI.DocumentIntelligence -{ - /// Details regarding custom document models. - public partial class CustomDocumentModelsDetails - { - /// Initializes a new instance of CustomDocumentModelsDetails. - /// Number of custom document models in the current resource. - /// Maximum number of custom document models supported in the current resource. - internal CustomDocumentModelsDetails(int count, int limit) - { - Count = count; - Limit = limit; - } - - /// Number of custom document models in the current resource. - public int Count { get; } - /// Maximum number of custom document models supported in the current resource. - public int Limit { get; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/Docs/DocumentAnalysisClient.xml b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/Docs/DocumentAnalysisClient.xml deleted file mode 100644 index c6b1acc345b8..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/Docs/DocumentAnalysisClient.xml +++ /dev/null @@ -1,1063 +0,0 @@ - - - - - -This sample shows how to call AnalyzeDocumentAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentAnalysisClient client = new DocumentAnalysisClient(endpoint, credential); - -Operation operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, ""); -AnalyzeResult responseData = operation.Value; -]]> -This sample shows how to call AnalyzeDocumentAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentAnalysisClient client = new DocumentAnalysisClient(endpoint, credential); - -AnalyzeDocumentRequest analyzeRequest = new AnalyzeDocumentRequest -{ - UrlSource = new Uri("http://localhost:3000"), - Base64Source = BinaryData.FromObjectAsJson(new object()), -}; -Operation operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "", analyzeRequest: analyzeRequest, pages: "", locale: "", stringIndexType: StringIndexType.TextElements, features: new DocumentAnalysisFeature[] { DocumentAnalysisFeature.OcrHighResolution }, queryFields: new string[] { "" }, outputContentFormat: ContentFormat.Text); -AnalyzeResult responseData = operation.Value; -]]> - - - -This sample shows how to call AnalyzeDocument. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentAnalysisClient client = new DocumentAnalysisClient(endpoint, credential); - -Operation operation = client.AnalyzeDocument(WaitUntil.Completed, ""); -AnalyzeResult responseData = operation.Value; -]]> -This sample shows how to call AnalyzeDocument with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentAnalysisClient client = new DocumentAnalysisClient(endpoint, credential); - -AnalyzeDocumentRequest analyzeRequest = new AnalyzeDocumentRequest -{ - UrlSource = new Uri("http://localhost:3000"), - Base64Source = BinaryData.FromObjectAsJson(new object()), -}; -Operation operation = client.AnalyzeDocument(WaitUntil.Completed, "", analyzeRequest: analyzeRequest, pages: "", locale: "", stringIndexType: StringIndexType.TextElements, features: new DocumentAnalysisFeature[] { DocumentAnalysisFeature.OcrHighResolution }, queryFields: new string[] { "" }, outputContentFormat: ContentFormat.Text); -AnalyzeResult responseData = operation.Value; -]]> - - - -This sample shows how to call AnalyzeDocumentAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentAnalysisClient client = new DocumentAnalysisClient(endpoint, credential); - -using RequestContent content = null; -Operation operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "", content); -BinaryData responseData = operation.Value; - -JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("apiVersion").ToString()); -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("stringIndexType").ToString()); -Console.WriteLine(result.GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -]]> -This sample shows how to call AnalyzeDocumentAsync with all parameters and request content and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentAnalysisClient client = new DocumentAnalysisClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new -{ - urlSource = "http://localhost:3000", - base64Source = new object(), -}); -Operation operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "", content, pages: "", locale: "", stringIndexType: "textElements", features: new DocumentAnalysisFeature[] { DocumentAnalysisFeature.OcrHighResolution }, queryFields: new string[] { "" }, outputContentFormat: "text"); -BinaryData responseData = operation.Value; - -JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("apiVersion").ToString()); -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("stringIndexType").ToString()); -Console.WriteLine(result.GetProperty("contentFormat").ToString()); -Console.WriteLine(result.GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("angle").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("width").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("height").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("unit").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("words")[0].GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("words")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("words")[0].GetProperty("span").GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("words")[0].GetProperty("span").GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("words")[0].GetProperty("confidence").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("selectionMarks")[0].GetProperty("state").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("selectionMarks")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("selectionMarks")[0].GetProperty("span").GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("selectionMarks")[0].GetProperty("span").GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("selectionMarks")[0].GetProperty("confidence").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("lines")[0].GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("lines")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("lines")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("lines")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("barcodes")[0].GetProperty("kind").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("barcodes")[0].GetProperty("value").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("barcodes")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("barcodes")[0].GetProperty("span").GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("barcodes")[0].GetProperty("span").GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("barcodes")[0].GetProperty("confidence").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("formulas")[0].GetProperty("kind").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("formulas")[0].GetProperty("value").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("formulas")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("formulas")[0].GetProperty("span").GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("formulas")[0].GetProperty("span").GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("formulas")[0].GetProperty("confidence").ToString()); -Console.WriteLine(result.GetProperty("paragraphs")[0].GetProperty("role").ToString()); -Console.WriteLine(result.GetProperty("paragraphs")[0].GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("paragraphs")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("paragraphs")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("paragraphs")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("paragraphs")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("rowCount").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("columnCount").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("kind").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("rowIndex").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("columnIndex").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("rowSpan").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("columnSpan").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("elements")[0].ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("caption").GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("caption").GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("caption").GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("caption").GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("caption").GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("caption").GetProperty("elements")[0].ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("footnotes")[0].GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("footnotes")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("footnotes")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("footnotes")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("footnotes")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("footnotes")[0].GetProperty("elements")[0].ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("elements")[0].ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("caption").GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("caption").GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("caption").GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("caption").GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("caption").GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("caption").GetProperty("elements")[0].ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("footnotes")[0].GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("footnotes")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("footnotes")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("footnotes")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("footnotes")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("footnotes")[0].GetProperty("elements")[0].ToString()); -Console.WriteLine(result.GetProperty("lists")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("lists")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("level").ToString()); -Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("elements")[0].ToString()); -Console.WriteLine(result.GetProperty("sections")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("sections")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("sections")[0].GetProperty("elements")[0].ToString()); -Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("key").GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("key").GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("key").GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("key").GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("key").GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("value").GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("value").GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("value").GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("value").GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("value").GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("confidence").ToString()); -Console.WriteLine(result.GetProperty("styles")[0].GetProperty("isHandwritten").ToString()); -Console.WriteLine(result.GetProperty("styles")[0].GetProperty("similarFontFamily").ToString()); -Console.WriteLine(result.GetProperty("styles")[0].GetProperty("fontStyle").ToString()); -Console.WriteLine(result.GetProperty("styles")[0].GetProperty("fontWeight").ToString()); -Console.WriteLine(result.GetProperty("styles")[0].GetProperty("color").ToString()); -Console.WriteLine(result.GetProperty("styles")[0].GetProperty("backgroundColor").ToString()); -Console.WriteLine(result.GetProperty("styles")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("styles")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("styles")[0].GetProperty("confidence").ToString()); -Console.WriteLine(result.GetProperty("languages")[0].GetProperty("locale").ToString()); -Console.WriteLine(result.GetProperty("languages")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("languages")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("languages")[0].GetProperty("confidence").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("docType").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("type").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueString").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueDate").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueTime").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valuePhoneNumber").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueNumber").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueInteger").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueSelectionMark").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueSignature").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueCountryRegion").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("type").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueString").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueDate").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueTime").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valuePhoneNumber").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueNumber").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueInteger").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueSelectionMark").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueSignature").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueCountryRegion").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueCurrency").GetProperty("amount").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueCurrency").GetProperty("currencySymbol").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueCurrency").GetProperty("currencyCode").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("houseNumber").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("poBox").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("road").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("city").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("state").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("postalCode").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("countryRegion").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("streetAddress").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("unit").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("cityDistrict").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("stateDistrict").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("suburb").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("house").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("level").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueBoolean").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("confidence").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueCurrency").GetProperty("amount").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueCurrency").GetProperty("currencySymbol").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueCurrency").GetProperty("currencyCode").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("houseNumber").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("poBox").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("road").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("city").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("state").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("postalCode").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("countryRegion").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("streetAddress").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("unit").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("cityDistrict").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("stateDistrict").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("suburb").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("house").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("level").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueBoolean").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("confidence").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("confidence").ToString()); -]]> - - - -This sample shows how to call AnalyzeDocument and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentAnalysisClient client = new DocumentAnalysisClient(endpoint, credential); - -using RequestContent content = null; -Operation operation = client.AnalyzeDocument(WaitUntil.Completed, "", content); -BinaryData responseData = operation.Value; - -JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("apiVersion").ToString()); -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("stringIndexType").ToString()); -Console.WriteLine(result.GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -]]> -This sample shows how to call AnalyzeDocument with all parameters and request content and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentAnalysisClient client = new DocumentAnalysisClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new -{ - urlSource = "http://localhost:3000", - base64Source = new object(), -}); -Operation operation = client.AnalyzeDocument(WaitUntil.Completed, "", content, pages: "", locale: "", stringIndexType: "textElements", features: new DocumentAnalysisFeature[] { DocumentAnalysisFeature.OcrHighResolution }, queryFields: new string[] { "" }, outputContentFormat: "text"); -BinaryData responseData = operation.Value; - -JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("apiVersion").ToString()); -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("stringIndexType").ToString()); -Console.WriteLine(result.GetProperty("contentFormat").ToString()); -Console.WriteLine(result.GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("angle").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("width").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("height").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("unit").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("words")[0].GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("words")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("words")[0].GetProperty("span").GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("words")[0].GetProperty("span").GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("words")[0].GetProperty("confidence").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("selectionMarks")[0].GetProperty("state").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("selectionMarks")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("selectionMarks")[0].GetProperty("span").GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("selectionMarks")[0].GetProperty("span").GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("selectionMarks")[0].GetProperty("confidence").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("lines")[0].GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("lines")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("lines")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("lines")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("barcodes")[0].GetProperty("kind").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("barcodes")[0].GetProperty("value").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("barcodes")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("barcodes")[0].GetProperty("span").GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("barcodes")[0].GetProperty("span").GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("barcodes")[0].GetProperty("confidence").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("formulas")[0].GetProperty("kind").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("formulas")[0].GetProperty("value").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("formulas")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("formulas")[0].GetProperty("span").GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("formulas")[0].GetProperty("span").GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("formulas")[0].GetProperty("confidence").ToString()); -Console.WriteLine(result.GetProperty("paragraphs")[0].GetProperty("role").ToString()); -Console.WriteLine(result.GetProperty("paragraphs")[0].GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("paragraphs")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("paragraphs")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("paragraphs")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("paragraphs")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("rowCount").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("columnCount").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("kind").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("rowIndex").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("columnIndex").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("rowSpan").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("columnSpan").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("elements")[0].ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("caption").GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("caption").GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("caption").GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("caption").GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("caption").GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("caption").GetProperty("elements")[0].ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("footnotes")[0].GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("footnotes")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("footnotes")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("footnotes")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("footnotes")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("footnotes")[0].GetProperty("elements")[0].ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("elements")[0].ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("caption").GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("caption").GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("caption").GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("caption").GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("caption").GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("caption").GetProperty("elements")[0].ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("footnotes")[0].GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("footnotes")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("footnotes")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("footnotes")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("footnotes")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("footnotes")[0].GetProperty("elements")[0].ToString()); -Console.WriteLine(result.GetProperty("lists")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("lists")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("level").ToString()); -Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("elements")[0].ToString()); -Console.WriteLine(result.GetProperty("sections")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("sections")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("sections")[0].GetProperty("elements")[0].ToString()); -Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("key").GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("key").GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("key").GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("key").GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("key").GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("value").GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("value").GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("value").GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("value").GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("value").GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("confidence").ToString()); -Console.WriteLine(result.GetProperty("styles")[0].GetProperty("isHandwritten").ToString()); -Console.WriteLine(result.GetProperty("styles")[0].GetProperty("similarFontFamily").ToString()); -Console.WriteLine(result.GetProperty("styles")[0].GetProperty("fontStyle").ToString()); -Console.WriteLine(result.GetProperty("styles")[0].GetProperty("fontWeight").ToString()); -Console.WriteLine(result.GetProperty("styles")[0].GetProperty("color").ToString()); -Console.WriteLine(result.GetProperty("styles")[0].GetProperty("backgroundColor").ToString()); -Console.WriteLine(result.GetProperty("styles")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("styles")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("styles")[0].GetProperty("confidence").ToString()); -Console.WriteLine(result.GetProperty("languages")[0].GetProperty("locale").ToString()); -Console.WriteLine(result.GetProperty("languages")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("languages")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("languages")[0].GetProperty("confidence").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("docType").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("type").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueString").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueDate").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueTime").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valuePhoneNumber").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueNumber").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueInteger").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueSelectionMark").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueSignature").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueCountryRegion").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("type").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueString").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueDate").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueTime").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valuePhoneNumber").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueNumber").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueInteger").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueSelectionMark").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueSignature").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueCountryRegion").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueCurrency").GetProperty("amount").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueCurrency").GetProperty("currencySymbol").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueCurrency").GetProperty("currencyCode").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("houseNumber").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("poBox").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("road").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("city").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("state").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("postalCode").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("countryRegion").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("streetAddress").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("unit").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("cityDistrict").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("stateDistrict").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("suburb").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("house").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("level").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueBoolean").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("confidence").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueCurrency").GetProperty("amount").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueCurrency").GetProperty("currencySymbol").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueCurrency").GetProperty("currencyCode").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("houseNumber").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("poBox").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("road").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("city").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("state").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("postalCode").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("countryRegion").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("streetAddress").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("unit").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("cityDistrict").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("stateDistrict").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("suburb").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("house").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("level").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueBoolean").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("confidence").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("confidence").ToString()); -]]> - - - -This sample shows how to call ClassifyDocumentAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentAnalysisClient client = new DocumentAnalysisClient(endpoint, credential); - -ClassifyDocumentRequest classifyRequest = new ClassifyDocumentRequest(); -Operation operation = await client.ClassifyDocumentAsync(WaitUntil.Completed, "", classifyRequest); -AnalyzeResult responseData = operation.Value; -]]> -This sample shows how to call ClassifyDocumentAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentAnalysisClient client = new DocumentAnalysisClient(endpoint, credential); - -ClassifyDocumentRequest classifyRequest = new ClassifyDocumentRequest -{ - UrlSource = new Uri("http://localhost:3000"), - Base64Source = BinaryData.FromObjectAsJson(new object()), -}; -Operation operation = await client.ClassifyDocumentAsync(WaitUntil.Completed, "", classifyRequest, stringIndexType: StringIndexType.TextElements, split: SplitMode.Auto); -AnalyzeResult responseData = operation.Value; -]]> - - - -This sample shows how to call ClassifyDocument. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentAnalysisClient client = new DocumentAnalysisClient(endpoint, credential); - -ClassifyDocumentRequest classifyRequest = new ClassifyDocumentRequest(); -Operation operation = client.ClassifyDocument(WaitUntil.Completed, "", classifyRequest); -AnalyzeResult responseData = operation.Value; -]]> -This sample shows how to call ClassifyDocument with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentAnalysisClient client = new DocumentAnalysisClient(endpoint, credential); - -ClassifyDocumentRequest classifyRequest = new ClassifyDocumentRequest -{ - UrlSource = new Uri("http://localhost:3000"), - Base64Source = BinaryData.FromObjectAsJson(new object()), -}; -Operation operation = client.ClassifyDocument(WaitUntil.Completed, "", classifyRequest, stringIndexType: StringIndexType.TextElements, split: SplitMode.Auto); -AnalyzeResult responseData = operation.Value; -]]> - - - -This sample shows how to call ClassifyDocumentAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentAnalysisClient client = new DocumentAnalysisClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new object()); -Operation operation = await client.ClassifyDocumentAsync(WaitUntil.Completed, "", content); -BinaryData responseData = operation.Value; - -JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("apiVersion").ToString()); -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("stringIndexType").ToString()); -Console.WriteLine(result.GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -]]> -This sample shows how to call ClassifyDocumentAsync with all parameters and request content and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentAnalysisClient client = new DocumentAnalysisClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new -{ - urlSource = "http://localhost:3000", - base64Source = new object(), -}); -Operation operation = await client.ClassifyDocumentAsync(WaitUntil.Completed, "", content, stringIndexType: "textElements", split: "auto"); -BinaryData responseData = operation.Value; - -JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("apiVersion").ToString()); -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("stringIndexType").ToString()); -Console.WriteLine(result.GetProperty("contentFormat").ToString()); -Console.WriteLine(result.GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("angle").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("width").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("height").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("unit").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("words")[0].GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("words")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("words")[0].GetProperty("span").GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("words")[0].GetProperty("span").GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("words")[0].GetProperty("confidence").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("selectionMarks")[0].GetProperty("state").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("selectionMarks")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("selectionMarks")[0].GetProperty("span").GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("selectionMarks")[0].GetProperty("span").GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("selectionMarks")[0].GetProperty("confidence").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("lines")[0].GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("lines")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("lines")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("lines")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("barcodes")[0].GetProperty("kind").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("barcodes")[0].GetProperty("value").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("barcodes")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("barcodes")[0].GetProperty("span").GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("barcodes")[0].GetProperty("span").GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("barcodes")[0].GetProperty("confidence").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("formulas")[0].GetProperty("kind").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("formulas")[0].GetProperty("value").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("formulas")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("formulas")[0].GetProperty("span").GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("formulas")[0].GetProperty("span").GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("formulas")[0].GetProperty("confidence").ToString()); -Console.WriteLine(result.GetProperty("paragraphs")[0].GetProperty("role").ToString()); -Console.WriteLine(result.GetProperty("paragraphs")[0].GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("paragraphs")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("paragraphs")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("paragraphs")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("paragraphs")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("rowCount").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("columnCount").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("kind").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("rowIndex").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("columnIndex").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("rowSpan").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("columnSpan").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("elements")[0].ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("caption").GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("caption").GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("caption").GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("caption").GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("caption").GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("caption").GetProperty("elements")[0].ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("footnotes")[0].GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("footnotes")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("footnotes")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("footnotes")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("footnotes")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("footnotes")[0].GetProperty("elements")[0].ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("elements")[0].ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("caption").GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("caption").GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("caption").GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("caption").GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("caption").GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("caption").GetProperty("elements")[0].ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("footnotes")[0].GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("footnotes")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("footnotes")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("footnotes")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("footnotes")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("footnotes")[0].GetProperty("elements")[0].ToString()); -Console.WriteLine(result.GetProperty("lists")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("lists")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("level").ToString()); -Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("elements")[0].ToString()); -Console.WriteLine(result.GetProperty("sections")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("sections")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("sections")[0].GetProperty("elements")[0].ToString()); -Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("key").GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("key").GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("key").GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("key").GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("key").GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("value").GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("value").GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("value").GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("value").GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("value").GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("confidence").ToString()); -Console.WriteLine(result.GetProperty("styles")[0].GetProperty("isHandwritten").ToString()); -Console.WriteLine(result.GetProperty("styles")[0].GetProperty("similarFontFamily").ToString()); -Console.WriteLine(result.GetProperty("styles")[0].GetProperty("fontStyle").ToString()); -Console.WriteLine(result.GetProperty("styles")[0].GetProperty("fontWeight").ToString()); -Console.WriteLine(result.GetProperty("styles")[0].GetProperty("color").ToString()); -Console.WriteLine(result.GetProperty("styles")[0].GetProperty("backgroundColor").ToString()); -Console.WriteLine(result.GetProperty("styles")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("styles")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("styles")[0].GetProperty("confidence").ToString()); -Console.WriteLine(result.GetProperty("languages")[0].GetProperty("locale").ToString()); -Console.WriteLine(result.GetProperty("languages")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("languages")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("languages")[0].GetProperty("confidence").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("docType").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("type").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueString").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueDate").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueTime").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valuePhoneNumber").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueNumber").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueInteger").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueSelectionMark").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueSignature").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueCountryRegion").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("type").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueString").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueDate").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueTime").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valuePhoneNumber").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueNumber").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueInteger").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueSelectionMark").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueSignature").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueCountryRegion").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueCurrency").GetProperty("amount").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueCurrency").GetProperty("currencySymbol").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueCurrency").GetProperty("currencyCode").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("houseNumber").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("poBox").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("road").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("city").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("state").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("postalCode").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("countryRegion").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("streetAddress").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("unit").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("cityDistrict").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("stateDistrict").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("suburb").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("house").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("level").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueBoolean").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("confidence").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueCurrency").GetProperty("amount").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueCurrency").GetProperty("currencySymbol").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueCurrency").GetProperty("currencyCode").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("houseNumber").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("poBox").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("road").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("city").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("state").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("postalCode").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("countryRegion").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("streetAddress").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("unit").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("cityDistrict").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("stateDistrict").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("suburb").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("house").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("level").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueBoolean").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("confidence").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("confidence").ToString()); -]]> - - - -This sample shows how to call ClassifyDocument and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentAnalysisClient client = new DocumentAnalysisClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new object()); -Operation operation = client.ClassifyDocument(WaitUntil.Completed, "", content); -BinaryData responseData = operation.Value; - -JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("apiVersion").ToString()); -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("stringIndexType").ToString()); -Console.WriteLine(result.GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -]]> -This sample shows how to call ClassifyDocument with all parameters and request content and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentAnalysisClient client = new DocumentAnalysisClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new -{ - urlSource = "http://localhost:3000", - base64Source = new object(), -}); -Operation operation = client.ClassifyDocument(WaitUntil.Completed, "", content, stringIndexType: "textElements", split: "auto"); -BinaryData responseData = operation.Value; - -JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("apiVersion").ToString()); -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("stringIndexType").ToString()); -Console.WriteLine(result.GetProperty("contentFormat").ToString()); -Console.WriteLine(result.GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("angle").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("width").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("height").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("unit").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("words")[0].GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("words")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("words")[0].GetProperty("span").GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("words")[0].GetProperty("span").GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("words")[0].GetProperty("confidence").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("selectionMarks")[0].GetProperty("state").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("selectionMarks")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("selectionMarks")[0].GetProperty("span").GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("selectionMarks")[0].GetProperty("span").GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("selectionMarks")[0].GetProperty("confidence").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("lines")[0].GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("lines")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("lines")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("lines")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("barcodes")[0].GetProperty("kind").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("barcodes")[0].GetProperty("value").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("barcodes")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("barcodes")[0].GetProperty("span").GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("barcodes")[0].GetProperty("span").GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("barcodes")[0].GetProperty("confidence").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("formulas")[0].GetProperty("kind").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("formulas")[0].GetProperty("value").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("formulas")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("formulas")[0].GetProperty("span").GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("formulas")[0].GetProperty("span").GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("pages")[0].GetProperty("formulas")[0].GetProperty("confidence").ToString()); -Console.WriteLine(result.GetProperty("paragraphs")[0].GetProperty("role").ToString()); -Console.WriteLine(result.GetProperty("paragraphs")[0].GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("paragraphs")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("paragraphs")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("paragraphs")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("paragraphs")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("rowCount").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("columnCount").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("kind").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("rowIndex").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("columnIndex").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("rowSpan").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("columnSpan").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("elements")[0].ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("caption").GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("caption").GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("caption").GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("caption").GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("caption").GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("caption").GetProperty("elements")[0].ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("footnotes")[0].GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("footnotes")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("footnotes")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("footnotes")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("footnotes")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("tables")[0].GetProperty("footnotes")[0].GetProperty("elements")[0].ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("elements")[0].ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("caption").GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("caption").GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("caption").GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("caption").GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("caption").GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("caption").GetProperty("elements")[0].ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("footnotes")[0].GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("footnotes")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("footnotes")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("footnotes")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("footnotes")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("figures")[0].GetProperty("footnotes")[0].GetProperty("elements")[0].ToString()); -Console.WriteLine(result.GetProperty("lists")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("lists")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("level").ToString()); -Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("elements")[0].ToString()); -Console.WriteLine(result.GetProperty("sections")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("sections")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("sections")[0].GetProperty("elements")[0].ToString()); -Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("key").GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("key").GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("key").GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("key").GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("key").GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("value").GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("value").GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("value").GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("value").GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("value").GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("confidence").ToString()); -Console.WriteLine(result.GetProperty("styles")[0].GetProperty("isHandwritten").ToString()); -Console.WriteLine(result.GetProperty("styles")[0].GetProperty("similarFontFamily").ToString()); -Console.WriteLine(result.GetProperty("styles")[0].GetProperty("fontStyle").ToString()); -Console.WriteLine(result.GetProperty("styles")[0].GetProperty("fontWeight").ToString()); -Console.WriteLine(result.GetProperty("styles")[0].GetProperty("color").ToString()); -Console.WriteLine(result.GetProperty("styles")[0].GetProperty("backgroundColor").ToString()); -Console.WriteLine(result.GetProperty("styles")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("styles")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("styles")[0].GetProperty("confidence").ToString()); -Console.WriteLine(result.GetProperty("languages")[0].GetProperty("locale").ToString()); -Console.WriteLine(result.GetProperty("languages")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("languages")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("languages")[0].GetProperty("confidence").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("docType").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("type").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueString").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueDate").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueTime").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valuePhoneNumber").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueNumber").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueInteger").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueSelectionMark").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueSignature").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueCountryRegion").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("type").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueString").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueDate").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueTime").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valuePhoneNumber").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueNumber").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueInteger").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueSelectionMark").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueSignature").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueCountryRegion").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueCurrency").GetProperty("amount").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueCurrency").GetProperty("currencySymbol").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueCurrency").GetProperty("currencyCode").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("houseNumber").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("poBox").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("road").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("city").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("state").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("postalCode").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("countryRegion").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("streetAddress").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("unit").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("cityDistrict").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("stateDistrict").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("suburb").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("house").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("level").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueBoolean").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("confidence").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueCurrency").GetProperty("amount").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueCurrency").GetProperty("currencySymbol").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueCurrency").GetProperty("currencyCode").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("houseNumber").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("poBox").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("road").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("city").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("state").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("postalCode").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("countryRegion").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("streetAddress").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("unit").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("cityDistrict").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("stateDistrict").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("suburb").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("house").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("level").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueBoolean").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("content").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("spans")[0].GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("spans")[0].GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("confidence").ToString()); -Console.WriteLine(result.GetProperty("documents")[0].GetProperty("confidence").ToString()); -]]> - - - \ No newline at end of file diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/Docs/DocumentModelAdministrationClient.xml b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/Docs/DocumentModelAdministrationClient.xml deleted file mode 100644 index 27718aeb4c58..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/Docs/DocumentModelAdministrationClient.xml +++ /dev/null @@ -1,1945 +0,0 @@ - - - - - -This sample shows how to call AuthorizeModelCopyAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -AuthorizeCopyRequest authorizeCopyRequest = new AuthorizeCopyRequest(""); -Response response = await client.AuthorizeModelCopyAsync(authorizeCopyRequest); -]]> -This sample shows how to call AuthorizeModelCopyAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -AuthorizeCopyRequest authorizeCopyRequest = new AuthorizeCopyRequest("") -{ - Description = "", - Tags = - { - ["key"] = "" - }, -}; -Response response = await client.AuthorizeModelCopyAsync(authorizeCopyRequest); -]]> - - - -This sample shows how to call AuthorizeModelCopy. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -AuthorizeCopyRequest authorizeCopyRequest = new AuthorizeCopyRequest(""); -Response response = client.AuthorizeModelCopy(authorizeCopyRequest); -]]> -This sample shows how to call AuthorizeModelCopy with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -AuthorizeCopyRequest authorizeCopyRequest = new AuthorizeCopyRequest("") -{ - Description = "", - Tags = - { - ["key"] = "" - }, -}; -Response response = client.AuthorizeModelCopy(authorizeCopyRequest); -]]> - - - -This sample shows how to call AuthorizeModelCopyAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new -{ - modelId = "", -}); -Response response = await client.AuthorizeModelCopyAsync(content); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("targetResourceId").ToString()); -Console.WriteLine(result.GetProperty("targetResourceRegion").ToString()); -Console.WriteLine(result.GetProperty("targetModelId").ToString()); -Console.WriteLine(result.GetProperty("targetModelLocation").ToString()); -Console.WriteLine(result.GetProperty("accessToken").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -]]> -This sample shows how to call AuthorizeModelCopyAsync with all request content and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new -{ - modelId = "", - description = "", - tags = new - { - key = "", - }, -}); -Response response = await client.AuthorizeModelCopyAsync(content); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("targetResourceId").ToString()); -Console.WriteLine(result.GetProperty("targetResourceRegion").ToString()); -Console.WriteLine(result.GetProperty("targetModelId").ToString()); -Console.WriteLine(result.GetProperty("targetModelLocation").ToString()); -Console.WriteLine(result.GetProperty("accessToken").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -]]> - - - -This sample shows how to call AuthorizeModelCopy and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new -{ - modelId = "", -}); -Response response = client.AuthorizeModelCopy(content); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("targetResourceId").ToString()); -Console.WriteLine(result.GetProperty("targetResourceRegion").ToString()); -Console.WriteLine(result.GetProperty("targetModelId").ToString()); -Console.WriteLine(result.GetProperty("targetModelLocation").ToString()); -Console.WriteLine(result.GetProperty("accessToken").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -]]> -This sample shows how to call AuthorizeModelCopy with all request content and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new -{ - modelId = "", - description = "", - tags = new - { - key = "", - }, -}); -Response response = client.AuthorizeModelCopy(content); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("targetResourceId").ToString()); -Console.WriteLine(result.GetProperty("targetResourceRegion").ToString()); -Console.WriteLine(result.GetProperty("targetModelId").ToString()); -Console.WriteLine(result.GetProperty("targetModelLocation").ToString()); -Console.WriteLine(result.GetProperty("accessToken").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -]]> - - - -This sample shows how to call GetModelAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -Response response = await client.GetModelAsync(""); -]]> -This sample shows how to call GetModelAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -Response response = await client.GetModelAsync(""); -]]> - - - -This sample shows how to call GetModel. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -Response response = client.GetModel(""); -]]> -This sample shows how to call GetModel with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -Response response = client.GetModel(""); -]]> - - - -This sample shows how to call GetModelAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -Response response = await client.GetModelAsync("", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -]]> -This sample shows how to call GetModelAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -Response response = await client.GetModelAsync("", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("apiVersion").ToString()); -Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("buildMode").ToString()); -Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("containerUrl").ToString()); -Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("prefix").ToString()); -Console.WriteLine(result.GetProperty("azureBlobFileListSource").GetProperty("containerUrl").ToString()); -Console.WriteLine(result.GetProperty("azureBlobFileListSource").GetProperty("fileList").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("buildMode").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("type").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("example").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("type").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("example").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldConfidence").GetProperty("").ToString()); -]]> - - - -This sample shows how to call GetModel and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -Response response = client.GetModel("", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -]]> -This sample shows how to call GetModel with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -Response response = client.GetModel("", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("apiVersion").ToString()); -Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("buildMode").ToString()); -Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("containerUrl").ToString()); -Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("prefix").ToString()); -Console.WriteLine(result.GetProperty("azureBlobFileListSource").GetProperty("containerUrl").ToString()); -Console.WriteLine(result.GetProperty("azureBlobFileListSource").GetProperty("fileList").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("buildMode").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("type").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("example").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("type").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("example").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldConfidence").GetProperty("").ToString()); -]]> - - - -This sample shows how to call DeleteModelAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -Response response = await client.DeleteModelAsync(""); - -Console.WriteLine(response.Status); -]]> -This sample shows how to call DeleteModelAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -Response response = await client.DeleteModelAsync(""); - -Console.WriteLine(response.Status); -]]> - - - -This sample shows how to call DeleteModel. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -Response response = client.DeleteModel(""); - -Console.WriteLine(response.Status); -]]> -This sample shows how to call DeleteModel with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -Response response = client.DeleteModel(""); - -Console.WriteLine(response.Status); -]]> - - - -This sample shows how to call GetResourceInfoAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -Response response = await client.GetResourceInfoAsync(); -]]> -This sample shows how to call GetResourceInfoAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -Response response = await client.GetResourceInfoAsync(); -]]> - - - -This sample shows how to call GetResourceInfo. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -Response response = client.GetResourceInfo(); -]]> -This sample shows how to call GetResourceInfo with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -Response response = client.GetResourceInfo(); -]]> - - - -This sample shows how to call GetResourceInfoAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -Response response = await client.GetResourceInfoAsync(null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("customDocumentModels").GetProperty("count").ToString()); -Console.WriteLine(result.GetProperty("customDocumentModels").GetProperty("limit").ToString()); -Console.WriteLine(result.GetProperty("customNeuralDocumentModelBuilds").GetProperty("used").ToString()); -Console.WriteLine(result.GetProperty("customNeuralDocumentModelBuilds").GetProperty("quota").ToString()); -Console.WriteLine(result.GetProperty("customNeuralDocumentModelBuilds").GetProperty("quotaResetDateTime").ToString()); -]]> -This sample shows how to call GetResourceInfoAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -Response response = await client.GetResourceInfoAsync(null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("customDocumentModels").GetProperty("count").ToString()); -Console.WriteLine(result.GetProperty("customDocumentModels").GetProperty("limit").ToString()); -Console.WriteLine(result.GetProperty("customNeuralDocumentModelBuilds").GetProperty("used").ToString()); -Console.WriteLine(result.GetProperty("customNeuralDocumentModelBuilds").GetProperty("quota").ToString()); -Console.WriteLine(result.GetProperty("customNeuralDocumentModelBuilds").GetProperty("quotaResetDateTime").ToString()); -]]> - - - -This sample shows how to call GetResourceInfo and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -Response response = client.GetResourceInfo(null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("customDocumentModels").GetProperty("count").ToString()); -Console.WriteLine(result.GetProperty("customDocumentModels").GetProperty("limit").ToString()); -Console.WriteLine(result.GetProperty("customNeuralDocumentModelBuilds").GetProperty("used").ToString()); -Console.WriteLine(result.GetProperty("customNeuralDocumentModelBuilds").GetProperty("quota").ToString()); -Console.WriteLine(result.GetProperty("customNeuralDocumentModelBuilds").GetProperty("quotaResetDateTime").ToString()); -]]> -This sample shows how to call GetResourceInfo with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -Response response = client.GetResourceInfo(null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("customDocumentModels").GetProperty("count").ToString()); -Console.WriteLine(result.GetProperty("customDocumentModels").GetProperty("limit").ToString()); -Console.WriteLine(result.GetProperty("customNeuralDocumentModelBuilds").GetProperty("used").ToString()); -Console.WriteLine(result.GetProperty("customNeuralDocumentModelBuilds").GetProperty("quota").ToString()); -Console.WriteLine(result.GetProperty("customNeuralDocumentModelBuilds").GetProperty("quotaResetDateTime").ToString()); -]]> - - - -This sample shows how to call GetOperationAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -Response response = await client.GetOperationAsync(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a")); -]]> -This sample shows how to call GetOperationAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -Response response = await client.GetOperationAsync(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a")); -]]> - - - -This sample shows how to call GetOperation. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -Response response = client.GetOperation(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a")); -]]> -This sample shows how to call GetOperation with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -Response response = client.GetOperation(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a")); -]]> - - - -This sample shows how to call GetOperationAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -Response response = await client.GetOperationAsync(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("operationId").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("kind").ToString()); -Console.WriteLine(result.GetProperty("resourceLocation").ToString()); -]]> -This sample shows how to call GetOperationAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -Response response = await client.GetOperationAsync(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("operationId").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("percentCompleted").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("kind").ToString()); -Console.WriteLine(result.GetProperty("resourceLocation").ToString()); -Console.WriteLine(result.GetProperty("apiVersion").ToString()); -Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("error").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("error").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("error").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("message").ToString()); -]]> - - - -This sample shows how to call GetOperation and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -Response response = client.GetOperation(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("operationId").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("kind").ToString()); -Console.WriteLine(result.GetProperty("resourceLocation").ToString()); -]]> -This sample shows how to call GetOperation with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -Response response = client.GetOperation(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("operationId").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("percentCompleted").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("kind").ToString()); -Console.WriteLine(result.GetProperty("resourceLocation").ToString()); -Console.WriteLine(result.GetProperty("apiVersion").ToString()); -Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("error").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("error").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("error").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("message").ToString()); -]]> - - - -This sample shows how to call GetClassifierAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -Response response = await client.GetClassifierAsync(""); -]]> -This sample shows how to call GetClassifierAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -Response response = await client.GetClassifierAsync(""); -]]> - - - -This sample shows how to call GetClassifier. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -Response response = client.GetClassifier(""); -]]> -This sample shows how to call GetClassifier with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -Response response = client.GetClassifier(""); -]]> - - - -This sample shows how to call GetClassifierAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -Response response = await client.GetClassifierAsync("", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("classifierId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("apiVersion").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").ToString()); -]]> -This sample shows how to call GetClassifierAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -Response response = await client.GetClassifierAsync("", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("classifierId").ToString()); -Console.WriteLine(result.GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("apiVersion").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("sourceKind").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("azureBlobSource").GetProperty("containerUrl").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("azureBlobSource").GetProperty("prefix").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("azureBlobFileListSource").GetProperty("containerUrl").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("azureBlobFileListSource").GetProperty("fileList").ToString()); -]]> - - - -This sample shows how to call GetClassifier and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -Response response = client.GetClassifier("", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("classifierId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("apiVersion").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").ToString()); -]]> -This sample shows how to call GetClassifier with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -Response response = client.GetClassifier("", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("classifierId").ToString()); -Console.WriteLine(result.GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("apiVersion").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("sourceKind").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("azureBlobSource").GetProperty("containerUrl").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("azureBlobSource").GetProperty("prefix").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("azureBlobFileListSource").GetProperty("containerUrl").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("azureBlobFileListSource").GetProperty("fileList").ToString()); -]]> - - - -This sample shows how to call DeleteClassifierAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -Response response = await client.DeleteClassifierAsync(""); - -Console.WriteLine(response.Status); -]]> -This sample shows how to call DeleteClassifierAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -Response response = await client.DeleteClassifierAsync(""); - -Console.WriteLine(response.Status); -]]> - - - -This sample shows how to call DeleteClassifier. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -Response response = client.DeleteClassifier(""); - -Console.WriteLine(response.Status); -]]> -This sample shows how to call DeleteClassifier with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -Response response = client.DeleteClassifier(""); - -Console.WriteLine(response.Status); -]]> - - - -This sample shows how to call GetModelsAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -await foreach (DocumentModelDetails item in client.GetModelsAsync()) -{ -} -]]> -This sample shows how to call GetModelsAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -await foreach (DocumentModelDetails item in client.GetModelsAsync()) -{ -} -]]> - - - -This sample shows how to call GetModels. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -foreach (DocumentModelDetails item in client.GetModels()) -{ -} -]]> -This sample shows how to call GetModels with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -foreach (DocumentModelDetails item in client.GetModels()) -{ -} -]]> - - - -This sample shows how to call GetModelsAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -await foreach (BinaryData item in client.GetModelsAsync(null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -} -]]> -This sample shows how to call GetModelsAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -await foreach (BinaryData item in client.GetModelsAsync(null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("apiVersion").ToString()); - Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("buildMode").ToString()); - Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("containerUrl").ToString()); - Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("prefix").ToString()); - Console.WriteLine(result.GetProperty("azureBlobFileListSource").GetProperty("containerUrl").ToString()); - Console.WriteLine(result.GetProperty("azureBlobFileListSource").GetProperty("fileList").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("buildMode").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("type").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("example").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("type").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("example").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldConfidence").GetProperty("").ToString()); -} -]]> - - - -This sample shows how to call GetModels and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -foreach (BinaryData item in client.GetModels(null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -} -]]> -This sample shows how to call GetModels with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -foreach (BinaryData item in client.GetModels(null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("apiVersion").ToString()); - Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("buildMode").ToString()); - Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("containerUrl").ToString()); - Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("prefix").ToString()); - Console.WriteLine(result.GetProperty("azureBlobFileListSource").GetProperty("containerUrl").ToString()); - Console.WriteLine(result.GetProperty("azureBlobFileListSource").GetProperty("fileList").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("buildMode").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("type").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("example").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("type").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("example").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldConfidence").GetProperty("").ToString()); -} -]]> - - - -This sample shows how to call GetOperationsAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -await foreach (OperationDetails item in client.GetOperationsAsync()) -{ -} -]]> -This sample shows how to call GetOperationsAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -await foreach (OperationDetails item in client.GetOperationsAsync()) -{ -} -]]> - - - -This sample shows how to call GetOperations. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -foreach (OperationDetails item in client.GetOperations()) -{ -} -]]> -This sample shows how to call GetOperations with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -foreach (OperationDetails item in client.GetOperations()) -{ -} -]]> - - - -This sample shows how to call GetOperationsAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -await foreach (BinaryData item in client.GetOperationsAsync(null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("operationId").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("resourceLocation").ToString()); -} -]]> -This sample shows how to call GetOperationsAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -await foreach (BinaryData item in client.GetOperationsAsync(null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("operationId").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("percentCompleted").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("resourceLocation").ToString()); - Console.WriteLine(result.GetProperty("apiVersion").ToString()); - Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("error").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("error").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("error").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("message").ToString()); -} -]]> - - - -This sample shows how to call GetOperations and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -foreach (BinaryData item in client.GetOperations(null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("operationId").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("resourceLocation").ToString()); -} -]]> -This sample shows how to call GetOperations with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -foreach (BinaryData item in client.GetOperations(null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("operationId").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("percentCompleted").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("resourceLocation").ToString()); - Console.WriteLine(result.GetProperty("apiVersion").ToString()); - Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("error").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("error").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("error").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("message").ToString()); -} -]]> - - - -This sample shows how to call GetClassifiersAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -await foreach (DocumentClassifierDetails item in client.GetClassifiersAsync()) -{ -} -]]> -This sample shows how to call GetClassifiersAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -await foreach (DocumentClassifierDetails item in client.GetClassifiersAsync()) -{ -} -]]> - - - -This sample shows how to call GetClassifiers. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -foreach (DocumentClassifierDetails item in client.GetClassifiers()) -{ -} -]]> -This sample shows how to call GetClassifiers with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -foreach (DocumentClassifierDetails item in client.GetClassifiers()) -{ -} -]]> - - - -This sample shows how to call GetClassifiersAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -await foreach (BinaryData item in client.GetClassifiersAsync(null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("classifierId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("apiVersion").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").ToString()); -} -]]> -This sample shows how to call GetClassifiersAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -await foreach (BinaryData item in client.GetClassifiersAsync(null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("classifierId").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("apiVersion").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("sourceKind").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("azureBlobSource").GetProperty("containerUrl").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("azureBlobSource").GetProperty("prefix").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("azureBlobFileListSource").GetProperty("containerUrl").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("azureBlobFileListSource").GetProperty("fileList").ToString()); -} -]]> - - - -This sample shows how to call GetClassifiers and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -foreach (BinaryData item in client.GetClassifiers(null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("classifierId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("apiVersion").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").ToString()); -} -]]> -This sample shows how to call GetClassifiers with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -foreach (BinaryData item in client.GetClassifiers(null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("classifierId").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("apiVersion").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("sourceKind").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("azureBlobSource").GetProperty("containerUrl").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("azureBlobSource").GetProperty("prefix").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("azureBlobFileListSource").GetProperty("containerUrl").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("azureBlobFileListSource").GetProperty("fileList").ToString()); -} -]]> - - - -This sample shows how to call BuildDocumentModelAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -BuildDocumentModelRequest buildRequest = new BuildDocumentModelRequest("", DocumentBuildMode.Template); -Operation operation = await client.BuildDocumentModelAsync(WaitUntil.Completed, buildRequest); -DocumentModelDetails responseData = operation.Value; -]]> -This sample shows how to call BuildDocumentModelAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -BuildDocumentModelRequest buildRequest = new BuildDocumentModelRequest("", DocumentBuildMode.Template) -{ - Description = "", - AzureBlobSource = new AzureBlobContentSource(new Uri("http://localhost:3000")) - { - Prefix = "", - }, - AzureBlobFileListSource = new AzureBlobFileListContentSource(new Uri("http://localhost:3000"), ""), - Tags = - { - ["key"] = "" - }, -}; -Operation operation = await client.BuildDocumentModelAsync(WaitUntil.Completed, buildRequest); -DocumentModelDetails responseData = operation.Value; -]]> - - - -This sample shows how to call BuildDocumentModel. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -BuildDocumentModelRequest buildRequest = new BuildDocumentModelRequest("", DocumentBuildMode.Template); -Operation operation = client.BuildDocumentModel(WaitUntil.Completed, buildRequest); -DocumentModelDetails responseData = operation.Value; -]]> -This sample shows how to call BuildDocumentModel with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -BuildDocumentModelRequest buildRequest = new BuildDocumentModelRequest("", DocumentBuildMode.Template) -{ - Description = "", - AzureBlobSource = new AzureBlobContentSource(new Uri("http://localhost:3000")) - { - Prefix = "", - }, - AzureBlobFileListSource = new AzureBlobFileListContentSource(new Uri("http://localhost:3000"), ""), - Tags = - { - ["key"] = "" - }, -}; -Operation operation = client.BuildDocumentModel(WaitUntil.Completed, buildRequest); -DocumentModelDetails responseData = operation.Value; -]]> - - - -This sample shows how to call BuildDocumentModelAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new -{ - modelId = "", - buildMode = "template", -}); -Operation operation = await client.BuildDocumentModelAsync(WaitUntil.Completed, content); -BinaryData responseData = operation.Value; - -JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -]]> -This sample shows how to call BuildDocumentModelAsync with all parameters and request content and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new -{ - modelId = "", - description = "", - buildMode = "template", - azureBlobSource = new - { - containerUrl = "http://localhost:3000", - prefix = "", - }, - azureBlobFileListSource = new - { - containerUrl = "http://localhost:3000", - fileList = "", - }, - tags = new - { - key = "", - }, -}); -Operation operation = await client.BuildDocumentModelAsync(WaitUntil.Completed, content); -BinaryData responseData = operation.Value; - -JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("apiVersion").ToString()); -Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("buildMode").ToString()); -Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("containerUrl").ToString()); -Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("prefix").ToString()); -Console.WriteLine(result.GetProperty("azureBlobFileListSource").GetProperty("containerUrl").ToString()); -Console.WriteLine(result.GetProperty("azureBlobFileListSource").GetProperty("fileList").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("buildMode").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("type").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("example").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("type").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("example").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldConfidence").GetProperty("").ToString()); -]]> - - - -This sample shows how to call BuildDocumentModel and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new -{ - modelId = "", - buildMode = "template", -}); -Operation operation = client.BuildDocumentModel(WaitUntil.Completed, content); -BinaryData responseData = operation.Value; - -JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -]]> -This sample shows how to call BuildDocumentModel with all parameters and request content and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new -{ - modelId = "", - description = "", - buildMode = "template", - azureBlobSource = new - { - containerUrl = "http://localhost:3000", - prefix = "", - }, - azureBlobFileListSource = new - { - containerUrl = "http://localhost:3000", - fileList = "", - }, - tags = new - { - key = "", - }, -}); -Operation operation = client.BuildDocumentModel(WaitUntil.Completed, content); -BinaryData responseData = operation.Value; - -JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("apiVersion").ToString()); -Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("buildMode").ToString()); -Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("containerUrl").ToString()); -Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("prefix").ToString()); -Console.WriteLine(result.GetProperty("azureBlobFileListSource").GetProperty("containerUrl").ToString()); -Console.WriteLine(result.GetProperty("azureBlobFileListSource").GetProperty("fileList").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("buildMode").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("type").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("example").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("type").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("example").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldConfidence").GetProperty("").ToString()); -]]> - - - -This sample shows how to call ComposeModelAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -ComposeDocumentModelRequest composeRequest = new ComposeDocumentModelRequest("", new ComponentDocumentModelDetails[] -{ - new ComponentDocumentModelDetails("") -}); -Operation operation = await client.ComposeModelAsync(WaitUntil.Completed, composeRequest); -DocumentModelDetails responseData = operation.Value; -]]> -This sample shows how to call ComposeModelAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -ComposeDocumentModelRequest composeRequest = new ComposeDocumentModelRequest("", new ComponentDocumentModelDetails[] -{ - new ComponentDocumentModelDetails("") -}) -{ - Description = "", - Tags = - { - ["key"] = "" - }, -}; -Operation operation = await client.ComposeModelAsync(WaitUntil.Completed, composeRequest); -DocumentModelDetails responseData = operation.Value; -]]> - - - -This sample shows how to call ComposeModel. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -ComposeDocumentModelRequest composeRequest = new ComposeDocumentModelRequest("", new ComponentDocumentModelDetails[] -{ - new ComponentDocumentModelDetails("") -}); -Operation operation = client.ComposeModel(WaitUntil.Completed, composeRequest); -DocumentModelDetails responseData = operation.Value; -]]> -This sample shows how to call ComposeModel with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -ComposeDocumentModelRequest composeRequest = new ComposeDocumentModelRequest("", new ComponentDocumentModelDetails[] -{ - new ComponentDocumentModelDetails("") -}) -{ - Description = "", - Tags = - { - ["key"] = "" - }, -}; -Operation operation = client.ComposeModel(WaitUntil.Completed, composeRequest); -DocumentModelDetails responseData = operation.Value; -]]> - - - -This sample shows how to call ComposeModelAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new -{ - modelId = "", - componentModels = new object[] - { - new - { - modelId = "", - } - }, -}); -Operation operation = await client.ComposeModelAsync(WaitUntil.Completed, content); -BinaryData responseData = operation.Value; - -JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -]]> -This sample shows how to call ComposeModelAsync with all parameters and request content and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new -{ - modelId = "", - description = "", - componentModels = new object[] - { - new - { - modelId = "", - } - }, - tags = new - { - key = "", - }, -}); -Operation operation = await client.ComposeModelAsync(WaitUntil.Completed, content); -BinaryData responseData = operation.Value; - -JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("apiVersion").ToString()); -Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("buildMode").ToString()); -Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("containerUrl").ToString()); -Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("prefix").ToString()); -Console.WriteLine(result.GetProperty("azureBlobFileListSource").GetProperty("containerUrl").ToString()); -Console.WriteLine(result.GetProperty("azureBlobFileListSource").GetProperty("fileList").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("buildMode").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("type").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("example").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("type").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("example").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldConfidence").GetProperty("").ToString()); -]]> - - - -This sample shows how to call ComposeModel and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new -{ - modelId = "", - componentModels = new object[] - { - new - { - modelId = "", - } - }, -}); -Operation operation = client.ComposeModel(WaitUntil.Completed, content); -BinaryData responseData = operation.Value; - -JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -]]> -This sample shows how to call ComposeModel with all parameters and request content and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new -{ - modelId = "", - description = "", - componentModels = new object[] - { - new - { - modelId = "", - } - }, - tags = new - { - key = "", - }, -}); -Operation operation = client.ComposeModel(WaitUntil.Completed, content); -BinaryData responseData = operation.Value; - -JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("apiVersion").ToString()); -Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("buildMode").ToString()); -Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("containerUrl").ToString()); -Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("prefix").ToString()); -Console.WriteLine(result.GetProperty("azureBlobFileListSource").GetProperty("containerUrl").ToString()); -Console.WriteLine(result.GetProperty("azureBlobFileListSource").GetProperty("fileList").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("buildMode").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("type").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("example").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("type").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("example").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldConfidence").GetProperty("").ToString()); -]]> - - - -This sample shows how to call CopyModelToAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -CopyAuthorization copyToRequest = new CopyAuthorization("", "", "", new Uri("http://localhost:3000"), "", DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00")); -Operation operation = await client.CopyModelToAsync(WaitUntil.Completed, "", copyToRequest); -DocumentModelDetails responseData = operation.Value; -]]> -This sample shows how to call CopyModelToAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -CopyAuthorization copyToRequest = new CopyAuthorization("", "", "", new Uri("http://localhost:3000"), "", DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00")); -Operation operation = await client.CopyModelToAsync(WaitUntil.Completed, "", copyToRequest); -DocumentModelDetails responseData = operation.Value; -]]> - - - -This sample shows how to call CopyModelTo. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -CopyAuthorization copyToRequest = new CopyAuthorization("", "", "", new Uri("http://localhost:3000"), "", DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00")); -Operation operation = client.CopyModelTo(WaitUntil.Completed, "", copyToRequest); -DocumentModelDetails responseData = operation.Value; -]]> -This sample shows how to call CopyModelTo with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -CopyAuthorization copyToRequest = new CopyAuthorization("", "", "", new Uri("http://localhost:3000"), "", DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00")); -Operation operation = client.CopyModelTo(WaitUntil.Completed, "", copyToRequest); -DocumentModelDetails responseData = operation.Value; -]]> - - - -This sample shows how to call CopyModelToAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new -{ - targetResourceId = "", - targetResourceRegion = "", - targetModelId = "", - targetModelLocation = "http://localhost:3000", - accessToken = "", - expirationDateTime = "2022-05-10T14:57:31.2311892-04:00", -}); -Operation operation = await client.CopyModelToAsync(WaitUntil.Completed, "", content); -BinaryData responseData = operation.Value; - -JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -]]> -This sample shows how to call CopyModelToAsync with all parameters and request content and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new -{ - targetResourceId = "", - targetResourceRegion = "", - targetModelId = "", - targetModelLocation = "http://localhost:3000", - accessToken = "", - expirationDateTime = "2022-05-10T14:57:31.2311892-04:00", -}); -Operation operation = await client.CopyModelToAsync(WaitUntil.Completed, "", content); -BinaryData responseData = operation.Value; - -JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("apiVersion").ToString()); -Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("buildMode").ToString()); -Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("containerUrl").ToString()); -Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("prefix").ToString()); -Console.WriteLine(result.GetProperty("azureBlobFileListSource").GetProperty("containerUrl").ToString()); -Console.WriteLine(result.GetProperty("azureBlobFileListSource").GetProperty("fileList").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("buildMode").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("type").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("example").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("type").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("example").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldConfidence").GetProperty("").ToString()); -]]> - - - -This sample shows how to call CopyModelTo and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new -{ - targetResourceId = "", - targetResourceRegion = "", - targetModelId = "", - targetModelLocation = "http://localhost:3000", - accessToken = "", - expirationDateTime = "2022-05-10T14:57:31.2311892-04:00", -}); -Operation operation = client.CopyModelTo(WaitUntil.Completed, "", content); -BinaryData responseData = operation.Value; - -JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -]]> -This sample shows how to call CopyModelTo with all parameters and request content and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new -{ - targetResourceId = "", - targetResourceRegion = "", - targetModelId = "", - targetModelLocation = "http://localhost:3000", - accessToken = "", - expirationDateTime = "2022-05-10T14:57:31.2311892-04:00", -}); -Operation operation = client.CopyModelTo(WaitUntil.Completed, "", content); -BinaryData responseData = operation.Value; - -JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("apiVersion").ToString()); -Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("buildMode").ToString()); -Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("containerUrl").ToString()); -Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("prefix").ToString()); -Console.WriteLine(result.GetProperty("azureBlobFileListSource").GetProperty("containerUrl").ToString()); -Console.WriteLine(result.GetProperty("azureBlobFileListSource").GetProperty("fileList").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("buildMode").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("type").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("example").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("type").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("example").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldConfidence").GetProperty("").ToString()); -]]> - - - -This sample shows how to call BuildClassifierAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -BuildDocumentClassifierRequest buildRequest = new BuildDocumentClassifierRequest("", new Dictionary -{ - ["key"] = new ClassifierDocumentTypeDetails() -}); -Operation operation = await client.BuildClassifierAsync(WaitUntil.Completed, buildRequest); -DocumentClassifierDetails responseData = operation.Value; -]]> -This sample shows how to call BuildClassifierAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -BuildDocumentClassifierRequest buildRequest = new BuildDocumentClassifierRequest("", new Dictionary -{ - ["key"] = new ClassifierDocumentTypeDetails - { - SourceKind = ContentSourceKind.Url, - AzureBlobSource = new AzureBlobContentSource(new Uri("http://localhost:3000")) - { - Prefix = "", - }, - AzureBlobFileListSource = new AzureBlobFileListContentSource(new Uri("http://localhost:3000"), ""), - } -}) -{ - Description = "", -}; -Operation operation = await client.BuildClassifierAsync(WaitUntil.Completed, buildRequest); -DocumentClassifierDetails responseData = operation.Value; -]]> - - - -This sample shows how to call BuildClassifier. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -BuildDocumentClassifierRequest buildRequest = new BuildDocumentClassifierRequest("", new Dictionary -{ - ["key"] = new ClassifierDocumentTypeDetails() -}); -Operation operation = client.BuildClassifier(WaitUntil.Completed, buildRequest); -DocumentClassifierDetails responseData = operation.Value; -]]> -This sample shows how to call BuildClassifier with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -BuildDocumentClassifierRequest buildRequest = new BuildDocumentClassifierRequest("", new Dictionary -{ - ["key"] = new ClassifierDocumentTypeDetails - { - SourceKind = ContentSourceKind.Url, - AzureBlobSource = new AzureBlobContentSource(new Uri("http://localhost:3000")) - { - Prefix = "", - }, - AzureBlobFileListSource = new AzureBlobFileListContentSource(new Uri("http://localhost:3000"), ""), - } -}) -{ - Description = "", -}; -Operation operation = client.BuildClassifier(WaitUntil.Completed, buildRequest); -DocumentClassifierDetails responseData = operation.Value; -]]> - - - -This sample shows how to call BuildClassifierAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new -{ - classifierId = "", - docTypes = new - { - key = new object(), - }, -}); -Operation operation = await client.BuildClassifierAsync(WaitUntil.Completed, content); -BinaryData responseData = operation.Value; - -JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("classifierId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("apiVersion").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").ToString()); -]]> -This sample shows how to call BuildClassifierAsync with all parameters and request content and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new -{ - classifierId = "", - description = "", - docTypes = new - { - key = new - { - sourceKind = "url", - azureBlobSource = new - { - containerUrl = "http://localhost:3000", - prefix = "", - }, - azureBlobFileListSource = new - { - containerUrl = "http://localhost:3000", - fileList = "", - }, - }, - }, -}); -Operation operation = await client.BuildClassifierAsync(WaitUntil.Completed, content); -BinaryData responseData = operation.Value; - -JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("classifierId").ToString()); -Console.WriteLine(result.GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("apiVersion").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("sourceKind").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("azureBlobSource").GetProperty("containerUrl").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("azureBlobSource").GetProperty("prefix").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("azureBlobFileListSource").GetProperty("containerUrl").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("azureBlobFileListSource").GetProperty("fileList").ToString()); -]]> - - - -This sample shows how to call BuildClassifier and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new -{ - classifierId = "", - docTypes = new - { - key = new object(), - }, -}); -Operation operation = client.BuildClassifier(WaitUntil.Completed, content); -BinaryData responseData = operation.Value; - -JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("classifierId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("apiVersion").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").ToString()); -]]> -This sample shows how to call BuildClassifier with all parameters and request content and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new -{ - classifierId = "", - description = "", - docTypes = new - { - key = new - { - sourceKind = "url", - azureBlobSource = new - { - containerUrl = "http://localhost:3000", - prefix = "", - }, - azureBlobFileListSource = new - { - containerUrl = "http://localhost:3000", - fileList = "", - }, - }, - }, -}); -Operation operation = client.BuildClassifier(WaitUntil.Completed, content); -BinaryData responseData = operation.Value; - -JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("classifierId").ToString()); -Console.WriteLine(result.GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("apiVersion").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("sourceKind").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("azureBlobSource").GetProperty("containerUrl").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("azureBlobSource").GetProperty("prefix").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("azureBlobFileListSource").GetProperty("containerUrl").ToString()); -Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("azureBlobFileListSource").GetProperty("fileList").ToString()); -]]> - - - \ No newline at end of file diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentAnalysisClient.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentAnalysisClient.cs deleted file mode 100644 index 345898891d9b..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentAnalysisClient.cs +++ /dev/null @@ -1,465 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace Azure.AI.DocumentIntelligence -{ - // Data plane generated client. - /// The DocumentAnalysis service client. - public partial class DocumentAnalysisClient - { - private const string AuthorizationHeader = "Ocp-Apim-Subscription-Key"; - private readonly AzureKeyCredential _keyCredential; - private static readonly string[] AuthorizationScopes = new string[] { "https://cognitiveservices.azure.com/.default" }; - private readonly TokenCredential _tokenCredential; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// The ClientDiagnostics is used to provide tracing support for the client library. - internal ClientDiagnostics ClientDiagnostics { get; } - - /// The HTTP pipeline for sending and receiving REST requests and responses. - public virtual HttpPipeline Pipeline => _pipeline; - - /// Initializes a new instance of DocumentAnalysisClient for mocking. - protected DocumentAnalysisClient() - { - } - - /// Initializes a new instance of DocumentAnalysisClient. - /// The Document Intelligence service endpoint. - /// A credential used to authenticate to an Azure Service. - /// or is null. - public DocumentAnalysisClient(Uri endpoint, AzureKeyCredential credential) : this(endpoint, credential, new AzureAIDocumentIntelligenceClientOptions()) - { - } - - /// Initializes a new instance of DocumentAnalysisClient. - /// The Document Intelligence service endpoint. - /// A credential used to authenticate to an Azure Service. - /// or is null. - public DocumentAnalysisClient(Uri endpoint, TokenCredential credential) : this(endpoint, credential, new AzureAIDocumentIntelligenceClientOptions()) - { - } - - /// Initializes a new instance of DocumentAnalysisClient. - /// The Document Intelligence service endpoint. - /// A credential used to authenticate to an Azure Service. - /// The options for configuring the client. - /// or is null. - public DocumentAnalysisClient(Uri endpoint, AzureKeyCredential credential, AzureAIDocumentIntelligenceClientOptions options) - { - Argument.AssertNotNull(endpoint, nameof(endpoint)); - Argument.AssertNotNull(credential, nameof(credential)); - options ??= new AzureAIDocumentIntelligenceClientOptions(); - - ClientDiagnostics = new ClientDiagnostics(options, true); - _keyCredential = credential; - _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new AzureKeyCredentialPolicy(_keyCredential, AuthorizationHeader) }, new ResponseClassifier()); - _endpoint = endpoint; - _apiVersion = options.Version; - } - - /// Initializes a new instance of DocumentAnalysisClient. - /// The Document Intelligence service endpoint. - /// A credential used to authenticate to an Azure Service. - /// The options for configuring the client. - /// or is null. - public DocumentAnalysisClient(Uri endpoint, TokenCredential credential, AzureAIDocumentIntelligenceClientOptions options) - { - Argument.AssertNotNull(endpoint, nameof(endpoint)); - Argument.AssertNotNull(credential, nameof(credential)); - options ??= new AzureAIDocumentIntelligenceClientOptions(); - - ClientDiagnostics = new ClientDiagnostics(options, true); - _tokenCredential = credential; - _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new BearerTokenAuthenticationPolicy(_tokenCredential, AuthorizationScopes) }, new ResponseClassifier()); - _endpoint = endpoint; - _apiVersion = options.Version; - } - - /// Analyzes document with document model. - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Unique document model name. - /// Analyze request parameters. - /// List of 1-based page numbers to analyze. Ex. "1-3,5,7-9". - /// - /// Locale hint for text recognition and document analysis. Value may contain only - /// the language code (ex. "en", "fr") or BCP 47 language tag (ex. "en-US"). - /// - /// Method used to compute string offset and length. - /// List of optional analysis features. - /// List of additional fields to extract. Ex. "NumberOfGuests,StoreNumber". - /// Format of the analyze result top-level content. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual async Task> AnalyzeDocumentAsync(WaitUntil waitUntil, string modelId, AnalyzeDocumentRequest analyzeRequest = null, string pages = null, string locale = null, StringIndexType? stringIndexType = null, IEnumerable features = null, IEnumerable queryFields = null, ContentFormat? outputContentFormat = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(modelId, nameof(modelId)); - - RequestContext context = FromCancellationToken(cancellationToken); - using RequestContent content = analyzeRequest?.ToRequestContent(); - Operation response = await AnalyzeDocumentAsync(waitUntil, modelId, content, pages, locale, stringIndexType?.ToString(), features, queryFields, outputContentFormat?.ToString(), context).ConfigureAwait(false); - return ProtocolOperationHelpers.Convert(response, AnalyzeResult.FromResponse, ClientDiagnostics, "DocumentAnalysisClient.AnalyzeDocument"); - } - - /// Analyzes document with document model. - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Unique document model name. - /// Analyze request parameters. - /// List of 1-based page numbers to analyze. Ex. "1-3,5,7-9". - /// - /// Locale hint for text recognition and document analysis. Value may contain only - /// the language code (ex. "en", "fr") or BCP 47 language tag (ex. "en-US"). - /// - /// Method used to compute string offset and length. - /// List of optional analysis features. - /// List of additional fields to extract. Ex. "NumberOfGuests,StoreNumber". - /// Format of the analyze result top-level content. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual Operation AnalyzeDocument(WaitUntil waitUntil, string modelId, AnalyzeDocumentRequest analyzeRequest = null, string pages = null, string locale = null, StringIndexType? stringIndexType = null, IEnumerable features = null, IEnumerable queryFields = null, ContentFormat? outputContentFormat = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(modelId, nameof(modelId)); - - RequestContext context = FromCancellationToken(cancellationToken); - using RequestContent content = analyzeRequest?.ToRequestContent(); - Operation response = AnalyzeDocument(waitUntil, modelId, content, pages, locale, stringIndexType?.ToString(), features, queryFields, outputContentFormat?.ToString(), context); - return ProtocolOperationHelpers.Convert(response, AnalyzeResult.FromResponse, ClientDiagnostics, "DocumentAnalysisClient.AnalyzeDocument"); - } - - /// - /// [Protocol Method] Analyzes document with document model. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Unique document model name. - /// The content to send as the body of the request. - /// List of 1-based page numbers to analyze. Ex. "1-3,5,7-9". - /// - /// Locale hint for text recognition and document analysis. Value may contain only - /// the language code (ex. "en", "fr") or BCP 47 language tag (ex. "en-US"). - /// - /// Method used to compute string offset and length. Allowed values: "textElements" | "unicodeCodePoint" | "utf16CodeUnit". - /// List of optional analysis features. - /// List of additional fields to extract. Ex. "NumberOfGuests,StoreNumber". - /// Format of the analyze result top-level content. Allowed values: "text" | "markdown". - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual async Task> AnalyzeDocumentAsync(WaitUntil waitUntil, string modelId, RequestContent content, string pages = null, string locale = null, string stringIndexType = null, IEnumerable features = null, IEnumerable queryFields = null, string outputContentFormat = null, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(modelId, nameof(modelId)); - - using var scope = ClientDiagnostics.CreateScope("DocumentAnalysisClient.AnalyzeDocument"); - scope.Start(); - try - { - using HttpMessage message = CreateAnalyzeDocumentRequest(modelId, content, pages, locale, stringIndexType, features, queryFields, outputContentFormat, context); - return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "DocumentAnalysisClient.AnalyzeDocument", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Analyzes document with document model. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Unique document model name. - /// The content to send as the body of the request. - /// List of 1-based page numbers to analyze. Ex. "1-3,5,7-9". - /// - /// Locale hint for text recognition and document analysis. Value may contain only - /// the language code (ex. "en", "fr") or BCP 47 language tag (ex. "en-US"). - /// - /// Method used to compute string offset and length. Allowed values: "textElements" | "unicodeCodePoint" | "utf16CodeUnit". - /// List of optional analysis features. - /// List of additional fields to extract. Ex. "NumberOfGuests,StoreNumber". - /// Format of the analyze result top-level content. Allowed values: "text" | "markdown". - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual Operation AnalyzeDocument(WaitUntil waitUntil, string modelId, RequestContent content, string pages = null, string locale = null, string stringIndexType = null, IEnumerable features = null, IEnumerable queryFields = null, string outputContentFormat = null, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(modelId, nameof(modelId)); - - using var scope = ClientDiagnostics.CreateScope("DocumentAnalysisClient.AnalyzeDocument"); - scope.Start(); - try - { - using HttpMessage message = CreateAnalyzeDocumentRequest(modelId, content, pages, locale, stringIndexType, features, queryFields, outputContentFormat, context); - return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "DocumentAnalysisClient.AnalyzeDocument", OperationFinalStateVia.OperationLocation, context, waitUntil); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Classifies document with document classifier. - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Unique document classifier name. - /// Classify request parameters. - /// Method used to compute string offset and length. - /// Document splitting mode. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual async Task> ClassifyDocumentAsync(WaitUntil waitUntil, string classifierId, ClassifyDocumentRequest classifyRequest, StringIndexType? stringIndexType = null, SplitMode? split = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(classifierId, nameof(classifierId)); - Argument.AssertNotNull(classifyRequest, nameof(classifyRequest)); - - RequestContext context = FromCancellationToken(cancellationToken); - using RequestContent content = classifyRequest.ToRequestContent(); - Operation response = await ClassifyDocumentAsync(waitUntil, classifierId, content, stringIndexType?.ToString(), split?.ToString(), context).ConfigureAwait(false); - return ProtocolOperationHelpers.Convert(response, AnalyzeResult.FromResponse, ClientDiagnostics, "DocumentAnalysisClient.ClassifyDocument"); - } - - /// Classifies document with document classifier. - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Unique document classifier name. - /// Classify request parameters. - /// Method used to compute string offset and length. - /// Document splitting mode. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual Operation ClassifyDocument(WaitUntil waitUntil, string classifierId, ClassifyDocumentRequest classifyRequest, StringIndexType? stringIndexType = null, SplitMode? split = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(classifierId, nameof(classifierId)); - Argument.AssertNotNull(classifyRequest, nameof(classifyRequest)); - - RequestContext context = FromCancellationToken(cancellationToken); - using RequestContent content = classifyRequest.ToRequestContent(); - Operation response = ClassifyDocument(waitUntil, classifierId, content, stringIndexType?.ToString(), split?.ToString(), context); - return ProtocolOperationHelpers.Convert(response, AnalyzeResult.FromResponse, ClientDiagnostics, "DocumentAnalysisClient.ClassifyDocument"); - } - - /// - /// [Protocol Method] Classifies document with document classifier. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Unique document classifier name. - /// The content to send as the body of the request. - /// Method used to compute string offset and length. Allowed values: "textElements" | "unicodeCodePoint" | "utf16CodeUnit". - /// Document splitting mode. Allowed values: "auto" | "none" | "perPage". - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual async Task> ClassifyDocumentAsync(WaitUntil waitUntil, string classifierId, RequestContent content, string stringIndexType = null, string split = null, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(classifierId, nameof(classifierId)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("DocumentAnalysisClient.ClassifyDocument"); - scope.Start(); - try - { - using HttpMessage message = CreateClassifyDocumentRequest(classifierId, content, stringIndexType, split, context); - return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "DocumentAnalysisClient.ClassifyDocument", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Classifies document with document classifier. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Unique document classifier name. - /// The content to send as the body of the request. - /// Method used to compute string offset and length. Allowed values: "textElements" | "unicodeCodePoint" | "utf16CodeUnit". - /// Document splitting mode. Allowed values: "auto" | "none" | "perPage". - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual Operation ClassifyDocument(WaitUntil waitUntil, string classifierId, RequestContent content, string stringIndexType = null, string split = null, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(classifierId, nameof(classifierId)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("DocumentAnalysisClient.ClassifyDocument"); - scope.Start(); - try - { - using HttpMessage message = CreateClassifyDocumentRequest(classifierId, content, stringIndexType, split, context); - return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "DocumentAnalysisClient.ClassifyDocument", OperationFinalStateVia.OperationLocation, context, waitUntil); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - internal HttpMessage CreateAnalyzeDocumentRequest(string modelId, RequestContent content, string pages, string locale, string stringIndexType, IEnumerable features, IEnumerable queryFields, string outputContentFormat, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier202); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/documentintelligence", false); - uri.AppendPath("/documentModels/", false); - uri.AppendPath(modelId, true); - uri.AppendPath(":analyze", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (pages != null) - { - uri.AppendQuery("pages", pages, true); - } - if (locale != null) - { - uri.AppendQuery("locale", locale, true); - } - if (stringIndexType != null) - { - uri.AppendQuery("stringIndexType", stringIndexType, true); - } - if (features != null && Optional.IsCollectionDefined(features)) - { - uri.AppendQueryDelimited("features", features, ",", true); - } - if (queryFields != null && Optional.IsCollectionDefined(queryFields)) - { - uri.AppendQueryDelimited("queryFields", queryFields, ",", true); - } - if (outputContentFormat != null) - { - uri.AppendQuery("outputContentFormat", outputContentFormat, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("content-type", "application/json"); - request.Content = content; - return message; - } - - internal HttpMessage CreateClassifyDocumentRequest(string classifierId, RequestContent content, string stringIndexType, string split, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier202); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/documentintelligence", false); - uri.AppendPath("/documentClassifiers/", false); - uri.AppendPath(classifierId, true); - uri.AppendPath(":analyze", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (stringIndexType != null) - { - uri.AppendQuery("stringIndexType", stringIndexType, true); - } - if (split != null) - { - uri.AppendQuery("split", split, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("content-type", "application/json"); - request.Content = content; - return message; - } - - private static RequestContext DefaultRequestContext = new RequestContext(); - internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default) - { - if (!cancellationToken.CanBeCanceled) - { - return DefaultRequestContext; - } - - return new RequestContext() { CancellationToken = cancellationToken }; - } - - private static ResponseClassifier _responseClassifier202; - private static ResponseClassifier ResponseClassifier202 => _responseClassifier202 ??= new StatusCodeClassifier(stackalloc ushort[] { 202 }); - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentAnalysisFeature.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentAnalysisFeature.cs deleted file mode 100644 index 1944a783a071..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentAnalysisFeature.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.AI.DocumentIntelligence -{ - /// Document analysis features to enable. - public readonly partial struct DocumentAnalysisFeature : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public DocumentAnalysisFeature(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string OcrHighResolutionValue = "ocrHighResolution"; - private const string LanguagesValue = "languages"; - private const string BarcodesValue = "barcodes"; - private const string FormulasValue = "formulas"; - private const string KeyValuePairsValue = "keyValuePairs"; - private const string StyleFontValue = "styleFont"; - private const string QueryFieldsValue = "queryFields"; - - /// Perform OCR at a higher resolution to handle documents with fine print. - public static DocumentAnalysisFeature OcrHighResolution { get; } = new DocumentAnalysisFeature(OcrHighResolutionValue); - /// Enable the detection of the text content language. - public static DocumentAnalysisFeature Languages { get; } = new DocumentAnalysisFeature(LanguagesValue); - /// Enable the detection of barcodes in the document. - public static DocumentAnalysisFeature Barcodes { get; } = new DocumentAnalysisFeature(BarcodesValue); - /// Enable the detection of mathematical expressions in the document. - public static DocumentAnalysisFeature Formulas { get; } = new DocumentAnalysisFeature(FormulasValue); - /// Enable the detection of general key value pairs (form fields) in the document. - public static DocumentAnalysisFeature KeyValuePairs { get; } = new DocumentAnalysisFeature(KeyValuePairsValue); - /// Enable the recognition of various font styles. - public static DocumentAnalysisFeature StyleFont { get; } = new DocumentAnalysisFeature(StyleFontValue); - /// Enable the extraction of additional fields via the queryFields query parameter. - public static DocumentAnalysisFeature QueryFields { get; } = new DocumentAnalysisFeature(QueryFieldsValue); - /// Determines if two values are the same. - public static bool operator ==(DocumentAnalysisFeature left, DocumentAnalysisFeature right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(DocumentAnalysisFeature left, DocumentAnalysisFeature right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator DocumentAnalysisFeature(string value) => new DocumentAnalysisFeature(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is DocumentAnalysisFeature other && Equals(other); - /// - public bool Equals(DocumentAnalysisFeature 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/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentBarcode.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentBarcode.Serialization.cs deleted file mode 100644 index e5cdd935d6a3..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentBarcode.Serialization.cs +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class DocumentBarcode - { - internal static DocumentBarcode DeserializeDocumentBarcode(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - DocumentBarcodeKind kind = default; - string value = default; - Optional> polygon = default; - DocumentSpan span = default; - float confidence = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("kind"u8)) - { - kind = new DocumentBarcodeKind(property.Value.GetString()); - continue; - } - if (property.NameEquals("value"u8)) - { - value = property.Value.GetString(); - continue; - } - if (property.NameEquals("polygon"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetSingle()); - } - polygon = array; - continue; - } - if (property.NameEquals("span"u8)) - { - span = DocumentSpan.DeserializeDocumentSpan(property.Value); - continue; - } - if (property.NameEquals("confidence"u8)) - { - confidence = property.Value.GetSingle(); - continue; - } - } - return new DocumentBarcode(kind, value, Optional.ToList(polygon), span, confidence); - } - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static DocumentBarcode FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeDocumentBarcode(document.RootElement); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentBarcode.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentBarcode.cs deleted file mode 100644 index 280be43975e1..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentBarcode.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - /// A barcode object. - public partial class DocumentBarcode - { - /// Initializes a new instance of DocumentBarcode. - /// Barcode kind. - /// Barcode value. - /// Location of the barcode in the reading order concatenated content. - /// Confidence of correctly extracting the barcode. - /// or is null. - internal DocumentBarcode(DocumentBarcodeKind kind, string value, DocumentSpan span, float confidence) - { - Argument.AssertNotNull(value, nameof(value)); - Argument.AssertNotNull(span, nameof(span)); - - Kind = kind; - Value = value; - Polygon = new ChangeTrackingList(); - Span = span; - Confidence = confidence; - } - - /// Initializes a new instance of DocumentBarcode. - /// Barcode kind. - /// Barcode value. - /// - /// Bounding polygon of the barcode, with coordinates specified relative to the - /// top-left of the page. The numbers represent the x, y values of the polygon - /// vertices, clockwise from the left (-180 degrees inclusive) relative to the - /// element orientation. - /// - /// Location of the barcode in the reading order concatenated content. - /// Confidence of correctly extracting the barcode. - internal DocumentBarcode(DocumentBarcodeKind kind, string value, IReadOnlyList polygon, DocumentSpan span, float confidence) - { - Kind = kind; - Value = value; - Polygon = polygon; - Span = span; - Confidence = confidence; - } - - /// Barcode kind. - public DocumentBarcodeKind Kind { get; } - /// Barcode value. - public string Value { get; } - /// - /// Bounding polygon of the barcode, with coordinates specified relative to the - /// top-left of the page. The numbers represent the x, y values of the polygon - /// vertices, clockwise from the left (-180 degrees inclusive) relative to the - /// element orientation. - /// - public IReadOnlyList Polygon { get; } - /// Location of the barcode in the reading order concatenated content. - public DocumentSpan Span { get; } - /// Confidence of correctly extracting the barcode. - public float Confidence { get; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentBarcodeKind.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentBarcodeKind.cs deleted file mode 100644 index d3a6308fe9ed..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentBarcodeKind.cs +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.AI.DocumentIntelligence -{ - /// Barcode kind. - public readonly partial struct DocumentBarcodeKind : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public DocumentBarcodeKind(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string QRCodeValue = "QRCode"; - private const string PDF417Value = "PDF417"; - private const string UPCAValue = "UPCA"; - private const string UPCEValue = "UPCE"; - private const string Code39Value = "Code39"; - private const string Code128Value = "Code128"; - private const string EAN8Value = "EAN8"; - private const string EAN13Value = "EAN13"; - private const string DataBarValue = "DataBar"; - private const string Code93Value = "Code93"; - private const string CodabarValue = "Codabar"; - private const string DataBarExpandedValue = "DataBarExpanded"; - private const string ITFValue = "ITF"; - private const string MicroQRCodeValue = "MicroQRCode"; - private const string AztecValue = "Aztec"; - private const string DataMatrixValue = "DataMatrix"; - private const string MaxiCodeValue = "MaxiCode"; - - /// QR code, as defined in ISO/IEC 18004:2015. - public static DocumentBarcodeKind QRCode { get; } = new DocumentBarcodeKind(QRCodeValue); - /// PDF417, as defined in ISO 15438. - public static DocumentBarcodeKind PDF417 { get; } = new DocumentBarcodeKind(PDF417Value); - /// GS1 12-digit Universal Product Code. - public static DocumentBarcodeKind UPCA { get; } = new DocumentBarcodeKind(UPCAValue); - /// GS1 6-digit Universal Product Code. - public static DocumentBarcodeKind UPCE { get; } = new DocumentBarcodeKind(UPCEValue); - /// Code 39 barcode, as defined in ISO/IEC 16388:2007. - public static DocumentBarcodeKind Code39 { get; } = new DocumentBarcodeKind(Code39Value); - /// Code 128 barcode, as defined in ISO/IEC 15417:2007. - public static DocumentBarcodeKind Code128 { get; } = new DocumentBarcodeKind(Code128Value); - /// GS1 8-digit International Article Number (European Article Number). - public static DocumentBarcodeKind EAN8 { get; } = new DocumentBarcodeKind(EAN8Value); - /// GS1 13-digit International Article Number (European Article Number). - public static DocumentBarcodeKind EAN13 { get; } = new DocumentBarcodeKind(EAN13Value); - /// GS1 DataBar barcode. - public static DocumentBarcodeKind DataBar { get; } = new DocumentBarcodeKind(DataBarValue); - /// Code 93 barcode, as defined in ANSI/AIM BC5-1995. - public static DocumentBarcodeKind Code93 { get; } = new DocumentBarcodeKind(Code93Value); - /// Codabar barcode, as defined in ANSI/AIM BC3-1995. - public static DocumentBarcodeKind Codabar { get; } = new DocumentBarcodeKind(CodabarValue); - /// GS1 DataBar Expanded barcode. - public static DocumentBarcodeKind DataBarExpanded { get; } = new DocumentBarcodeKind(DataBarExpandedValue); - /// Interleaved 2 of 5 barcode, as defined in ANSI/AIM BC2-1995. - public static DocumentBarcodeKind ITF { get; } = new DocumentBarcodeKind(ITFValue); - /// Micro QR code, as defined in ISO/IEC 23941:2022. - public static DocumentBarcodeKind MicroQRCode { get; } = new DocumentBarcodeKind(MicroQRCodeValue); - /// Aztec code, as defined in ISO/IEC 24778:2008. - public static DocumentBarcodeKind Aztec { get; } = new DocumentBarcodeKind(AztecValue); - /// Data matrix code, as defined in ISO/IEC 16022:2006. - public static DocumentBarcodeKind DataMatrix { get; } = new DocumentBarcodeKind(DataMatrixValue); - /// MaxiCode, as defined in ISO/IEC 16023:2000. - public static DocumentBarcodeKind MaxiCode { get; } = new DocumentBarcodeKind(MaxiCodeValue); - /// Determines if two values are the same. - public static bool operator ==(DocumentBarcodeKind left, DocumentBarcodeKind right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(DocumentBarcodeKind left, DocumentBarcodeKind right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator DocumentBarcodeKind(string value) => new DocumentBarcodeKind(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is DocumentBarcodeKind other && Equals(other); - /// - public bool Equals(DocumentBarcodeKind 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/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentBuildMode.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentBuildMode.cs deleted file mode 100644 index 022f985c53d8..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentBuildMode.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.AI.DocumentIntelligence -{ - /// Custom document model build mode. - public readonly partial struct DocumentBuildMode : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public DocumentBuildMode(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string TemplateValue = "template"; - private const string NeuralValue = "neural"; - - /// Target documents with similar visual templates. - public static DocumentBuildMode Template { get; } = new DocumentBuildMode(TemplateValue); - /// Support documents with diverse visual templates. - public static DocumentBuildMode Neural { get; } = new DocumentBuildMode(NeuralValue); - /// Determines if two values are the same. - public static bool operator ==(DocumentBuildMode left, DocumentBuildMode right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(DocumentBuildMode left, DocumentBuildMode right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator DocumentBuildMode(string value) => new DocumentBuildMode(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is DocumentBuildMode other && Equals(other); - /// - public bool Equals(DocumentBuildMode 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/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentCaption.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentCaption.Serialization.cs deleted file mode 100644 index c061a2510a6d..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentCaption.Serialization.cs +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class DocumentCaption - { - internal static DocumentCaption DeserializeDocumentCaption(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string content = default; - Optional> boundingRegions = default; - IReadOnlyList spans = default; - Optional> elements = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("content"u8)) - { - content = property.Value.GetString(); - continue; - } - if (property.NameEquals("boundingRegions"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(BoundingRegion.DeserializeBoundingRegion(item)); - } - boundingRegions = array; - continue; - } - if (property.NameEquals("spans"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DocumentSpan.DeserializeDocumentSpan(item)); - } - spans = array; - continue; - } - if (property.NameEquals("elements"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - elements = array; - continue; - } - } - return new DocumentCaption(content, Optional.ToList(boundingRegions), spans, Optional.ToList(elements)); - } - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static DocumentCaption FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeDocumentCaption(document.RootElement); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentCaption.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentCaption.cs deleted file mode 100644 index 365b0a0eafec..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentCaption.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - /// A caption object describing a table or figure. - public partial class DocumentCaption - { - /// Initializes a new instance of DocumentCaption. - /// Content of the caption. - /// Location of the caption in the reading order concatenated content. - /// or is null. - internal DocumentCaption(string content, IEnumerable spans) - { - Argument.AssertNotNull(content, nameof(content)); - Argument.AssertNotNull(spans, nameof(spans)); - - Content = content; - BoundingRegions = new ChangeTrackingList(); - Spans = spans.ToList(); - Elements = new ChangeTrackingList(); - } - - /// Initializes a new instance of DocumentCaption. - /// Content of the caption. - /// Bounding regions covering the caption. - /// Location of the caption in the reading order concatenated content. - /// Child elements of the caption. - internal DocumentCaption(string content, IReadOnlyList boundingRegions, IReadOnlyList spans, IReadOnlyList elements) - { - Content = content; - BoundingRegions = boundingRegions; - Spans = spans; - Elements = elements; - } - - /// Content of the caption. - public string Content { get; } - /// Bounding regions covering the caption. - public IReadOnlyList BoundingRegions { get; } - /// Location of the caption in the reading order concatenated content. - public IReadOnlyList Spans { get; } - /// Child elements of the caption. - public IReadOnlyList Elements { get; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentClassifierBuildOperationDetails.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentClassifierBuildOperationDetails.Serialization.cs deleted file mode 100644 index a132bd348976..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentClassifierBuildOperationDetails.Serialization.cs +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class DocumentClassifierBuildOperationDetails - { - internal static DocumentClassifierBuildOperationDetails DeserializeDocumentClassifierBuildOperationDetails(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional result = default; - Guid operationId = default; - OperationStatus status = default; - Optional percentCompleted = default; - DateTimeOffset createdDateTime = default; - DateTimeOffset lastUpdatedDateTime = default; - OperationKind kind = default; - Uri resourceLocation = default; - Optional apiVersion = default; - Optional> tags = default; - Optional error = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("result"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - result = DocumentClassifierDetails.DeserializeDocumentClassifierDetails(property.Value); - continue; - } - if (property.NameEquals("operationId"u8)) - { - operationId = property.Value.GetGuid(); - continue; - } - if (property.NameEquals("status"u8)) - { - status = new OperationStatus(property.Value.GetString()); - continue; - } - if (property.NameEquals("percentCompleted"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - percentCompleted = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("createdDateTime"u8)) - { - createdDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("lastUpdatedDateTime"u8)) - { - lastUpdatedDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("kind"u8)) - { - kind = new OperationKind(property.Value.GetString()); - continue; - } - if (property.NameEquals("resourceLocation"u8)) - { - resourceLocation = new Uri(property.Value.GetString()); - continue; - } - if (property.NameEquals("apiVersion"u8)) - { - apiVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("error"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - error = DocumentIntelligenceError.DeserializeDocumentIntelligenceError(property.Value); - continue; - } - } - return new DocumentClassifierBuildOperationDetails(operationId, status, Optional.ToNullable(percentCompleted), createdDateTime, lastUpdatedDateTime, kind, resourceLocation, apiVersion.Value, Optional.ToDictionary(tags), error.Value, result.Value); - } - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new DocumentClassifierBuildOperationDetails FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeDocumentClassifierBuildOperationDetails(document.RootElement); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentClassifierBuildOperationDetails.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentClassifierBuildOperationDetails.cs deleted file mode 100644 index 4e7234633ea0..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentClassifierBuildOperationDetails.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - /// Get Operation response object. - public partial class DocumentClassifierBuildOperationDetails : OperationDetails - { - /// Initializes a new instance of DocumentClassifierBuildOperationDetails. - /// Operation ID. - /// Operation status. - /// Date and time (UTC) when the operation was created. - /// Date and time (UTC) when the status was last updated. - /// URL of the resource targeted by this operation. - /// is null. - internal DocumentClassifierBuildOperationDetails(Guid operationId, OperationStatus status, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, Uri resourceLocation) : base(operationId, status, createdDateTime, lastUpdatedDateTime, resourceLocation) - { - Argument.AssertNotNull(resourceLocation, nameof(resourceLocation)); - - Kind = OperationKind.DocumentClassifierBuild; - } - - /// Initializes a new instance of DocumentClassifierBuildOperationDetails. - /// Operation ID. - /// Operation status. - /// Operation progress (0-100). - /// Date and time (UTC) when the operation was created. - /// Date and time (UTC) when the status was last updated. - /// Type of operation. - /// URL of the resource targeted by this operation. - /// API version used to create this operation. - /// List of key-value tag attributes associated with the document model. - /// Encountered error. - /// Operation result upon success. - internal DocumentClassifierBuildOperationDetails(Guid operationId, OperationStatus status, int? percentCompleted, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, OperationKind kind, Uri resourceLocation, string apiVersion, IReadOnlyDictionary tags, DocumentIntelligenceError error, DocumentClassifierDetails result) : base(operationId, status, percentCompleted, createdDateTime, lastUpdatedDateTime, kind, resourceLocation, apiVersion, tags, error) - { - Result = result; - } - - /// Operation result upon success. - public DocumentClassifierDetails Result { get; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentClassifierDetails.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentClassifierDetails.Serialization.cs deleted file mode 100644 index f54177b4d68b..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentClassifierDetails.Serialization.cs +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class DocumentClassifierDetails - { - internal static DocumentClassifierDetails DeserializeDocumentClassifierDetails(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string classifierId = default; - Optional description = default; - DateTimeOffset createdDateTime = default; - Optional expirationDateTime = default; - string apiVersion = default; - IReadOnlyDictionary docTypes = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("classifierId"u8)) - { - classifierId = property.Value.GetString(); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("createdDateTime"u8)) - { - createdDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("expirationDateTime"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - expirationDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("apiVersion"u8)) - { - apiVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("docTypes"u8)) - { - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, ClassifierDocumentTypeDetails.DeserializeClassifierDocumentTypeDetails(property0.Value)); - } - docTypes = dictionary; - continue; - } - } - return new DocumentClassifierDetails(classifierId, description.Value, createdDateTime, Optional.ToNullable(expirationDateTime), apiVersion, docTypes); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentClassifierDetails.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentClassifierDetails.cs deleted file mode 100644 index 13e7d04c7eae..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentClassifierDetails.cs +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - /// Document classifier info. - public partial class DocumentClassifierDetails - { - /// Initializes a new instance of DocumentClassifierDetails. - /// Unique document classifier name. - /// Date and time (UTC) when the document classifier was created. - /// API version used to create this document classifier. - /// List of document types to classify against. - /// , or is null. - internal DocumentClassifierDetails(string classifierId, DateTimeOffset createdDateTime, string apiVersion, IReadOnlyDictionary docTypes) - { - Argument.AssertNotNull(classifierId, nameof(classifierId)); - Argument.AssertNotNull(apiVersion, nameof(apiVersion)); - Argument.AssertNotNull(docTypes, nameof(docTypes)); - - ClassifierId = classifierId; - CreatedDateTime = createdDateTime; - ApiVersion = apiVersion; - DocTypes = docTypes; - } - - /// Initializes a new instance of DocumentClassifierDetails. - /// Unique document classifier name. - /// Document classifier description. - /// Date and time (UTC) when the document classifier was created. - /// Date and time (UTC) when the document classifier will expire. - /// API version used to create this document classifier. - /// List of document types to classify against. - internal DocumentClassifierDetails(string classifierId, string description, DateTimeOffset createdDateTime, DateTimeOffset? expirationDateTime, string apiVersion, IReadOnlyDictionary docTypes) - { - ClassifierId = classifierId; - Description = description; - CreatedDateTime = createdDateTime; - ExpirationDateTime = expirationDateTime; - ApiVersion = apiVersion; - DocTypes = docTypes; - } - - /// Unique document classifier name. - public string ClassifierId { get; } - /// Document classifier description. - public string Description { get; } - /// Date and time (UTC) when the document classifier was created. - public DateTimeOffset CreatedDateTime { get; } - /// Date and time (UTC) when the document classifier will expire. - public DateTimeOffset? ExpirationDateTime { get; } - /// API version used to create this document classifier. - public string ApiVersion { get; } - /// List of document types to classify against. - public IReadOnlyDictionary DocTypes { get; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentField.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentField.Serialization.cs deleted file mode 100644 index 07d66a393653..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentField.Serialization.cs +++ /dev/null @@ -1,228 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class DocumentField - { - internal static DocumentField DeserializeDocumentField(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - DocumentFieldType type = default; - Optional valueString = default; - Optional valueDate = default; - Optional valueTime = default; - Optional valuePhoneNumber = default; - Optional valueNumber = default; - Optional valueInteger = default; - Optional valueSelectionMark = default; - Optional valueSignature = default; - Optional valueCountryRegion = default; - Optional> valueArray = default; - Optional> valueObject = default; - Optional valueCurrency = default; - Optional valueAddress = default; - Optional valueBoolean = default; - Optional content = default; - Optional> boundingRegions = default; - Optional> spans = default; - Optional confidence = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("type"u8)) - { - type = new DocumentFieldType(property.Value.GetString()); - continue; - } - if (property.NameEquals("valueString"u8)) - { - valueString = property.Value.GetString(); - continue; - } - if (property.NameEquals("valueDate"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - valueDate = property.Value.GetDateTimeOffset("D"); - continue; - } - if (property.NameEquals("valueTime"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - valueTime = property.Value.GetTimeSpan("T"); - continue; - } - if (property.NameEquals("valuePhoneNumber"u8)) - { - valuePhoneNumber = property.Value.GetString(); - continue; - } - if (property.NameEquals("valueNumber"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - valueNumber = property.Value.GetDouble(); - continue; - } - if (property.NameEquals("valueInteger"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - valueInteger = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("valueSelectionMark"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - valueSelectionMark = new DocumentSelectionMarkState(property.Value.GetString()); - continue; - } - if (property.NameEquals("valueSignature"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - valueSignature = new DocumentSignatureType(property.Value.GetString()); - continue; - } - if (property.NameEquals("valueCountryRegion"u8)) - { - valueCountryRegion = property.Value.GetString(); - continue; - } - if (property.NameEquals("valueArray"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DeserializeDocumentField(item)); - } - valueArray = array; - continue; - } - if (property.NameEquals("valueObject"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, DeserializeDocumentField(property0.Value)); - } - valueObject = dictionary; - continue; - } - if (property.NameEquals("valueCurrency"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - valueCurrency = CurrencyValue.DeserializeCurrencyValue(property.Value); - continue; - } - if (property.NameEquals("valueAddress"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - valueAddress = AddressValue.DeserializeAddressValue(property.Value); - continue; - } - if (property.NameEquals("valueBoolean"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - valueBoolean = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("content"u8)) - { - content = property.Value.GetString(); - continue; - } - if (property.NameEquals("boundingRegions"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(BoundingRegion.DeserializeBoundingRegion(item)); - } - boundingRegions = array; - continue; - } - if (property.NameEquals("spans"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DocumentSpan.DeserializeDocumentSpan(item)); - } - spans = array; - continue; - } - if (property.NameEquals("confidence"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - confidence = property.Value.GetSingle(); - continue; - } - } - return new DocumentField(type, valueString.Value, Optional.ToNullable(valueDate), Optional.ToNullable(valueTime), valuePhoneNumber.Value, Optional.ToNullable(valueNumber), Optional.ToNullable(valueInteger), Optional.ToNullable(valueSelectionMark), Optional.ToNullable(valueSignature), valueCountryRegion.Value, Optional.ToList(valueArray), Optional.ToDictionary(valueObject), valueCurrency.Value, valueAddress.Value, Optional.ToNullable(valueBoolean), content.Value, Optional.ToList(boundingRegions), Optional.ToList(spans), Optional.ToNullable(confidence)); - } - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static DocumentField FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeDocumentField(document.RootElement); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentField.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentField.cs deleted file mode 100644 index b8ed03f8a698..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentField.cs +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - /// An object representing the content and location of a field value. - public partial class DocumentField - { - /// Initializes a new instance of DocumentField. - /// Data type of the field value. - internal DocumentField(DocumentFieldType type) - { - Type = type; - ValueArray = new ChangeTrackingList(); - ValueObject = new ChangeTrackingDictionary(); - BoundingRegions = new ChangeTrackingList(); - Spans = new ChangeTrackingList(); - } - - /// Initializes a new instance of DocumentField. - /// Data type of the field value. - /// String value. - /// Date value in YYYY-MM-DD format (ISO 8601). - /// Time value in hh:mm:ss format (ISO 8601). - /// Phone number value in E.164 format (ex. +19876543210). - /// Floating point value. - /// Integer value. - /// Selection mark value. - /// Presence of signature. - /// 3-letter country code value (ISO 3166-1 alpha-3). - /// Array of field values. - /// Dictionary of named field values. - /// Currency value. - /// Address value. - /// Boolean value. - /// Field content. - /// Bounding regions covering the field. - /// Location of the field in the reading order concatenated content. - /// Confidence of correctly extracting the field. - internal DocumentField(DocumentFieldType type, string valueString, DateTimeOffset? valueDate, TimeSpan? valueTime, string valuePhoneNumber, double? valueNumber, long? valueInteger, DocumentSelectionMarkState? valueSelectionMark, DocumentSignatureType? valueSignature, string valueCountryRegion, IReadOnlyList valueArray, IReadOnlyDictionary valueObject, CurrencyValue valueCurrency, AddressValue valueAddress, bool? valueBoolean, string content, IReadOnlyList boundingRegions, IReadOnlyList spans, float? confidence) - { - Type = type; - ValueString = valueString; - ValueDate = valueDate; - ValueTime = valueTime; - ValuePhoneNumber = valuePhoneNumber; - ValueNumber = valueNumber; - ValueInteger = valueInteger; - ValueSelectionMark = valueSelectionMark; - ValueSignature = valueSignature; - ValueCountryRegion = valueCountryRegion; - ValueArray = valueArray; - ValueObject = valueObject; - ValueCurrency = valueCurrency; - ValueAddress = valueAddress; - ValueBoolean = valueBoolean; - Content = content; - BoundingRegions = boundingRegions; - Spans = spans; - Confidence = confidence; - } - - /// Data type of the field value. - public DocumentFieldType Type { get; } - /// String value. - public string ValueString { get; } - /// Date value in YYYY-MM-DD format (ISO 8601). - public DateTimeOffset? ValueDate { get; } - /// Time value in hh:mm:ss format (ISO 8601). - public TimeSpan? ValueTime { get; } - /// Phone number value in E.164 format (ex. +19876543210). - public string ValuePhoneNumber { get; } - /// Floating point value. - public double? ValueNumber { get; } - /// Integer value. - public long? ValueInteger { get; } - /// Selection mark value. - public DocumentSelectionMarkState? ValueSelectionMark { get; } - /// Presence of signature. - public DocumentSignatureType? ValueSignature { get; } - /// 3-letter country code value (ISO 3166-1 alpha-3). - public string ValueCountryRegion { get; } - /// Array of field values. - public IReadOnlyList ValueArray { get; } - /// Dictionary of named field values. - public IReadOnlyDictionary ValueObject { get; } - /// Currency value. - public CurrencyValue ValueCurrency { get; } - /// Address value. - public AddressValue ValueAddress { get; } - /// Boolean value. - public bool? ValueBoolean { get; } - /// Field content. - public string Content { get; } - /// Bounding regions covering the field. - public IReadOnlyList BoundingRegions { get; } - /// Location of the field in the reading order concatenated content. - public IReadOnlyList Spans { get; } - /// Confidence of correctly extracting the field. - public float? Confidence { get; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFieldSchema.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFieldSchema.Serialization.cs deleted file mode 100644 index be1ec74243e8..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFieldSchema.Serialization.cs +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class DocumentFieldSchema - { - internal static DocumentFieldSchema DeserializeDocumentFieldSchema(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - DocumentFieldType type = default; - Optional description = default; - Optional example = default; - Optional items = default; - Optional> properties = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("type"u8)) - { - type = new DocumentFieldType(property.Value.GetString()); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("example"u8)) - { - example = property.Value.GetString(); - continue; - } - if (property.NameEquals("items"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - items = DeserializeDocumentFieldSchema(property.Value); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, DeserializeDocumentFieldSchema(property0.Value)); - } - properties = dictionary; - continue; - } - } - return new DocumentFieldSchema(type, description.Value, example.Value, items.Value, Optional.ToDictionary(properties)); - } - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static DocumentFieldSchema FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeDocumentFieldSchema(document.RootElement); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFieldSchema.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFieldSchema.cs deleted file mode 100644 index 2a147cffc0b1..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFieldSchema.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - /// Description of the field semantic schema using a JSON Schema style syntax. - public partial class DocumentFieldSchema - { - /// Initializes a new instance of DocumentFieldSchema. - /// Semantic data type of the field value. - internal DocumentFieldSchema(DocumentFieldType type) - { - Type = type; - Properties = new ChangeTrackingDictionary(); - } - - /// Initializes a new instance of DocumentFieldSchema. - /// Semantic data type of the field value. - /// Field description. - /// Example field content. - /// Field type schema of each array element. - /// Named sub-fields of the object field. - internal DocumentFieldSchema(DocumentFieldType type, string description, string example, DocumentFieldSchema items, IReadOnlyDictionary properties) - { - Type = type; - Description = description; - Example = example; - Items = items; - Properties = properties; - } - - /// Semantic data type of the field value. - public DocumentFieldType Type { get; } - /// Field description. - public string Description { get; } - /// Example field content. - public string Example { get; } - /// Field type schema of each array element. - public DocumentFieldSchema Items { get; } - /// Named sub-fields of the object field. - public IReadOnlyDictionary Properties { get; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFieldType.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFieldType.cs deleted file mode 100644 index 6bf22b891a88..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFieldType.cs +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.AI.DocumentIntelligence -{ - /// Semantic data type of the field value. - public readonly partial struct DocumentFieldType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public DocumentFieldType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string StringValue = "string"; - private const string DateValue = "date"; - private const string TimeValue = "time"; - private const string PhoneNumberValue = "phoneNumber"; - private const string NumberValue = "number"; - private const string IntegerValue = "integer"; - private const string SelectionMarkValue = "selectionMark"; - private const string CountryRegionValue = "countryRegion"; - private const string SignatureValue = "signature"; - private const string ArrayValue = "array"; - private const string ObjectValue = "object"; - private const string CurrencyValue = "currency"; - private const string AddressValue = "address"; - private const string BooleanValue = "boolean"; - - /// Plain text. - public static DocumentFieldType String { get; } = new DocumentFieldType(StringValue); - /// Date, normalized to ISO 8601 (YYYY-MM-DD) format. - public static DocumentFieldType Date { get; } = new DocumentFieldType(DateValue); - /// Time, normalized to ISO 8601 (hh:mm:ss) format. - public static DocumentFieldType Time { get; } = new DocumentFieldType(TimeValue); - /// Phone number, normalized to E.164 (+{CountryCode}{SubscriberNumber}) format. - public static DocumentFieldType PhoneNumber { get; } = new DocumentFieldType(PhoneNumberValue); - /// Floating point number, normalized to double precision floating point. - public static DocumentFieldType Number { get; } = new DocumentFieldType(NumberValue); - /// Integer number, normalized to 64-bit signed integer. - public static DocumentFieldType Integer { get; } = new DocumentFieldType(IntegerValue); - /// Is field selected?. - public static DocumentFieldType SelectionMark { get; } = new DocumentFieldType(SelectionMarkValue); - /// Country/region, normalized to ISO 3166-1 alpha-3 format (ex. USA). - public static DocumentFieldType CountryRegion { get; } = new DocumentFieldType(CountryRegionValue); - /// Is signature present?. - public static DocumentFieldType Signature { get; } = new DocumentFieldType(SignatureValue); - /// List of subfields of the same type. - public static DocumentFieldType Array { get; } = new DocumentFieldType(ArrayValue); - /// Named list of subfields of potentially different types. - public static DocumentFieldType Object { get; } = new DocumentFieldType(ObjectValue); - /// Currency amount with optional currency symbol and unit. - public static DocumentFieldType Currency { get; } = new DocumentFieldType(CurrencyValue); - /// Parsed address. - public static DocumentFieldType Address { get; } = new DocumentFieldType(AddressValue); - /// Boolean value, normalized to true or false. - public static DocumentFieldType Boolean { get; } = new DocumentFieldType(BooleanValue); - /// Determines if two values are the same. - public static bool operator ==(DocumentFieldType left, DocumentFieldType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(DocumentFieldType left, DocumentFieldType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator DocumentFieldType(string value) => new DocumentFieldType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is DocumentFieldType other && Equals(other); - /// - public bool Equals(DocumentFieldType 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/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFigure.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFigure.Serialization.cs deleted file mode 100644 index 5dec9412f9d8..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFigure.Serialization.cs +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class DocumentFigure - { - internal static DocumentFigure DeserializeDocumentFigure(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> boundingRegions = default; - IReadOnlyList spans = default; - Optional> elements = default; - Optional caption = default; - Optional> footnotes = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("boundingRegions"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(BoundingRegion.DeserializeBoundingRegion(item)); - } - boundingRegions = array; - continue; - } - if (property.NameEquals("spans"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DocumentSpan.DeserializeDocumentSpan(item)); - } - spans = array; - continue; - } - if (property.NameEquals("elements"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - elements = array; - continue; - } - if (property.NameEquals("caption"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - caption = DocumentCaption.DeserializeDocumentCaption(property.Value); - continue; - } - if (property.NameEquals("footnotes"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DocumentFootnote.DeserializeDocumentFootnote(item)); - } - footnotes = array; - continue; - } - } - return new DocumentFigure(Optional.ToList(boundingRegions), spans, Optional.ToList(elements), caption.Value, Optional.ToList(footnotes)); - } - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static DocumentFigure FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeDocumentFigure(document.RootElement); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFigure.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFigure.cs deleted file mode 100644 index d9deb591430e..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFigure.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - /// An object representing a figure in the document. - public partial class DocumentFigure - { - /// Initializes a new instance of DocumentFigure. - /// Location of the figure in the reading order concatenated content. - /// is null. - internal DocumentFigure(IEnumerable spans) - { - Argument.AssertNotNull(spans, nameof(spans)); - - BoundingRegions = new ChangeTrackingList(); - Spans = spans.ToList(); - Elements = new ChangeTrackingList(); - Footnotes = new ChangeTrackingList(); - } - - /// Initializes a new instance of DocumentFigure. - /// Bounding regions covering the figure. - /// Location of the figure in the reading order concatenated content. - /// Child elements of the figure, excluding any caption or footnotes. - /// Caption associated with the figure. - /// List of footnotes associated with the figure. - internal DocumentFigure(IReadOnlyList boundingRegions, IReadOnlyList spans, IReadOnlyList elements, DocumentCaption caption, IReadOnlyList footnotes) - { - BoundingRegions = boundingRegions; - Spans = spans; - Elements = elements; - Caption = caption; - Footnotes = footnotes; - } - - /// Bounding regions covering the figure. - public IReadOnlyList BoundingRegions { get; } - /// Location of the figure in the reading order concatenated content. - public IReadOnlyList Spans { get; } - /// Child elements of the figure, excluding any caption or footnotes. - public IReadOnlyList Elements { get; } - /// Caption associated with the figure. - public DocumentCaption Caption { get; } - /// List of footnotes associated with the figure. - public IReadOnlyList Footnotes { get; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFootnote.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFootnote.Serialization.cs deleted file mode 100644 index 782dd75e6736..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFootnote.Serialization.cs +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class DocumentFootnote - { - internal static DocumentFootnote DeserializeDocumentFootnote(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string content = default; - Optional> boundingRegions = default; - IReadOnlyList spans = default; - Optional> elements = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("content"u8)) - { - content = property.Value.GetString(); - continue; - } - if (property.NameEquals("boundingRegions"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(BoundingRegion.DeserializeBoundingRegion(item)); - } - boundingRegions = array; - continue; - } - if (property.NameEquals("spans"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DocumentSpan.DeserializeDocumentSpan(item)); - } - spans = array; - continue; - } - if (property.NameEquals("elements"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - elements = array; - continue; - } - } - return new DocumentFootnote(content, Optional.ToList(boundingRegions), spans, Optional.ToList(elements)); - } - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static DocumentFootnote FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeDocumentFootnote(document.RootElement); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFootnote.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFootnote.cs deleted file mode 100644 index ae279afe002b..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFootnote.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - /// A footnote object describing a table or figure. - public partial class DocumentFootnote - { - /// Initializes a new instance of DocumentFootnote. - /// Content of the footnote. - /// Location of the footnote in the reading order concatenated content. - /// or is null. - internal DocumentFootnote(string content, IEnumerable spans) - { - Argument.AssertNotNull(content, nameof(content)); - Argument.AssertNotNull(spans, nameof(spans)); - - Content = content; - BoundingRegions = new ChangeTrackingList(); - Spans = spans.ToList(); - Elements = new ChangeTrackingList(); - } - - /// Initializes a new instance of DocumentFootnote. - /// Content of the footnote. - /// Bounding regions covering the footnote. - /// Location of the footnote in the reading order concatenated content. - /// Child elements of the footnote. - internal DocumentFootnote(string content, IReadOnlyList boundingRegions, IReadOnlyList spans, IReadOnlyList elements) - { - Content = content; - BoundingRegions = boundingRegions; - Spans = spans; - Elements = elements; - } - - /// Content of the footnote. - public string Content { get; } - /// Bounding regions covering the footnote. - public IReadOnlyList BoundingRegions { get; } - /// Location of the footnote in the reading order concatenated content. - public IReadOnlyList Spans { get; } - /// Child elements of the footnote. - public IReadOnlyList Elements { get; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFormula.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFormula.Serialization.cs deleted file mode 100644 index 59924587019a..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFormula.Serialization.cs +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class DocumentFormula - { - internal static DocumentFormula DeserializeDocumentFormula(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - DocumentFormulaKind kind = default; - string value = default; - Optional> polygon = default; - DocumentSpan span = default; - float confidence = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("kind"u8)) - { - kind = new DocumentFormulaKind(property.Value.GetString()); - continue; - } - if (property.NameEquals("value"u8)) - { - value = property.Value.GetString(); - continue; - } - if (property.NameEquals("polygon"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetSingle()); - } - polygon = array; - continue; - } - if (property.NameEquals("span"u8)) - { - span = DocumentSpan.DeserializeDocumentSpan(property.Value); - continue; - } - if (property.NameEquals("confidence"u8)) - { - confidence = property.Value.GetSingle(); - continue; - } - } - return new DocumentFormula(kind, value, Optional.ToList(polygon), span, confidence); - } - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static DocumentFormula FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeDocumentFormula(document.RootElement); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFormula.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFormula.cs deleted file mode 100644 index 66ef4f71a3af..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFormula.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - /// A formula object. - public partial class DocumentFormula - { - /// Initializes a new instance of DocumentFormula. - /// Formula kind. - /// LaTex expression describing the formula. - /// Location of the formula in the reading order concatenated content. - /// Confidence of correctly extracting the formula. - /// or is null. - internal DocumentFormula(DocumentFormulaKind kind, string value, DocumentSpan span, float confidence) - { - Argument.AssertNotNull(value, nameof(value)); - Argument.AssertNotNull(span, nameof(span)); - - Kind = kind; - Value = value; - Polygon = new ChangeTrackingList(); - Span = span; - Confidence = confidence; - } - - /// Initializes a new instance of DocumentFormula. - /// Formula kind. - /// LaTex expression describing the formula. - /// - /// Bounding polygon of the formula, with coordinates specified relative to the - /// top-left of the page. The numbers represent the x, y values of the polygon - /// vertices, clockwise from the left (-180 degrees inclusive) relative to the - /// element orientation. - /// - /// Location of the formula in the reading order concatenated content. - /// Confidence of correctly extracting the formula. - internal DocumentFormula(DocumentFormulaKind kind, string value, IReadOnlyList polygon, DocumentSpan span, float confidence) - { - Kind = kind; - Value = value; - Polygon = polygon; - Span = span; - Confidence = confidence; - } - - /// Formula kind. - public DocumentFormulaKind Kind { get; } - /// LaTex expression describing the formula. - public string Value { get; } - /// - /// Bounding polygon of the formula, with coordinates specified relative to the - /// top-left of the page. The numbers represent the x, y values of the polygon - /// vertices, clockwise from the left (-180 degrees inclusive) relative to the - /// element orientation. - /// - public IReadOnlyList Polygon { get; } - /// Location of the formula in the reading order concatenated content. - public DocumentSpan Span { get; } - /// Confidence of correctly extracting the formula. - public float Confidence { get; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFormulaKind.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFormulaKind.cs deleted file mode 100644 index 69c554d0e845..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFormulaKind.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.AI.DocumentIntelligence -{ - /// Formula kind. - public readonly partial struct DocumentFormulaKind : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public DocumentFormulaKind(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string InlineValue = "inline"; - private const string DisplayValue = "display"; - - /// A formula embedded within the content of a paragraph. - public static DocumentFormulaKind Inline { get; } = new DocumentFormulaKind(InlineValue); - /// A formula in display mode that takes up an entire line. - public static DocumentFormulaKind Display { get; } = new DocumentFormulaKind(DisplayValue); - /// Determines if two values are the same. - public static bool operator ==(DocumentFormulaKind left, DocumentFormulaKind right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(DocumentFormulaKind left, DocumentFormulaKind right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator DocumentFormulaKind(string value) => new DocumentFormulaKind(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is DocumentFormulaKind other && Equals(other); - /// - public bool Equals(DocumentFormulaKind 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/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceError.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceError.Serialization.cs deleted file mode 100644 index 5d6fe712306d..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceError.Serialization.cs +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class DocumentIntelligenceError - { - internal static DocumentIntelligenceError DeserializeDocumentIntelligenceError(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string code = default; - string message = default; - Optional target = default; - Optional> details = default; - Optional innererror = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("code"u8)) - { - code = property.Value.GetString(); - continue; - } - if (property.NameEquals("message"u8)) - { - message = property.Value.GetString(); - continue; - } - if (property.NameEquals("target"u8)) - { - target = property.Value.GetString(); - continue; - } - if (property.NameEquals("details"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DeserializeDocumentIntelligenceError(item)); - } - details = array; - continue; - } - if (property.NameEquals("innererror"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - innererror = InnerError.DeserializeInnerError(property.Value); - continue; - } - } - return new DocumentIntelligenceError(code, message, target.Value, Optional.ToList(details), innererror.Value); - } - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static DocumentIntelligenceError FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeDocumentIntelligenceError(document.RootElement); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceError.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceError.cs deleted file mode 100644 index 275af9294ea8..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceError.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - /// The error object. - public partial class DocumentIntelligenceError - { - /// Initializes a new instance of DocumentIntelligenceError. - /// One of a server-defined set of error codes. - /// A human-readable representation of the error. - /// or is null. - internal DocumentIntelligenceError(string code, string message) - { - Argument.AssertNotNull(code, nameof(code)); - Argument.AssertNotNull(message, nameof(message)); - - Code = code; - Message = message; - Details = new ChangeTrackingList(); - } - - /// Initializes a new instance of DocumentIntelligenceError. - /// One of a server-defined set of error codes. - /// A human-readable representation of the error. - /// The target of the error. - /// An array of details about specific errors that led to this reported error. - /// An object containing more specific information than the current object about the error. - internal DocumentIntelligenceError(string code, string message, string target, IReadOnlyList details, InnerError innererror) - { - Code = code; - Message = message; - Target = target; - Details = details; - Innererror = innererror; - } - - /// One of a server-defined set of error codes. - public string Code { get; } - /// A human-readable representation of the error. - public string Message { get; } - /// The target of the error. - public string Target { get; } - /// An array of details about specific errors that led to this reported error. - public IReadOnlyList Details { get; } - /// An object containing more specific information than the current object about the error. - public InnerError Innererror { get; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentKeyValueElement.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentKeyValueElement.Serialization.cs deleted file mode 100644 index 69a3d32f388c..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentKeyValueElement.Serialization.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class DocumentKeyValueElement - { - internal static DocumentKeyValueElement DeserializeDocumentKeyValueElement(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string content = default; - Optional> boundingRegions = default; - IReadOnlyList spans = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("content"u8)) - { - content = property.Value.GetString(); - continue; - } - if (property.NameEquals("boundingRegions"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(BoundingRegion.DeserializeBoundingRegion(item)); - } - boundingRegions = array; - continue; - } - if (property.NameEquals("spans"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DocumentSpan.DeserializeDocumentSpan(item)); - } - spans = array; - continue; - } - } - return new DocumentKeyValueElement(content, Optional.ToList(boundingRegions), spans); - } - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static DocumentKeyValueElement FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeDocumentKeyValueElement(document.RootElement); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentKeyValueElement.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentKeyValueElement.cs deleted file mode 100644 index a3ec5d78b4dc..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentKeyValueElement.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - /// An object representing the field key or value in a key-value pair. - public partial class DocumentKeyValueElement - { - /// Initializes a new instance of DocumentKeyValueElement. - /// Concatenated content of the key-value element in reading order. - /// Location of the key-value element in the reading order concatenated content. - /// or is null. - internal DocumentKeyValueElement(string content, IEnumerable spans) - { - Argument.AssertNotNull(content, nameof(content)); - Argument.AssertNotNull(spans, nameof(spans)); - - Content = content; - BoundingRegions = new ChangeTrackingList(); - Spans = spans.ToList(); - } - - /// Initializes a new instance of DocumentKeyValueElement. - /// Concatenated content of the key-value element in reading order. - /// Bounding regions covering the key-value element. - /// Location of the key-value element in the reading order concatenated content. - internal DocumentKeyValueElement(string content, IReadOnlyList boundingRegions, IReadOnlyList spans) - { - Content = content; - BoundingRegions = boundingRegions; - Spans = spans; - } - - /// Concatenated content of the key-value element in reading order. - public string Content { get; } - /// Bounding regions covering the key-value element. - public IReadOnlyList BoundingRegions { get; } - /// Location of the key-value element in the reading order concatenated content. - public IReadOnlyList Spans { get; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentKeyValuePair.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentKeyValuePair.Serialization.cs deleted file mode 100644 index 268542fa5d02..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentKeyValuePair.Serialization.cs +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class DocumentKeyValuePair - { - internal static DocumentKeyValuePair DeserializeDocumentKeyValuePair(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - DocumentKeyValueElement key = default; - Optional value = default; - float confidence = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("key"u8)) - { - key = DocumentKeyValueElement.DeserializeDocumentKeyValueElement(property.Value); - continue; - } - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - value = DocumentKeyValueElement.DeserializeDocumentKeyValueElement(property.Value); - continue; - } - if (property.NameEquals("confidence"u8)) - { - confidence = property.Value.GetSingle(); - continue; - } - } - return new DocumentKeyValuePair(key, value.Value, confidence); - } - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static DocumentKeyValuePair FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeDocumentKeyValuePair(document.RootElement); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentKeyValuePair.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentKeyValuePair.cs deleted file mode 100644 index e80c425aa6a7..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentKeyValuePair.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - /// - /// An object representing a form field with distinct field label (key) and field - /// value (may be empty). - /// - public partial class DocumentKeyValuePair - { - /// Initializes a new instance of DocumentKeyValuePair. - /// Field label of the key-value pair. - /// Confidence of correctly extracting the key-value pair. - /// is null. - internal DocumentKeyValuePair(DocumentKeyValueElement key, float confidence) - { - Argument.AssertNotNull(key, nameof(key)); - - Key = key; - Confidence = confidence; - } - - /// Initializes a new instance of DocumentKeyValuePair. - /// Field label of the key-value pair. - /// Field value of the key-value pair. - /// Confidence of correctly extracting the key-value pair. - internal DocumentKeyValuePair(DocumentKeyValueElement key, DocumentKeyValueElement value, float confidence) - { - Key = key; - Value = value; - Confidence = confidence; - } - - /// Field label of the key-value pair. - public DocumentKeyValueElement Key { get; } - /// Field value of the key-value pair. - public DocumentKeyValueElement Value { get; } - /// Confidence of correctly extracting the key-value pair. - public float Confidence { get; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentLanguage.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentLanguage.Serialization.cs deleted file mode 100644 index f30b10bca349..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentLanguage.Serialization.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class DocumentLanguage - { - internal static DocumentLanguage DeserializeDocumentLanguage(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string locale = default; - IReadOnlyList spans = default; - float confidence = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("locale"u8)) - { - locale = property.Value.GetString(); - continue; - } - if (property.NameEquals("spans"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DocumentSpan.DeserializeDocumentSpan(item)); - } - spans = array; - continue; - } - if (property.NameEquals("confidence"u8)) - { - confidence = property.Value.GetSingle(); - continue; - } - } - return new DocumentLanguage(locale, spans, confidence); - } - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static DocumentLanguage FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeDocumentLanguage(document.RootElement); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentLanguage.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentLanguage.cs deleted file mode 100644 index 1ae393d2f3ba..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentLanguage.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - /// An object representing the detected language for a given text span. - public partial class DocumentLanguage - { - /// Initializes a new instance of DocumentLanguage. - /// - /// Detected language. Value may an ISO 639-1 language code (ex. "en", "fr") - /// or BCP 47 language tag (ex. "zh-Hans"). - /// - /// - /// Location of the text elements in the concatenated content the language applies - /// to. - /// - /// Confidence of correctly identifying the language. - /// or is null. - internal DocumentLanguage(string locale, IEnumerable spans, float confidence) - { - Argument.AssertNotNull(locale, nameof(locale)); - Argument.AssertNotNull(spans, nameof(spans)); - - Locale = locale; - Spans = spans.ToList(); - Confidence = confidence; - } - - /// Initializes a new instance of DocumentLanguage. - /// - /// Detected language. Value may an ISO 639-1 language code (ex. "en", "fr") - /// or BCP 47 language tag (ex. "zh-Hans"). - /// - /// - /// Location of the text elements in the concatenated content the language applies - /// to. - /// - /// Confidence of correctly identifying the language. - internal DocumentLanguage(string locale, IReadOnlyList spans, float confidence) - { - Locale = locale; - Spans = spans; - Confidence = confidence; - } - - /// - /// Detected language. Value may an ISO 639-1 language code (ex. "en", "fr") - /// or BCP 47 language tag (ex. "zh-Hans"). - /// - public string Locale { get; } - /// - /// Location of the text elements in the concatenated content the language applies - /// to. - /// - public IReadOnlyList Spans { get; } - /// Confidence of correctly identifying the language. - public float Confidence { get; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentLine.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentLine.Serialization.cs deleted file mode 100644 index 17406fde04ab..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentLine.Serialization.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class DocumentLine - { - internal static DocumentLine DeserializeDocumentLine(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string content = default; - Optional> polygon = default; - IReadOnlyList spans = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("content"u8)) - { - content = property.Value.GetString(); - continue; - } - if (property.NameEquals("polygon"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetSingle()); - } - polygon = array; - continue; - } - if (property.NameEquals("spans"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DocumentSpan.DeserializeDocumentSpan(item)); - } - spans = array; - continue; - } - } - return new DocumentLine(content, Optional.ToList(polygon), spans); - } - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static DocumentLine FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeDocumentLine(document.RootElement); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentLine.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentLine.cs deleted file mode 100644 index 02c0fcd9d28e..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentLine.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - /// - /// A content line object consisting of an adjacent sequence of content elements, - /// such as words and selection marks. - /// - public partial class DocumentLine - { - /// Initializes a new instance of DocumentLine. - /// Concatenated content of the contained elements in reading order. - /// Location of the line in the reading order concatenated content. - /// or is null. - internal DocumentLine(string content, IEnumerable spans) - { - Argument.AssertNotNull(content, nameof(content)); - Argument.AssertNotNull(spans, nameof(spans)); - - Content = content; - Polygon = new ChangeTrackingList(); - Spans = spans.ToList(); - } - - /// Initializes a new instance of DocumentLine. - /// Concatenated content of the contained elements in reading order. - /// - /// Bounding polygon of the line, with coordinates specified relative to the - /// top-left of the page. The numbers represent the x, y values of the polygon - /// vertices, clockwise from the left (-180 degrees inclusive) relative to the - /// element orientation. - /// - /// Location of the line in the reading order concatenated content. - internal DocumentLine(string content, IReadOnlyList polygon, IReadOnlyList spans) - { - Content = content; - Polygon = polygon; - Spans = spans; - } - - /// Concatenated content of the contained elements in reading order. - public string Content { get; } - /// - /// Bounding polygon of the line, with coordinates specified relative to the - /// top-left of the page. The numbers represent the x, y values of the polygon - /// vertices, clockwise from the left (-180 degrees inclusive) relative to the - /// element orientation. - /// - public IReadOnlyList Polygon { get; } - /// Location of the line in the reading order concatenated content. - public IReadOnlyList Spans { get; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentList.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentList.Serialization.cs deleted file mode 100644 index 605d9b038519..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentList.Serialization.cs +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class DocumentList - { - internal static DocumentList DeserializeDocumentList(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList spans = default; - IReadOnlyList items = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("spans"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DocumentSpan.DeserializeDocumentSpan(item)); - } - spans = array; - continue; - } - if (property.NameEquals("items"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DocumentListItem.DeserializeDocumentListItem(item)); - } - items = array; - continue; - } - } - return new DocumentList(spans, items); - } - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static DocumentList FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeDocumentList(document.RootElement); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentList.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentList.cs deleted file mode 100644 index e28598517ea9..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentList.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - /// An object representing a list in the document. - public partial class DocumentList - { - /// Initializes a new instance of DocumentList. - /// Location of the list in the reading order concatenated content. - /// Items in the list. - /// or is null. - internal DocumentList(IEnumerable spans, IEnumerable items) - { - Argument.AssertNotNull(spans, nameof(spans)); - Argument.AssertNotNull(items, nameof(items)); - - Spans = spans.ToList(); - Items = items.ToList(); - } - - /// Initializes a new instance of DocumentList. - /// Location of the list in the reading order concatenated content. - /// Items in the list. - internal DocumentList(IReadOnlyList spans, IReadOnlyList items) - { - Spans = spans; - Items = items; - } - - /// Location of the list in the reading order concatenated content. - public IReadOnlyList Spans { get; } - /// Items in the list. - public IReadOnlyList Items { get; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentListItem.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentListItem.Serialization.cs deleted file mode 100644 index da789023a2ee..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentListItem.Serialization.cs +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class DocumentListItem - { - internal static DocumentListItem DeserializeDocumentListItem(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - int level = default; - string content = default; - Optional> boundingRegions = default; - IReadOnlyList spans = default; - Optional> elements = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("level"u8)) - { - level = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("content"u8)) - { - content = property.Value.GetString(); - continue; - } - if (property.NameEquals("boundingRegions"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(BoundingRegion.DeserializeBoundingRegion(item)); - } - boundingRegions = array; - continue; - } - if (property.NameEquals("spans"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DocumentSpan.DeserializeDocumentSpan(item)); - } - spans = array; - continue; - } - if (property.NameEquals("elements"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - elements = array; - continue; - } - } - return new DocumentListItem(level, content, Optional.ToList(boundingRegions), spans, Optional.ToList(elements)); - } - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static DocumentListItem FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeDocumentListItem(document.RootElement); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentListItem.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentListItem.cs deleted file mode 100644 index 17562c824bc0..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentListItem.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - /// An object representing a list item in the document. - public partial class DocumentListItem - { - /// Initializes a new instance of DocumentListItem. - /// Level of the list item (1-indexed). - /// Content of the list item. - /// Location of the list item in the reading order concatenated content. - /// or is null. - internal DocumentListItem(int level, string content, IEnumerable spans) - { - Argument.AssertNotNull(content, nameof(content)); - Argument.AssertNotNull(spans, nameof(spans)); - - Level = level; - Content = content; - BoundingRegions = new ChangeTrackingList(); - Spans = spans.ToList(); - Elements = new ChangeTrackingList(); - } - - /// Initializes a new instance of DocumentListItem. - /// Level of the list item (1-indexed). - /// Content of the list item. - /// Bounding regions covering the list item. - /// Location of the list item in the reading order concatenated content. - /// Child elements of the list item. - internal DocumentListItem(int level, string content, IReadOnlyList boundingRegions, IReadOnlyList spans, IReadOnlyList elements) - { - Level = level; - Content = content; - BoundingRegions = boundingRegions; - Spans = spans; - Elements = elements; - } - - /// Level of the list item (1-indexed). - public int Level { get; } - /// Content of the list item. - public string Content { get; } - /// Bounding regions covering the list item. - public IReadOnlyList BoundingRegions { get; } - /// Location of the list item in the reading order concatenated content. - public IReadOnlyList Spans { get; } - /// Child elements of the list item. - public IReadOnlyList Elements { get; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelAdministrationClient.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelAdministrationClient.cs deleted file mode 100644 index 049ec5651758..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelAdministrationClient.cs +++ /dev/null @@ -1,1726 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading; -using System.Threading.Tasks; -using Autorest.CSharp.Core; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace Azure.AI.DocumentIntelligence -{ - // Data plane generated client. - /// The DocumentModelAdministration service client. - public partial class DocumentModelAdministrationClient - { - private const string AuthorizationHeader = "Ocp-Apim-Subscription-Key"; - private readonly AzureKeyCredential _keyCredential; - private static readonly string[] AuthorizationScopes = new string[] { "https://cognitiveservices.azure.com/.default" }; - private readonly TokenCredential _tokenCredential; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// The ClientDiagnostics is used to provide tracing support for the client library. - internal ClientDiagnostics ClientDiagnostics { get; } - - /// The HTTP pipeline for sending and receiving REST requests and responses. - public virtual HttpPipeline Pipeline => _pipeline; - - /// Initializes a new instance of DocumentModelAdministrationClient for mocking. - protected DocumentModelAdministrationClient() - { - } - - /// Initializes a new instance of DocumentModelAdministrationClient. - /// The Document Intelligence service endpoint. - /// A credential used to authenticate to an Azure Service. - /// or is null. - public DocumentModelAdministrationClient(Uri endpoint, AzureKeyCredential credential) : this(endpoint, credential, new AzureAIDocumentIntelligenceClientOptions()) - { - } - - /// Initializes a new instance of DocumentModelAdministrationClient. - /// The Document Intelligence service endpoint. - /// A credential used to authenticate to an Azure Service. - /// or is null. - public DocumentModelAdministrationClient(Uri endpoint, TokenCredential credential) : this(endpoint, credential, new AzureAIDocumentIntelligenceClientOptions()) - { - } - - /// Initializes a new instance of DocumentModelAdministrationClient. - /// The Document Intelligence service endpoint. - /// A credential used to authenticate to an Azure Service. - /// The options for configuring the client. - /// or is null. - public DocumentModelAdministrationClient(Uri endpoint, AzureKeyCredential credential, AzureAIDocumentIntelligenceClientOptions options) - { - Argument.AssertNotNull(endpoint, nameof(endpoint)); - Argument.AssertNotNull(credential, nameof(credential)); - options ??= new AzureAIDocumentIntelligenceClientOptions(); - - ClientDiagnostics = new ClientDiagnostics(options, true); - _keyCredential = credential; - _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new AzureKeyCredentialPolicy(_keyCredential, AuthorizationHeader) }, new ResponseClassifier()); - _endpoint = endpoint; - _apiVersion = options.Version; - } - - /// Initializes a new instance of DocumentModelAdministrationClient. - /// The Document Intelligence service endpoint. - /// A credential used to authenticate to an Azure Service. - /// The options for configuring the client. - /// or is null. - public DocumentModelAdministrationClient(Uri endpoint, TokenCredential credential, AzureAIDocumentIntelligenceClientOptions options) - { - Argument.AssertNotNull(endpoint, nameof(endpoint)); - Argument.AssertNotNull(credential, nameof(credential)); - options ??= new AzureAIDocumentIntelligenceClientOptions(); - - ClientDiagnostics = new ClientDiagnostics(options, true); - _tokenCredential = credential; - _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new BearerTokenAuthenticationPolicy(_tokenCredential, AuthorizationScopes) }, new ResponseClassifier()); - _endpoint = endpoint; - _apiVersion = options.Version; - } - - /// - /// Generates authorization to copy a document model to this location with - /// specified modelId and optional description. - /// - /// Authorize copy request parameters. - /// The cancellation token to use. - /// is null. - /// - public virtual async Task> AuthorizeModelCopyAsync(AuthorizeCopyRequest authorizeCopyRequest, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(authorizeCopyRequest, nameof(authorizeCopyRequest)); - - RequestContext context = FromCancellationToken(cancellationToken); - using RequestContent content = authorizeCopyRequest.ToRequestContent(); - Response response = await AuthorizeModelCopyAsync(content, context).ConfigureAwait(false); - return Response.FromValue(CopyAuthorization.FromResponse(response), response); - } - - /// - /// Generates authorization to copy a document model to this location with - /// specified modelId and optional description. - /// - /// Authorize copy request parameters. - /// The cancellation token to use. - /// is null. - /// - public virtual Response AuthorizeModelCopy(AuthorizeCopyRequest authorizeCopyRequest, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(authorizeCopyRequest, nameof(authorizeCopyRequest)); - - RequestContext context = FromCancellationToken(cancellationToken); - using RequestContent content = authorizeCopyRequest.ToRequestContent(); - Response response = AuthorizeModelCopy(content, context); - return Response.FromValue(CopyAuthorization.FromResponse(response), response); - } - - /// - /// [Protocol Method] Generates authorization to copy a document model to this location with - /// specified modelId and optional description. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The content to send as the body of the request. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task AuthorizeModelCopyAsync(RequestContent content, RequestContext context = null) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("DocumentModelAdministrationClient.AuthorizeModelCopy"); - scope.Start(); - try - { - using HttpMessage message = CreateAuthorizeModelCopyRequest(content, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Generates authorization to copy a document model to this location with - /// specified modelId and optional description. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The content to send as the body of the request. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response AuthorizeModelCopy(RequestContent content, RequestContext context = null) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("DocumentModelAdministrationClient.AuthorizeModelCopy"); - scope.Start(); - try - { - using HttpMessage message = CreateAuthorizeModelCopyRequest(content, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Gets detailed document model information. - /// Unique document model name. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual async Task> GetModelAsync(string modelId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(modelId, nameof(modelId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetModelAsync(modelId, context).ConfigureAwait(false); - return Response.FromValue(DocumentModelDetails.FromResponse(response), response); - } - - /// Gets detailed document model information. - /// Unique document model name. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual Response GetModel(string modelId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(modelId, nameof(modelId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetModel(modelId, context); - return Response.FromValue(DocumentModelDetails.FromResponse(response), response); - } - - /// - /// [Protocol Method] Gets detailed document model information. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// Unique document model name. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task GetModelAsync(string modelId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(modelId, nameof(modelId)); - - using var scope = ClientDiagnostics.CreateScope("DocumentModelAdministrationClient.GetModel"); - scope.Start(); - try - { - using HttpMessage message = CreateGetModelRequest(modelId, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Gets detailed document model information. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// Unique document model name. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response GetModel(string modelId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(modelId, nameof(modelId)); - - using var scope = ClientDiagnostics.CreateScope("DocumentModelAdministrationClient.GetModel"); - scope.Start(); - try - { - using HttpMessage message = CreateGetModelRequest(modelId, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method - /// - /// [Protocol Method] Deletes document model. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Unique document model name. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task DeleteModelAsync(string modelId, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(modelId, nameof(modelId)); - - using var scope = ClientDiagnostics.CreateScope("DocumentModelAdministrationClient.DeleteModel"); - scope.Start(); - try - { - using HttpMessage message = CreateDeleteModelRequest(modelId, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method - /// - /// [Protocol Method] Deletes document model. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Unique document model name. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response DeleteModel(string modelId, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(modelId, nameof(modelId)); - - using var scope = ClientDiagnostics.CreateScope("DocumentModelAdministrationClient.DeleteModel"); - scope.Start(); - try - { - using HttpMessage message = CreateDeleteModelRequest(modelId, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Return information about the current resource. - /// The cancellation token to use. - /// - public virtual async Task> GetResourceInfoAsync(CancellationToken cancellationToken = default) - { - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetResourceInfoAsync(context).ConfigureAwait(false); - return Response.FromValue(ResourceDetails.FromResponse(response), response); - } - - /// Return information about the current resource. - /// The cancellation token to use. - /// - public virtual Response GetResourceInfo(CancellationToken cancellationToken = default) - { - RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetResourceInfo(context); - return Response.FromValue(ResourceDetails.FromResponse(response), response); - } - - /// - /// [Protocol Method] Return information about the current resource. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task GetResourceInfoAsync(RequestContext context) - { - using var scope = ClientDiagnostics.CreateScope("DocumentModelAdministrationClient.GetResourceInfo"); - scope.Start(); - try - { - using HttpMessage message = CreateGetResourceInfoRequest(context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Return information about the current resource. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response GetResourceInfo(RequestContext context) - { - using var scope = ClientDiagnostics.CreateScope("DocumentModelAdministrationClient.GetResourceInfo"); - scope.Start(); - try - { - using HttpMessage message = CreateGetResourceInfoRequest(context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Gets operation info. - /// Operation ID. - /// The cancellation token to use. - /// - public virtual async Task> GetOperationAsync(Guid operationId, CancellationToken cancellationToken = default) - { - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetOperationAsync(operationId, context).ConfigureAwait(false); - return Response.FromValue(OperationDetails.FromResponse(response), response); - } - - /// Gets operation info. - /// Operation ID. - /// The cancellation token to use. - /// - public virtual Response GetOperation(Guid operationId, CancellationToken cancellationToken = default) - { - RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetOperation(operationId, context); - return Response.FromValue(OperationDetails.FromResponse(response), response); - } - - /// - /// [Protocol Method] Gets operation info. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// Operation ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task GetOperationAsync(Guid operationId, RequestContext context) - { - using var scope = ClientDiagnostics.CreateScope("DocumentModelAdministrationClient.GetOperation"); - scope.Start(); - try - { - using HttpMessage message = CreateGetOperationRequest(operationId, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Gets operation info. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// Operation ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response GetOperation(Guid operationId, RequestContext context) - { - using var scope = ClientDiagnostics.CreateScope("DocumentModelAdministrationClient.GetOperation"); - scope.Start(); - try - { - using HttpMessage message = CreateGetOperationRequest(operationId, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Gets detailed document classifier information. - /// Unique document classifier name. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual async Task> GetClassifierAsync(string classifierId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(classifierId, nameof(classifierId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetClassifierAsync(classifierId, context).ConfigureAwait(false); - return Response.FromValue(DocumentClassifierDetails.FromResponse(response), response); - } - - /// Gets detailed document classifier information. - /// Unique document classifier name. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual Response GetClassifier(string classifierId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(classifierId, nameof(classifierId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetClassifier(classifierId, context); - return Response.FromValue(DocumentClassifierDetails.FromResponse(response), response); - } - - /// - /// [Protocol Method] Gets detailed document classifier information. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// Unique document classifier name. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task GetClassifierAsync(string classifierId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(classifierId, nameof(classifierId)); - - using var scope = ClientDiagnostics.CreateScope("DocumentModelAdministrationClient.GetClassifier"); - scope.Start(); - try - { - using HttpMessage message = CreateGetClassifierRequest(classifierId, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Gets detailed document classifier information. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// Unique document classifier name. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response GetClassifier(string classifierId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(classifierId, nameof(classifierId)); - - using var scope = ClientDiagnostics.CreateScope("DocumentModelAdministrationClient.GetClassifier"); - scope.Start(); - try - { - using HttpMessage message = CreateGetClassifierRequest(classifierId, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method - /// - /// [Protocol Method] Deletes document classifier. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Unique document classifier name. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task DeleteClassifierAsync(string classifierId, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(classifierId, nameof(classifierId)); - - using var scope = ClientDiagnostics.CreateScope("DocumentModelAdministrationClient.DeleteClassifier"); - scope.Start(); - try - { - using HttpMessage message = CreateDeleteClassifierRequest(classifierId, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method - /// - /// [Protocol Method] Deletes document classifier. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Unique document classifier name. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response DeleteClassifier(string classifierId, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(classifierId, nameof(classifierId)); - - using var scope = ClientDiagnostics.CreateScope("DocumentModelAdministrationClient.DeleteClassifier"); - scope.Start(); - try - { - using HttpMessage message = CreateDeleteClassifierRequest(classifierId, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// List all document models. - /// The cancellation token to use. - /// - public virtual AsyncPageable GetModelsAsync(CancellationToken cancellationToken = default) - { - RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetModelsRequest(context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetModelsNextPageRequest(nextLink, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, DocumentModelDetails.DeserializeDocumentModelDetails, ClientDiagnostics, _pipeline, "DocumentModelAdministrationClient.GetModels", "value", "nextLink", context); - } - - /// List all document models. - /// The cancellation token to use. - /// - public virtual Pageable GetModels(CancellationToken cancellationToken = default) - { - RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetModelsRequest(context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetModelsNextPageRequest(nextLink, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, DocumentModelDetails.DeserializeDocumentModelDetails, ClientDiagnostics, _pipeline, "DocumentModelAdministrationClient.GetModels", "value", "nextLink", context); - } - - /// - /// [Protocol Method] List all document models - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual AsyncPageable GetModelsAsync(RequestContext context) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetModelsRequest(context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetModelsNextPageRequest(nextLink, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "DocumentModelAdministrationClient.GetModels", "value", "nextLink", context); - } - - /// - /// [Protocol Method] List all document models - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual Pageable GetModels(RequestContext context) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetModelsRequest(context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetModelsNextPageRequest(nextLink, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "DocumentModelAdministrationClient.GetModels", "value", "nextLink", context); - } - - /// Lists all operations. - /// The cancellation token to use. - /// - public virtual AsyncPageable GetOperationsAsync(CancellationToken cancellationToken = default) - { - RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetOperationsRequest(context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetOperationsNextPageRequest(nextLink, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, OperationDetails.DeserializeOperationDetails, ClientDiagnostics, _pipeline, "DocumentModelAdministrationClient.GetOperations", "value", "nextLink", context); - } - - /// Lists all operations. - /// The cancellation token to use. - /// - public virtual Pageable GetOperations(CancellationToken cancellationToken = default) - { - RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetOperationsRequest(context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetOperationsNextPageRequest(nextLink, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, OperationDetails.DeserializeOperationDetails, ClientDiagnostics, _pipeline, "DocumentModelAdministrationClient.GetOperations", "value", "nextLink", context); - } - - /// - /// [Protocol Method] Lists all operations. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual AsyncPageable GetOperationsAsync(RequestContext context) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetOperationsRequest(context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetOperationsNextPageRequest(nextLink, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "DocumentModelAdministrationClient.GetOperations", "value", "nextLink", context); - } - - /// - /// [Protocol Method] Lists all operations. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual Pageable GetOperations(RequestContext context) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetOperationsRequest(context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetOperationsNextPageRequest(nextLink, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "DocumentModelAdministrationClient.GetOperations", "value", "nextLink", context); - } - - /// List all document classifiers. - /// The cancellation token to use. - /// - public virtual AsyncPageable GetClassifiersAsync(CancellationToken cancellationToken = default) - { - RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetClassifiersRequest(context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetClassifiersNextPageRequest(nextLink, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, DocumentClassifierDetails.DeserializeDocumentClassifierDetails, ClientDiagnostics, _pipeline, "DocumentModelAdministrationClient.GetClassifiers", "value", "nextLink", context); - } - - /// List all document classifiers. - /// The cancellation token to use. - /// - public virtual Pageable GetClassifiers(CancellationToken cancellationToken = default) - { - RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetClassifiersRequest(context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetClassifiersNextPageRequest(nextLink, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, DocumentClassifierDetails.DeserializeDocumentClassifierDetails, ClientDiagnostics, _pipeline, "DocumentModelAdministrationClient.GetClassifiers", "value", "nextLink", context); - } - - /// - /// [Protocol Method] List all document classifiers. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual AsyncPageable GetClassifiersAsync(RequestContext context) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetClassifiersRequest(context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetClassifiersNextPageRequest(nextLink, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "DocumentModelAdministrationClient.GetClassifiers", "value", "nextLink", context); - } - - /// - /// [Protocol Method] List all document classifiers. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual Pageable GetClassifiers(RequestContext context) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetClassifiersRequest(context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetClassifiersNextPageRequest(nextLink, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "DocumentModelAdministrationClient.GetClassifiers", "value", "nextLink", context); - } - - /// Builds a custom document analysis model. - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Build request parameters. - /// The cancellation token to use. - /// is null. - /// - public virtual async Task> BuildDocumentModelAsync(WaitUntil waitUntil, BuildDocumentModelRequest buildRequest, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(buildRequest, nameof(buildRequest)); - - RequestContext context = FromCancellationToken(cancellationToken); - using RequestContent content = buildRequest.ToRequestContent(); - Operation response = await BuildDocumentModelAsync(waitUntil, content, context).ConfigureAwait(false); - return ProtocolOperationHelpers.Convert(response, DocumentModelDetails.FromResponse, ClientDiagnostics, "DocumentModelAdministrationClient.BuildDocumentModel"); - } - - /// Builds a custom document analysis model. - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Build request parameters. - /// The cancellation token to use. - /// is null. - /// - public virtual Operation BuildDocumentModel(WaitUntil waitUntil, BuildDocumentModelRequest buildRequest, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(buildRequest, nameof(buildRequest)); - - RequestContext context = FromCancellationToken(cancellationToken); - using RequestContent content = buildRequest.ToRequestContent(); - Operation response = BuildDocumentModel(waitUntil, content, context); - return ProtocolOperationHelpers.Convert(response, DocumentModelDetails.FromResponse, ClientDiagnostics, "DocumentModelAdministrationClient.BuildDocumentModel"); - } - - /// - /// [Protocol Method] Builds a custom document analysis model. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The content to send as the body of the request. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual async Task> BuildDocumentModelAsync(WaitUntil waitUntil, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("DocumentModelAdministrationClient.BuildDocumentModel"); - scope.Start(); - try - { - using HttpMessage message = CreateBuildDocumentModelRequest(content, context); - return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "DocumentModelAdministrationClient.BuildDocumentModel", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Builds a custom document analysis model. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The content to send as the body of the request. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual Operation BuildDocumentModel(WaitUntil waitUntil, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("DocumentModelAdministrationClient.BuildDocumentModel"); - scope.Start(); - try - { - using HttpMessage message = CreateBuildDocumentModelRequest(content, context); - return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "DocumentModelAdministrationClient.BuildDocumentModel", OperationFinalStateVia.OperationLocation, context, waitUntil); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Creates a new document model from document types of existing document models. - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Compose request parameters. - /// The cancellation token to use. - /// is null. - /// - public virtual async Task> ComposeModelAsync(WaitUntil waitUntil, ComposeDocumentModelRequest composeRequest, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(composeRequest, nameof(composeRequest)); - - RequestContext context = FromCancellationToken(cancellationToken); - using RequestContent content = composeRequest.ToRequestContent(); - Operation response = await ComposeModelAsync(waitUntil, content, context).ConfigureAwait(false); - return ProtocolOperationHelpers.Convert(response, DocumentModelDetails.FromResponse, ClientDiagnostics, "DocumentModelAdministrationClient.ComposeModel"); - } - - /// Creates a new document model from document types of existing document models. - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Compose request parameters. - /// The cancellation token to use. - /// is null. - /// - public virtual Operation ComposeModel(WaitUntil waitUntil, ComposeDocumentModelRequest composeRequest, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(composeRequest, nameof(composeRequest)); - - RequestContext context = FromCancellationToken(cancellationToken); - using RequestContent content = composeRequest.ToRequestContent(); - Operation response = ComposeModel(waitUntil, content, context); - return ProtocolOperationHelpers.Convert(response, DocumentModelDetails.FromResponse, ClientDiagnostics, "DocumentModelAdministrationClient.ComposeModel"); - } - - /// - /// [Protocol Method] Creates a new document model from document types of existing document models. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The content to send as the body of the request. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual async Task> ComposeModelAsync(WaitUntil waitUntil, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("DocumentModelAdministrationClient.ComposeModel"); - scope.Start(); - try - { - using HttpMessage message = CreateComposeModelRequest(content, context); - return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "DocumentModelAdministrationClient.ComposeModel", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Creates a new document model from document types of existing document models. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The content to send as the body of the request. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual Operation ComposeModel(WaitUntil waitUntil, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("DocumentModelAdministrationClient.ComposeModel"); - scope.Start(); - try - { - using HttpMessage message = CreateComposeModelRequest(content, context); - return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "DocumentModelAdministrationClient.ComposeModel", OperationFinalStateVia.OperationLocation, context, waitUntil); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Copies document model to the target resource, region, and modelId. - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Unique document model name. - /// Copy to request parameters. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual async Task> CopyModelToAsync(WaitUntil waitUntil, string modelId, CopyAuthorization copyToRequest, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(modelId, nameof(modelId)); - Argument.AssertNotNull(copyToRequest, nameof(copyToRequest)); - - RequestContext context = FromCancellationToken(cancellationToken); - using RequestContent content = copyToRequest.ToRequestContent(); - Operation response = await CopyModelToAsync(waitUntil, modelId, content, context).ConfigureAwait(false); - return ProtocolOperationHelpers.Convert(response, DocumentModelDetails.FromResponse, ClientDiagnostics, "DocumentModelAdministrationClient.CopyModelTo"); - } - - /// Copies document model to the target resource, region, and modelId. - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Unique document model name. - /// Copy to request parameters. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual Operation CopyModelTo(WaitUntil waitUntil, string modelId, CopyAuthorization copyToRequest, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(modelId, nameof(modelId)); - Argument.AssertNotNull(copyToRequest, nameof(copyToRequest)); - - RequestContext context = FromCancellationToken(cancellationToken); - using RequestContent content = copyToRequest.ToRequestContent(); - Operation response = CopyModelTo(waitUntil, modelId, content, context); - return ProtocolOperationHelpers.Convert(response, DocumentModelDetails.FromResponse, ClientDiagnostics, "DocumentModelAdministrationClient.CopyModelTo"); - } - - /// - /// [Protocol Method] Copies document model to the target resource, region, and modelId. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Unique document model name. - /// The content to send as the body of the request. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual async Task> CopyModelToAsync(WaitUntil waitUntil, string modelId, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(modelId, nameof(modelId)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("DocumentModelAdministrationClient.CopyModelTo"); - scope.Start(); - try - { - using HttpMessage message = CreateCopyModelToRequest(modelId, content, context); - return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "DocumentModelAdministrationClient.CopyModelTo", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Copies document model to the target resource, region, and modelId. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Unique document model name. - /// The content to send as the body of the request. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual Operation CopyModelTo(WaitUntil waitUntil, string modelId, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(modelId, nameof(modelId)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("DocumentModelAdministrationClient.CopyModelTo"); - scope.Start(); - try - { - using HttpMessage message = CreateCopyModelToRequest(modelId, content, context); - return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "DocumentModelAdministrationClient.CopyModelTo", OperationFinalStateVia.OperationLocation, context, waitUntil); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Builds a custom document classifier. - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Build request parameters. - /// The cancellation token to use. - /// is null. - /// - public virtual async Task> BuildClassifierAsync(WaitUntil waitUntil, BuildDocumentClassifierRequest buildRequest, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(buildRequest, nameof(buildRequest)); - - RequestContext context = FromCancellationToken(cancellationToken); - using RequestContent content = buildRequest.ToRequestContent(); - Operation response = await BuildClassifierAsync(waitUntil, content, context).ConfigureAwait(false); - return ProtocolOperationHelpers.Convert(response, DocumentClassifierDetails.FromResponse, ClientDiagnostics, "DocumentModelAdministrationClient.BuildClassifier"); - } - - /// Builds a custom document classifier. - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Build request parameters. - /// The cancellation token to use. - /// is null. - /// - public virtual Operation BuildClassifier(WaitUntil waitUntil, BuildDocumentClassifierRequest buildRequest, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(buildRequest, nameof(buildRequest)); - - RequestContext context = FromCancellationToken(cancellationToken); - using RequestContent content = buildRequest.ToRequestContent(); - Operation response = BuildClassifier(waitUntil, content, context); - return ProtocolOperationHelpers.Convert(response, DocumentClassifierDetails.FromResponse, ClientDiagnostics, "DocumentModelAdministrationClient.BuildClassifier"); - } - - /// - /// [Protocol Method] Builds a custom document classifier. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The content to send as the body of the request. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual async Task> BuildClassifierAsync(WaitUntil waitUntil, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("DocumentModelAdministrationClient.BuildClassifier"); - scope.Start(); - try - { - using HttpMessage message = CreateBuildClassifierRequest(content, context); - return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "DocumentModelAdministrationClient.BuildClassifier", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Builds a custom document classifier. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The content to send as the body of the request. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual Operation BuildClassifier(WaitUntil waitUntil, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("DocumentModelAdministrationClient.BuildClassifier"); - scope.Start(); - try - { - using HttpMessage message = CreateBuildClassifierRequest(content, context); - return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "DocumentModelAdministrationClient.BuildClassifier", OperationFinalStateVia.OperationLocation, context, waitUntil); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - internal HttpMessage CreateBuildDocumentModelRequest(RequestContent content, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier202); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/documentintelligence", false); - uri.AppendPath("/documentModels:build", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - request.Content = content; - return message; - } - - internal HttpMessage CreateComposeModelRequest(RequestContent content, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier202); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/documentintelligence", false); - uri.AppendPath("/documentModels:compose", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - request.Content = content; - return message; - } - - internal HttpMessage CreateAuthorizeModelCopyRequest(RequestContent content, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/documentintelligence", false); - uri.AppendPath("/documentModels:authorizeCopy", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - request.Content = content; - return message; - } - - internal HttpMessage CreateCopyModelToRequest(string modelId, RequestContent content, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier202); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/documentintelligence", false); - uri.AppendPath("/documentModels/", false); - uri.AppendPath(modelId, true); - uri.AppendPath(":copyTo", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - request.Content = content; - return message; - } - - internal HttpMessage CreateGetModelRequest(string modelId, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/documentintelligence", false); - uri.AppendPath("/documentModels/", false); - uri.AppendPath(modelId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetModelsRequest(RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/documentintelligence", false); - uri.AppendPath("/documentModels", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateDeleteModelRequest(string modelId, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier204); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/documentintelligence", false); - uri.AppendPath("/documentModels/", false); - uri.AppendPath(modelId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetResourceInfoRequest(RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/documentintelligence", false); - uri.AppendPath("/info", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetOperationRequest(Guid operationId, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/documentintelligence", false); - uri.AppendPath("/operations/", false); - uri.AppendPath(operationId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetOperationsRequest(RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/documentintelligence", false); - uri.AppendPath("/operations", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateBuildClassifierRequest(RequestContent content, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier202); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/documentintelligence", false); - uri.AppendPath("/documentClassifiers:build", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - request.Content = content; - return message; - } - - internal HttpMessage CreateGetClassifierRequest(string classifierId, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/documentintelligence", false); - uri.AppendPath("/documentClassifiers/", false); - uri.AppendPath(classifierId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetClassifiersRequest(RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/documentintelligence", false); - uri.AppendPath("/documentClassifiers", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateDeleteClassifierRequest(string classifierId, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier204); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/documentintelligence", false); - uri.AppendPath("/documentClassifiers/", false); - uri.AppendPath(classifierId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetModelsNextPageRequest(string nextLink, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/documentintelligence", false); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetOperationsNextPageRequest(string nextLink, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/documentintelligence", false); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetClassifiersNextPageRequest(string nextLink, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/documentintelligence", false); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - private static RequestContext DefaultRequestContext = new RequestContext(); - internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default) - { - if (!cancellationToken.CanBeCanceled) - { - return DefaultRequestContext; - } - - return new RequestContext() { CancellationToken = cancellationToken }; - } - - private static ResponseClassifier _responseClassifier202; - private static ResponseClassifier ResponseClassifier202 => _responseClassifier202 ??= new StatusCodeClassifier(stackalloc ushort[] { 202 }); - private static ResponseClassifier _responseClassifier200; - private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); - private static ResponseClassifier _responseClassifier204; - private static ResponseClassifier ResponseClassifier204 => _responseClassifier204 ??= new StatusCodeClassifier(stackalloc ushort[] { 204 }); - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelBuildOperationDetails.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelBuildOperationDetails.Serialization.cs deleted file mode 100644 index 3f8163626b23..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelBuildOperationDetails.Serialization.cs +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class DocumentModelBuildOperationDetails - { - internal static DocumentModelBuildOperationDetails DeserializeDocumentModelBuildOperationDetails(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional result = default; - Guid operationId = default; - OperationStatus status = default; - Optional percentCompleted = default; - DateTimeOffset createdDateTime = default; - DateTimeOffset lastUpdatedDateTime = default; - OperationKind kind = default; - Uri resourceLocation = default; - Optional apiVersion = default; - Optional> tags = default; - Optional error = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("result"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - result = DocumentModelDetails.DeserializeDocumentModelDetails(property.Value); - continue; - } - if (property.NameEquals("operationId"u8)) - { - operationId = property.Value.GetGuid(); - continue; - } - if (property.NameEquals("status"u8)) - { - status = new OperationStatus(property.Value.GetString()); - continue; - } - if (property.NameEquals("percentCompleted"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - percentCompleted = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("createdDateTime"u8)) - { - createdDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("lastUpdatedDateTime"u8)) - { - lastUpdatedDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("kind"u8)) - { - kind = new OperationKind(property.Value.GetString()); - continue; - } - if (property.NameEquals("resourceLocation"u8)) - { - resourceLocation = new Uri(property.Value.GetString()); - continue; - } - if (property.NameEquals("apiVersion"u8)) - { - apiVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("error"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - error = DocumentIntelligenceError.DeserializeDocumentIntelligenceError(property.Value); - continue; - } - } - return new DocumentModelBuildOperationDetails(operationId, status, Optional.ToNullable(percentCompleted), createdDateTime, lastUpdatedDateTime, kind, resourceLocation, apiVersion.Value, Optional.ToDictionary(tags), error.Value, result.Value); - } - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new DocumentModelBuildOperationDetails FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeDocumentModelBuildOperationDetails(document.RootElement); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelBuildOperationDetails.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelBuildOperationDetails.cs deleted file mode 100644 index 8e9173833baf..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelBuildOperationDetails.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - /// Get Operation response object. - public partial class DocumentModelBuildOperationDetails : OperationDetails - { - /// Initializes a new instance of DocumentModelBuildOperationDetails. - /// Operation ID. - /// Operation status. - /// Date and time (UTC) when the operation was created. - /// Date and time (UTC) when the status was last updated. - /// URL of the resource targeted by this operation. - /// is null. - internal DocumentModelBuildOperationDetails(Guid operationId, OperationStatus status, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, Uri resourceLocation) : base(operationId, status, createdDateTime, lastUpdatedDateTime, resourceLocation) - { - Argument.AssertNotNull(resourceLocation, nameof(resourceLocation)); - - Kind = OperationKind.DocumentModelBuild; - } - - /// Initializes a new instance of DocumentModelBuildOperationDetails. - /// Operation ID. - /// Operation status. - /// Operation progress (0-100). - /// Date and time (UTC) when the operation was created. - /// Date and time (UTC) when the status was last updated. - /// Type of operation. - /// URL of the resource targeted by this operation. - /// API version used to create this operation. - /// List of key-value tag attributes associated with the document model. - /// Encountered error. - /// Operation result upon success. - internal DocumentModelBuildOperationDetails(Guid operationId, OperationStatus status, int? percentCompleted, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, OperationKind kind, Uri resourceLocation, string apiVersion, IReadOnlyDictionary tags, DocumentIntelligenceError error, DocumentModelDetails result) : base(operationId, status, percentCompleted, createdDateTime, lastUpdatedDateTime, kind, resourceLocation, apiVersion, tags, error) - { - Result = result; - } - - /// Operation result upon success. - public DocumentModelDetails Result { get; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelComposeOperationDetails.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelComposeOperationDetails.Serialization.cs deleted file mode 100644 index ce0da30cfb21..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelComposeOperationDetails.Serialization.cs +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class DocumentModelComposeOperationDetails - { - internal static DocumentModelComposeOperationDetails DeserializeDocumentModelComposeOperationDetails(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional result = default; - Guid operationId = default; - OperationStatus status = default; - Optional percentCompleted = default; - DateTimeOffset createdDateTime = default; - DateTimeOffset lastUpdatedDateTime = default; - OperationKind kind = default; - Uri resourceLocation = default; - Optional apiVersion = default; - Optional> tags = default; - Optional error = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("result"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - result = DocumentModelDetails.DeserializeDocumentModelDetails(property.Value); - continue; - } - if (property.NameEquals("operationId"u8)) - { - operationId = property.Value.GetGuid(); - continue; - } - if (property.NameEquals("status"u8)) - { - status = new OperationStatus(property.Value.GetString()); - continue; - } - if (property.NameEquals("percentCompleted"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - percentCompleted = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("createdDateTime"u8)) - { - createdDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("lastUpdatedDateTime"u8)) - { - lastUpdatedDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("kind"u8)) - { - kind = new OperationKind(property.Value.GetString()); - continue; - } - if (property.NameEquals("resourceLocation"u8)) - { - resourceLocation = new Uri(property.Value.GetString()); - continue; - } - if (property.NameEquals("apiVersion"u8)) - { - apiVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("error"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - error = DocumentIntelligenceError.DeserializeDocumentIntelligenceError(property.Value); - continue; - } - } - return new DocumentModelComposeOperationDetails(operationId, status, Optional.ToNullable(percentCompleted), createdDateTime, lastUpdatedDateTime, kind, resourceLocation, apiVersion.Value, Optional.ToDictionary(tags), error.Value, result.Value); - } - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new DocumentModelComposeOperationDetails FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeDocumentModelComposeOperationDetails(document.RootElement); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelComposeOperationDetails.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelComposeOperationDetails.cs deleted file mode 100644 index dcec84ca7ca2..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelComposeOperationDetails.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - /// Get Operation response object. - public partial class DocumentModelComposeOperationDetails : OperationDetails - { - /// Initializes a new instance of DocumentModelComposeOperationDetails. - /// Operation ID. - /// Operation status. - /// Date and time (UTC) when the operation was created. - /// Date and time (UTC) when the status was last updated. - /// URL of the resource targeted by this operation. - /// is null. - internal DocumentModelComposeOperationDetails(Guid operationId, OperationStatus status, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, Uri resourceLocation) : base(operationId, status, createdDateTime, lastUpdatedDateTime, resourceLocation) - { - Argument.AssertNotNull(resourceLocation, nameof(resourceLocation)); - - Kind = OperationKind.DocumentModelCompose; - } - - /// Initializes a new instance of DocumentModelComposeOperationDetails. - /// Operation ID. - /// Operation status. - /// Operation progress (0-100). - /// Date and time (UTC) when the operation was created. - /// Date and time (UTC) when the status was last updated. - /// Type of operation. - /// URL of the resource targeted by this operation. - /// API version used to create this operation. - /// List of key-value tag attributes associated with the document model. - /// Encountered error. - /// Operation result upon success. - internal DocumentModelComposeOperationDetails(Guid operationId, OperationStatus status, int? percentCompleted, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, OperationKind kind, Uri resourceLocation, string apiVersion, IReadOnlyDictionary tags, DocumentIntelligenceError error, DocumentModelDetails result) : base(operationId, status, percentCompleted, createdDateTime, lastUpdatedDateTime, kind, resourceLocation, apiVersion, tags, error) - { - Result = result; - } - - /// Operation result upon success. - public DocumentModelDetails Result { get; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelCopyToOperationDetails.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelCopyToOperationDetails.Serialization.cs deleted file mode 100644 index 690f85ce375e..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelCopyToOperationDetails.Serialization.cs +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class DocumentModelCopyToOperationDetails - { - internal static DocumentModelCopyToOperationDetails DeserializeDocumentModelCopyToOperationDetails(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional result = default; - Guid operationId = default; - OperationStatus status = default; - Optional percentCompleted = default; - DateTimeOffset createdDateTime = default; - DateTimeOffset lastUpdatedDateTime = default; - OperationKind kind = default; - Uri resourceLocation = default; - Optional apiVersion = default; - Optional> tags = default; - Optional error = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("result"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - result = DocumentModelDetails.DeserializeDocumentModelDetails(property.Value); - continue; - } - if (property.NameEquals("operationId"u8)) - { - operationId = property.Value.GetGuid(); - continue; - } - if (property.NameEquals("status"u8)) - { - status = new OperationStatus(property.Value.GetString()); - continue; - } - if (property.NameEquals("percentCompleted"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - percentCompleted = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("createdDateTime"u8)) - { - createdDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("lastUpdatedDateTime"u8)) - { - lastUpdatedDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("kind"u8)) - { - kind = new OperationKind(property.Value.GetString()); - continue; - } - if (property.NameEquals("resourceLocation"u8)) - { - resourceLocation = new Uri(property.Value.GetString()); - continue; - } - if (property.NameEquals("apiVersion"u8)) - { - apiVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("error"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - error = DocumentIntelligenceError.DeserializeDocumentIntelligenceError(property.Value); - continue; - } - } - return new DocumentModelCopyToOperationDetails(operationId, status, Optional.ToNullable(percentCompleted), createdDateTime, lastUpdatedDateTime, kind, resourceLocation, apiVersion.Value, Optional.ToDictionary(tags), error.Value, result.Value); - } - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new DocumentModelCopyToOperationDetails FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeDocumentModelCopyToOperationDetails(document.RootElement); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelCopyToOperationDetails.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelCopyToOperationDetails.cs deleted file mode 100644 index b44fcd7e2035..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelCopyToOperationDetails.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - /// Get Operation response object. - public partial class DocumentModelCopyToOperationDetails : OperationDetails - { - /// Initializes a new instance of DocumentModelCopyToOperationDetails. - /// Operation ID. - /// Operation status. - /// Date and time (UTC) when the operation was created. - /// Date and time (UTC) when the status was last updated. - /// URL of the resource targeted by this operation. - /// is null. - internal DocumentModelCopyToOperationDetails(Guid operationId, OperationStatus status, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, Uri resourceLocation) : base(operationId, status, createdDateTime, lastUpdatedDateTime, resourceLocation) - { - Argument.AssertNotNull(resourceLocation, nameof(resourceLocation)); - - Kind = OperationKind.DocumentModelCopyTo; - } - - /// Initializes a new instance of DocumentModelCopyToOperationDetails. - /// Operation ID. - /// Operation status. - /// Operation progress (0-100). - /// Date and time (UTC) when the operation was created. - /// Date and time (UTC) when the status was last updated. - /// Type of operation. - /// URL of the resource targeted by this operation. - /// API version used to create this operation. - /// List of key-value tag attributes associated with the document model. - /// Encountered error. - /// Operation result upon success. - internal DocumentModelCopyToOperationDetails(Guid operationId, OperationStatus status, int? percentCompleted, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, OperationKind kind, Uri resourceLocation, string apiVersion, IReadOnlyDictionary tags, DocumentIntelligenceError error, DocumentModelDetails result) : base(operationId, status, percentCompleted, createdDateTime, lastUpdatedDateTime, kind, resourceLocation, apiVersion, tags, error) - { - Result = result; - } - - /// Operation result upon success. - public DocumentModelDetails Result { get; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelDetails.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelDetails.Serialization.cs deleted file mode 100644 index 8d9364462c21..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelDetails.Serialization.cs +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class DocumentModelDetails - { - internal static DocumentModelDetails DeserializeDocumentModelDetails(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string modelId = default; - Optional description = default; - DateTimeOffset createdDateTime = default; - Optional expirationDateTime = default; - Optional apiVersion = default; - Optional> tags = default; - Optional buildMode = default; - Optional azureBlobSource = default; - Optional azureBlobFileListSource = default; - Optional> docTypes = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("modelId"u8)) - { - modelId = property.Value.GetString(); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("createdDateTime"u8)) - { - createdDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("expirationDateTime"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - expirationDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("apiVersion"u8)) - { - apiVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("buildMode"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - buildMode = new DocumentBuildMode(property.Value.GetString()); - continue; - } - if (property.NameEquals("azureBlobSource"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - azureBlobSource = AzureBlobContentSource.DeserializeAzureBlobContentSource(property.Value); - continue; - } - if (property.NameEquals("azureBlobFileListSource"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - azureBlobFileListSource = AzureBlobFileListContentSource.DeserializeAzureBlobFileListContentSource(property.Value); - continue; - } - if (property.NameEquals("docTypes"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, DocumentTypeDetails.DeserializeDocumentTypeDetails(property0.Value)); - } - docTypes = dictionary; - continue; - } - } - return new DocumentModelDetails(modelId, description.Value, createdDateTime, Optional.ToNullable(expirationDateTime), apiVersion.Value, Optional.ToDictionary(tags), Optional.ToNullable(buildMode), azureBlobSource.Value, azureBlobFileListSource.Value, Optional.ToDictionary(docTypes)); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelDetails.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelDetails.cs deleted file mode 100644 index bc29915f5289..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelDetails.cs +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - /// Document model info. - public partial class DocumentModelDetails - { - /// Initializes a new instance of DocumentModelDetails. - /// Unique document model name. - /// Date and time (UTC) when the document model was created. - /// is null. - internal DocumentModelDetails(string modelId, DateTimeOffset createdDateTime) - { - Argument.AssertNotNull(modelId, nameof(modelId)); - - ModelId = modelId; - CreatedDateTime = createdDateTime; - Tags = new ChangeTrackingDictionary(); - DocTypes = new ChangeTrackingDictionary(); - } - - /// Initializes a new instance of DocumentModelDetails. - /// Unique document model name. - /// Document model description. - /// Date and time (UTC) when the document model was created. - /// Date and time (UTC) when the document model will expire. - /// API version used to create this document model. - /// List of key-value tag attributes associated with the document model. - /// Custom document model build mode. - /// - /// Azure Blob Storage location containing the training data. Either - /// azureBlobSource or azureBlobFileListSource must be specified. - /// - /// - /// Azure Blob Storage file list specifying the training data. Either - /// azureBlobSource or azureBlobFileListSource must be specified. - /// - /// Supported document types. - internal DocumentModelDetails(string modelId, string description, DateTimeOffset createdDateTime, DateTimeOffset? expirationDateTime, string apiVersion, IReadOnlyDictionary tags, DocumentBuildMode? buildMode, AzureBlobContentSource azureBlobSource, AzureBlobFileListContentSource azureBlobFileListSource, IReadOnlyDictionary docTypes) - { - ModelId = modelId; - Description = description; - CreatedDateTime = createdDateTime; - ExpirationDateTime = expirationDateTime; - ApiVersion = apiVersion; - Tags = tags; - BuildMode = buildMode; - AzureBlobSource = azureBlobSource; - AzureBlobFileListSource = azureBlobFileListSource; - DocTypes = docTypes; - } - - /// Unique document model name. - public string ModelId { get; } - /// Document model description. - public string Description { get; } - /// Date and time (UTC) when the document model was created. - public DateTimeOffset CreatedDateTime { get; } - /// Date and time (UTC) when the document model will expire. - public DateTimeOffset? ExpirationDateTime { get; } - /// API version used to create this document model. - public string ApiVersion { get; } - /// List of key-value tag attributes associated with the document model. - public IReadOnlyDictionary Tags { get; } - /// Custom document model build mode. - public DocumentBuildMode? BuildMode { get; } - /// - /// Azure Blob Storage location containing the training data. Either - /// azureBlobSource or azureBlobFileListSource must be specified. - /// - public AzureBlobContentSource AzureBlobSource { get; } - /// - /// Azure Blob Storage file list specifying the training data. Either - /// azureBlobSource or azureBlobFileListSource must be specified. - /// - public AzureBlobFileListContentSource AzureBlobFileListSource { get; } - /// Supported document types. - public IReadOnlyDictionary DocTypes { get; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentPage.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentPage.Serialization.cs deleted file mode 100644 index 9b6bac115973..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentPage.Serialization.cs +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class DocumentPage - { - internal static DocumentPage DeserializeDocumentPage(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - int pageNumber = default; - Optional angle = default; - Optional width = default; - Optional height = default; - Optional unit = default; - IReadOnlyList spans = default; - Optional> words = default; - Optional> selectionMarks = default; - Optional> lines = default; - Optional> barcodes = default; - Optional> formulas = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("pageNumber"u8)) - { - pageNumber = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("angle"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - angle = property.Value.GetSingle(); - continue; - } - if (property.NameEquals("width"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - width = property.Value.GetSingle(); - continue; - } - if (property.NameEquals("height"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - height = property.Value.GetSingle(); - continue; - } - if (property.NameEquals("unit"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - unit = new LengthUnit(property.Value.GetString()); - continue; - } - if (property.NameEquals("spans"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DocumentSpan.DeserializeDocumentSpan(item)); - } - spans = array; - continue; - } - if (property.NameEquals("words"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DocumentWord.DeserializeDocumentWord(item)); - } - words = array; - continue; - } - if (property.NameEquals("selectionMarks"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DocumentSelectionMark.DeserializeDocumentSelectionMark(item)); - } - selectionMarks = array; - continue; - } - if (property.NameEquals("lines"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DocumentLine.DeserializeDocumentLine(item)); - } - lines = array; - continue; - } - if (property.NameEquals("barcodes"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DocumentBarcode.DeserializeDocumentBarcode(item)); - } - barcodes = array; - continue; - } - if (property.NameEquals("formulas"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DocumentFormula.DeserializeDocumentFormula(item)); - } - formulas = array; - continue; - } - } - return new DocumentPage(pageNumber, Optional.ToNullable(angle), Optional.ToNullable(width), Optional.ToNullable(height), Optional.ToNullable(unit), spans, Optional.ToList(words), Optional.ToList(selectionMarks), Optional.ToList(lines), Optional.ToList(barcodes), Optional.ToList(formulas)); - } - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static DocumentPage FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeDocumentPage(document.RootElement); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentPage.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentPage.cs deleted file mode 100644 index 7b7f7fef2906..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentPage.cs +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - /// Content and layout elements extracted from a page from the input. - public partial class DocumentPage - { - /// Initializes a new instance of DocumentPage. - /// 1-based page number in the input document. - /// Location of the page in the reading order concatenated content. - /// is null. - internal DocumentPage(int pageNumber, IEnumerable spans) - { - Argument.AssertNotNull(spans, nameof(spans)); - - PageNumber = pageNumber; - Spans = spans.ToList(); - Words = new ChangeTrackingList(); - SelectionMarks = new ChangeTrackingList(); - Lines = new ChangeTrackingList(); - Barcodes = new ChangeTrackingList(); - Formulas = new ChangeTrackingList(); - } - - /// Initializes a new instance of DocumentPage. - /// 1-based page number in the input document. - /// - /// The general orientation of the content in clockwise direction, measured in - /// degrees between (-180, 180]. - /// - /// The width of the image/PDF in pixels/inches, respectively. - /// The height of the image/PDF in pixels/inches, respectively. - /// - /// The unit used by the width, height, and polygon properties. For images, the - /// unit is "pixel". For PDF, the unit is "inch". - /// - /// Location of the page in the reading order concatenated content. - /// Extracted words from the page. - /// Extracted selection marks from the page. - /// - /// Extracted lines from the page, potentially containing both textual and visual - /// elements. - /// - /// Extracted barcodes from the page. - /// Extracted formulas from the page. - internal DocumentPage(int pageNumber, float? angle, float? width, float? height, LengthUnit? unit, IReadOnlyList spans, IReadOnlyList words, IReadOnlyList selectionMarks, IReadOnlyList lines, IReadOnlyList barcodes, IReadOnlyList formulas) - { - PageNumber = pageNumber; - Angle = angle; - Width = width; - Height = height; - Unit = unit; - Spans = spans; - Words = words; - SelectionMarks = selectionMarks; - Lines = lines; - Barcodes = barcodes; - Formulas = formulas; - } - - /// 1-based page number in the input document. - public int PageNumber { get; } - /// - /// The general orientation of the content in clockwise direction, measured in - /// degrees between (-180, 180]. - /// - public float? Angle { get; } - /// The width of the image/PDF in pixels/inches, respectively. - public float? Width { get; } - /// The height of the image/PDF in pixels/inches, respectively. - public float? Height { get; } - /// - /// The unit used by the width, height, and polygon properties. For images, the - /// unit is "pixel". For PDF, the unit is "inch". - /// - public LengthUnit? Unit { get; } - /// Location of the page in the reading order concatenated content. - public IReadOnlyList Spans { get; } - /// Extracted words from the page. - public IReadOnlyList Words { get; } - /// Extracted selection marks from the page. - public IReadOnlyList SelectionMarks { get; } - /// - /// Extracted lines from the page, potentially containing both textual and visual - /// elements. - /// - public IReadOnlyList Lines { get; } - /// Extracted barcodes from the page. - public IReadOnlyList Barcodes { get; } - /// Extracted formulas from the page. - public IReadOnlyList Formulas { get; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentParagraph.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentParagraph.Serialization.cs deleted file mode 100644 index 4fd99dc73cb6..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentParagraph.Serialization.cs +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class DocumentParagraph - { - internal static DocumentParagraph DeserializeDocumentParagraph(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional role = default; - string content = default; - Optional> boundingRegions = default; - IReadOnlyList spans = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("role"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - role = new ParagraphRole(property.Value.GetString()); - continue; - } - if (property.NameEquals("content"u8)) - { - content = property.Value.GetString(); - continue; - } - if (property.NameEquals("boundingRegions"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(BoundingRegion.DeserializeBoundingRegion(item)); - } - boundingRegions = array; - continue; - } - if (property.NameEquals("spans"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DocumentSpan.DeserializeDocumentSpan(item)); - } - spans = array; - continue; - } - } - return new DocumentParagraph(Optional.ToNullable(role), content, Optional.ToList(boundingRegions), spans); - } - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static DocumentParagraph FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeDocumentParagraph(document.RootElement); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentParagraph.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentParagraph.cs deleted file mode 100644 index a6cd650fd7f8..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentParagraph.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - /// - /// A paragraph object consisting with contiguous lines generally with common - /// alignment and spacing. - /// - public partial class DocumentParagraph - { - /// Initializes a new instance of DocumentParagraph. - /// Concatenated content of the paragraph in reading order. - /// Location of the paragraph in the reading order concatenated content. - /// or is null. - internal DocumentParagraph(string content, IEnumerable spans) - { - Argument.AssertNotNull(content, nameof(content)); - Argument.AssertNotNull(spans, nameof(spans)); - - Content = content; - BoundingRegions = new ChangeTrackingList(); - Spans = spans.ToList(); - } - - /// Initializes a new instance of DocumentParagraph. - /// Semantic role of the paragraph. - /// Concatenated content of the paragraph in reading order. - /// Bounding regions covering the paragraph. - /// Location of the paragraph in the reading order concatenated content. - internal DocumentParagraph(ParagraphRole? role, string content, IReadOnlyList boundingRegions, IReadOnlyList spans) - { - Role = role; - Content = content; - BoundingRegions = boundingRegions; - Spans = spans; - } - - /// Semantic role of the paragraph. - public ParagraphRole? Role { get; } - /// Concatenated content of the paragraph in reading order. - public string Content { get; } - /// Bounding regions covering the paragraph. - public IReadOnlyList BoundingRegions { get; } - /// Location of the paragraph in the reading order concatenated content. - public IReadOnlyList Spans { get; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentSection.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentSection.Serialization.cs deleted file mode 100644 index 2aa2e6399e8c..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentSection.Serialization.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class DocumentSection - { - internal static DocumentSection DeserializeDocumentSection(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList spans = default; - Optional> elements = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("spans"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DocumentSpan.DeserializeDocumentSpan(item)); - } - spans = array; - continue; - } - if (property.NameEquals("elements"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - elements = array; - continue; - } - } - return new DocumentSection(spans, Optional.ToList(elements)); - } - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static DocumentSection FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeDocumentSection(document.RootElement); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentSection.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentSection.cs deleted file mode 100644 index 41ae16da014a..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentSection.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - /// An object representing a section in the document. - public partial class DocumentSection - { - /// Initializes a new instance of DocumentSection. - /// Location of the section in the reading order concatenated content. - /// is null. - internal DocumentSection(IEnumerable spans) - { - Argument.AssertNotNull(spans, nameof(spans)); - - Spans = spans.ToList(); - Elements = new ChangeTrackingList(); - } - - /// Initializes a new instance of DocumentSection. - /// Location of the section in the reading order concatenated content. - /// Child elements of the section. - internal DocumentSection(IReadOnlyList spans, IReadOnlyList elements) - { - Spans = spans; - Elements = elements; - } - - /// Location of the section in the reading order concatenated content. - public IReadOnlyList Spans { get; } - /// Child elements of the section. - public IReadOnlyList Elements { get; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentSelectionMark.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentSelectionMark.Serialization.cs deleted file mode 100644 index da3954aa216c..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentSelectionMark.Serialization.cs +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class DocumentSelectionMark - { - internal static DocumentSelectionMark DeserializeDocumentSelectionMark(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - DocumentSelectionMarkState state = default; - Optional> polygon = default; - DocumentSpan span = default; - float confidence = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("state"u8)) - { - state = new DocumentSelectionMarkState(property.Value.GetString()); - continue; - } - if (property.NameEquals("polygon"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetSingle()); - } - polygon = array; - continue; - } - if (property.NameEquals("span"u8)) - { - span = DocumentSpan.DeserializeDocumentSpan(property.Value); - continue; - } - if (property.NameEquals("confidence"u8)) - { - confidence = property.Value.GetSingle(); - continue; - } - } - return new DocumentSelectionMark(state, Optional.ToList(polygon), span, confidence); - } - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static DocumentSelectionMark FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeDocumentSelectionMark(document.RootElement); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentSelectionMark.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentSelectionMark.cs deleted file mode 100644 index 3077ab1d17a6..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentSelectionMark.cs +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - /// - /// A selection mark object representing check boxes, radio buttons, and other - /// elements indicating a selection. - /// - public partial class DocumentSelectionMark - { - /// Initializes a new instance of DocumentSelectionMark. - /// State of the selection mark. - /// Location of the selection mark in the reading order concatenated content. - /// Confidence of correctly extracting the selection mark. - /// is null. - internal DocumentSelectionMark(DocumentSelectionMarkState state, DocumentSpan span, float confidence) - { - Argument.AssertNotNull(span, nameof(span)); - - State = state; - Polygon = new ChangeTrackingList(); - Span = span; - Confidence = confidence; - } - - /// Initializes a new instance of DocumentSelectionMark. - /// State of the selection mark. - /// - /// Bounding polygon of the selection mark, with coordinates specified relative - /// to the top-left of the page. The numbers represent the x, y values of the - /// polygon vertices, clockwise from the left (-180 degrees inclusive) relative - /// to the element orientation. - /// - /// Location of the selection mark in the reading order concatenated content. - /// Confidence of correctly extracting the selection mark. - internal DocumentSelectionMark(DocumentSelectionMarkState state, IReadOnlyList polygon, DocumentSpan span, float confidence) - { - State = state; - Polygon = polygon; - Span = span; - Confidence = confidence; - } - - /// State of the selection mark. - public DocumentSelectionMarkState State { get; } - /// - /// Bounding polygon of the selection mark, with coordinates specified relative - /// to the top-left of the page. The numbers represent the x, y values of the - /// polygon vertices, clockwise from the left (-180 degrees inclusive) relative - /// to the element orientation. - /// - public IReadOnlyList Polygon { get; } - /// Location of the selection mark in the reading order concatenated content. - public DocumentSpan Span { get; } - /// Confidence of correctly extracting the selection mark. - public float Confidence { get; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentSelectionMarkState.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentSelectionMarkState.cs deleted file mode 100644 index a78539041da2..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentSelectionMarkState.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.AI.DocumentIntelligence -{ - /// State of the selection mark. - public readonly partial struct DocumentSelectionMarkState : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public DocumentSelectionMarkState(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string SelectedValue = "selected"; - private const string UnselectedValue = "unselected"; - - /// - /// The selection mark is selected, often indicated by a check ✓ or cross X inside - /// the selection mark. - /// - public static DocumentSelectionMarkState Selected { get; } = new DocumentSelectionMarkState(SelectedValue); - /// The selection mark is not selected. - public static DocumentSelectionMarkState Unselected { get; } = new DocumentSelectionMarkState(UnselectedValue); - /// Determines if two values are the same. - public static bool operator ==(DocumentSelectionMarkState left, DocumentSelectionMarkState right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(DocumentSelectionMarkState left, DocumentSelectionMarkState right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator DocumentSelectionMarkState(string value) => new DocumentSelectionMarkState(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is DocumentSelectionMarkState other && Equals(other); - /// - public bool Equals(DocumentSelectionMarkState 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/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentSignatureType.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentSignatureType.cs deleted file mode 100644 index ca8ff73a8537..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentSignatureType.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.AI.DocumentIntelligence -{ - /// Presence of signature. - public readonly partial struct DocumentSignatureType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public DocumentSignatureType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string SignedValue = "signed"; - private const string UnsignedValue = "unsigned"; - - /// A signature is detected. - public static DocumentSignatureType Signed { get; } = new DocumentSignatureType(SignedValue); - /// No signatures are detected. - public static DocumentSignatureType Unsigned { get; } = new DocumentSignatureType(UnsignedValue); - /// Determines if two values are the same. - public static bool operator ==(DocumentSignatureType left, DocumentSignatureType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(DocumentSignatureType left, DocumentSignatureType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator DocumentSignatureType(string value) => new DocumentSignatureType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is DocumentSignatureType other && Equals(other); - /// - public bool Equals(DocumentSignatureType 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/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentSpan.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentSpan.Serialization.cs deleted file mode 100644 index 299c3fce8b0d..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentSpan.Serialization.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class DocumentSpan - { - internal static DocumentSpan DeserializeDocumentSpan(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - int offset = default; - int length = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("offset"u8)) - { - offset = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("length"u8)) - { - length = property.Value.GetInt32(); - continue; - } - } - return new DocumentSpan(offset, length); - } - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static DocumentSpan FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeDocumentSpan(document.RootElement); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentSpan.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentSpan.cs deleted file mode 100644 index dd1f9457fd27..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentSpan.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.AI.DocumentIntelligence -{ - /// - /// Contiguous region of the concatenated content property, specified as an offset - /// and length. - /// - public partial class DocumentSpan - { - /// Initializes a new instance of DocumentSpan. - /// Zero-based index of the content represented by the span. - /// Number of characters in the content represented by the span. - internal DocumentSpan(int offset, int length) - { - Offset = offset; - Length = length; - } - - /// Zero-based index of the content represented by the span. - public int Offset { get; } - /// Number of characters in the content represented by the span. - public int Length { get; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentStyle.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentStyle.Serialization.cs deleted file mode 100644 index 45daa7536ea6..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentStyle.Serialization.cs +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class DocumentStyle - { - internal static DocumentStyle DeserializeDocumentStyle(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional isHandwritten = default; - Optional similarFontFamily = default; - Optional fontStyle = default; - Optional fontWeight = default; - Optional color = default; - Optional backgroundColor = default; - IReadOnlyList spans = default; - float confidence = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("isHandwritten"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - isHandwritten = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("similarFontFamily"u8)) - { - similarFontFamily = property.Value.GetString(); - continue; - } - if (property.NameEquals("fontStyle"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - fontStyle = new FontStyle(property.Value.GetString()); - continue; - } - if (property.NameEquals("fontWeight"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - fontWeight = new FontWeight(property.Value.GetString()); - continue; - } - if (property.NameEquals("color"u8)) - { - color = property.Value.GetString(); - continue; - } - if (property.NameEquals("backgroundColor"u8)) - { - backgroundColor = property.Value.GetString(); - continue; - } - if (property.NameEquals("spans"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DocumentSpan.DeserializeDocumentSpan(item)); - } - spans = array; - continue; - } - if (property.NameEquals("confidence"u8)) - { - confidence = property.Value.GetSingle(); - continue; - } - } - return new DocumentStyle(Optional.ToNullable(isHandwritten), similarFontFamily.Value, Optional.ToNullable(fontStyle), Optional.ToNullable(fontWeight), color.Value, backgroundColor.Value, spans, confidence); - } - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static DocumentStyle FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeDocumentStyle(document.RootElement); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentStyle.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentStyle.cs deleted file mode 100644 index 5764418f24cb..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentStyle.cs +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - /// An object representing observed text styles. - public partial class DocumentStyle - { - /// Initializes a new instance of DocumentStyle. - /// Location of the text elements in the concatenated content the style applies to. - /// Confidence of correctly identifying the style. - /// is null. - internal DocumentStyle(IEnumerable spans, float confidence) - { - Argument.AssertNotNull(spans, nameof(spans)); - - Spans = spans.ToList(); - Confidence = confidence; - } - - /// Initializes a new instance of DocumentStyle. - /// Is content handwritten?. - /// - /// Visually most similar font from among the set of supported font families, with - /// fallback fonts following CSS convention (ex. 'Arial, sans-serif'). - /// - /// Font style. - /// Font weight. - /// Foreground color in #rrggbb hexadecimal format. - /// Background color in #rrggbb hexadecimal format.. - /// Location of the text elements in the concatenated content the style applies to. - /// Confidence of correctly identifying the style. - internal DocumentStyle(bool? isHandwritten, string similarFontFamily, FontStyle? fontStyle, FontWeight? fontWeight, string color, string backgroundColor, IReadOnlyList spans, float confidence) - { - IsHandwritten = isHandwritten; - SimilarFontFamily = similarFontFamily; - FontStyle = fontStyle; - FontWeight = fontWeight; - Color = color; - BackgroundColor = backgroundColor; - Spans = spans; - Confidence = confidence; - } - - /// Is content handwritten?. - public bool? IsHandwritten { get; } - /// - /// Visually most similar font from among the set of supported font families, with - /// fallback fonts following CSS convention (ex. 'Arial, sans-serif'). - /// - public string SimilarFontFamily { get; } - /// Font style. - public FontStyle? FontStyle { get; } - /// Font weight. - public FontWeight? FontWeight { get; } - /// Foreground color in #rrggbb hexadecimal format. - public string Color { get; } - /// Background color in #rrggbb hexadecimal format.. - public string BackgroundColor { get; } - /// Location of the text elements in the concatenated content the style applies to. - public IReadOnlyList Spans { get; } - /// Confidence of correctly identifying the style. - public float Confidence { get; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentTable.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentTable.Serialization.cs deleted file mode 100644 index 61d61b65a7fc..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentTable.Serialization.cs +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class DocumentTable - { - internal static DocumentTable DeserializeDocumentTable(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - int rowCount = default; - int columnCount = default; - IReadOnlyList cells = default; - Optional> boundingRegions = default; - IReadOnlyList spans = default; - Optional caption = default; - Optional> footnotes = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("rowCount"u8)) - { - rowCount = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("columnCount"u8)) - { - columnCount = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("cells"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DocumentTableCell.DeserializeDocumentTableCell(item)); - } - cells = array; - continue; - } - if (property.NameEquals("boundingRegions"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(BoundingRegion.DeserializeBoundingRegion(item)); - } - boundingRegions = array; - continue; - } - if (property.NameEquals("spans"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DocumentSpan.DeserializeDocumentSpan(item)); - } - spans = array; - continue; - } - if (property.NameEquals("caption"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - caption = DocumentCaption.DeserializeDocumentCaption(property.Value); - continue; - } - if (property.NameEquals("footnotes"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DocumentFootnote.DeserializeDocumentFootnote(item)); - } - footnotes = array; - continue; - } - } - return new DocumentTable(rowCount, columnCount, cells, Optional.ToList(boundingRegions), spans, caption.Value, Optional.ToList(footnotes)); - } - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static DocumentTable FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeDocumentTable(document.RootElement); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentTable.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentTable.cs deleted file mode 100644 index ab3ef9cca11e..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentTable.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - /// A table object consisting table cells arranged in a rectangular layout. - public partial class DocumentTable - { - /// Initializes a new instance of DocumentTable. - /// Number of rows in the table. - /// Number of columns in the table. - /// Cells contained within the table. - /// Location of the table in the reading order concatenated content. - /// or is null. - internal DocumentTable(int rowCount, int columnCount, IEnumerable cells, IEnumerable spans) - { - Argument.AssertNotNull(cells, nameof(cells)); - Argument.AssertNotNull(spans, nameof(spans)); - - RowCount = rowCount; - ColumnCount = columnCount; - Cells = cells.ToList(); - BoundingRegions = new ChangeTrackingList(); - Spans = spans.ToList(); - Footnotes = new ChangeTrackingList(); - } - - /// Initializes a new instance of DocumentTable. - /// Number of rows in the table. - /// Number of columns in the table. - /// Cells contained within the table. - /// Bounding regions covering the table. - /// Location of the table in the reading order concatenated content. - /// Caption associated with the table. - /// List of footnotes associated with the table. - internal DocumentTable(int rowCount, int columnCount, IReadOnlyList cells, IReadOnlyList boundingRegions, IReadOnlyList spans, DocumentCaption caption, IReadOnlyList footnotes) - { - RowCount = rowCount; - ColumnCount = columnCount; - Cells = cells; - BoundingRegions = boundingRegions; - Spans = spans; - Caption = caption; - Footnotes = footnotes; - } - - /// Number of rows in the table. - public int RowCount { get; } - /// Number of columns in the table. - public int ColumnCount { get; } - /// Cells contained within the table. - public IReadOnlyList Cells { get; } - /// Bounding regions covering the table. - public IReadOnlyList BoundingRegions { get; } - /// Location of the table in the reading order concatenated content. - public IReadOnlyList Spans { get; } - /// Caption associated with the table. - public DocumentCaption Caption { get; } - /// List of footnotes associated with the table. - public IReadOnlyList Footnotes { get; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentTableCell.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentTableCell.Serialization.cs deleted file mode 100644 index e2719e2396eb..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentTableCell.Serialization.cs +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class DocumentTableCell - { - internal static DocumentTableCell DeserializeDocumentTableCell(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional kind = default; - int rowIndex = default; - int columnIndex = default; - Optional rowSpan = default; - Optional columnSpan = default; - string content = default; - Optional> boundingRegions = default; - IReadOnlyList spans = default; - Optional> elements = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("kind"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - kind = new DocumentTableCellKind(property.Value.GetString()); - continue; - } - if (property.NameEquals("rowIndex"u8)) - { - rowIndex = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("columnIndex"u8)) - { - columnIndex = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("rowSpan"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - rowSpan = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("columnSpan"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - columnSpan = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("content"u8)) - { - content = property.Value.GetString(); - continue; - } - if (property.NameEquals("boundingRegions"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(BoundingRegion.DeserializeBoundingRegion(item)); - } - boundingRegions = array; - continue; - } - if (property.NameEquals("spans"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DocumentSpan.DeserializeDocumentSpan(item)); - } - spans = array; - continue; - } - if (property.NameEquals("elements"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - elements = array; - continue; - } - } - return new DocumentTableCell(Optional.ToNullable(kind), rowIndex, columnIndex, Optional.ToNullable(rowSpan), Optional.ToNullable(columnSpan), content, Optional.ToList(boundingRegions), spans, Optional.ToList(elements)); - } - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static DocumentTableCell FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeDocumentTableCell(document.RootElement); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentTableCell.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentTableCell.cs deleted file mode 100644 index c4e0e6e721bc..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentTableCell.cs +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - /// An object representing the location and content of a table cell. - public partial class DocumentTableCell - { - /// Initializes a new instance of DocumentTableCell. - /// Row index of the cell. - /// Column index of the cell. - /// Concatenated content of the table cell in reading order. - /// Location of the table cell in the reading order concatenated content. - /// or is null. - internal DocumentTableCell(int rowIndex, int columnIndex, string content, IEnumerable spans) - { - Argument.AssertNotNull(content, nameof(content)); - Argument.AssertNotNull(spans, nameof(spans)); - - RowIndex = rowIndex; - ColumnIndex = columnIndex; - Content = content; - BoundingRegions = new ChangeTrackingList(); - Spans = spans.ToList(); - Elements = new ChangeTrackingList(); - } - - /// Initializes a new instance of DocumentTableCell. - /// Table cell kind. - /// Row index of the cell. - /// Column index of the cell. - /// Number of rows spanned by this cell. - /// Number of columns spanned by this cell. - /// Concatenated content of the table cell in reading order. - /// Bounding regions covering the table cell. - /// Location of the table cell in the reading order concatenated content. - /// Child elements of the table cell. - internal DocumentTableCell(DocumentTableCellKind? kind, int rowIndex, int columnIndex, int? rowSpan, int? columnSpan, string content, IReadOnlyList boundingRegions, IReadOnlyList spans, IReadOnlyList elements) - { - Kind = kind; - RowIndex = rowIndex; - ColumnIndex = columnIndex; - RowSpan = rowSpan; - ColumnSpan = columnSpan; - Content = content; - BoundingRegions = boundingRegions; - Spans = spans; - Elements = elements; - } - - /// Table cell kind. - public DocumentTableCellKind? Kind { get; } - /// Row index of the cell. - public int RowIndex { get; } - /// Column index of the cell. - public int ColumnIndex { get; } - /// Number of rows spanned by this cell. - public int? RowSpan { get; } - /// Number of columns spanned by this cell. - public int? ColumnSpan { get; } - /// Concatenated content of the table cell in reading order. - public string Content { get; } - /// Bounding regions covering the table cell. - public IReadOnlyList BoundingRegions { get; } - /// Location of the table cell in the reading order concatenated content. - public IReadOnlyList Spans { get; } - /// Child elements of the table cell. - public IReadOnlyList Elements { get; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentTableCellKind.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentTableCellKind.cs deleted file mode 100644 index c35ac550de17..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentTableCellKind.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.AI.DocumentIntelligence -{ - /// Table cell kind. - public readonly partial struct DocumentTableCellKind : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public DocumentTableCellKind(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string ContentValue = "content"; - private const string RowHeaderValue = "rowHeader"; - private const string ColumnHeaderValue = "columnHeader"; - private const string StubHeadValue = "stubHead"; - private const string DescriptionValue = "description"; - - /// Contains the main content/data. - public static DocumentTableCellKind Content { get; } = new DocumentTableCellKind(ContentValue); - /// Describes the content of the row. - public static DocumentTableCellKind RowHeader { get; } = new DocumentTableCellKind(RowHeaderValue); - /// Describes the content of the column. - public static DocumentTableCellKind ColumnHeader { get; } = new DocumentTableCellKind(ColumnHeaderValue); - /// Describes the row headers, usually located at the top left corner of a table. - public static DocumentTableCellKind StubHead { get; } = new DocumentTableCellKind(StubHeadValue); - /// Describes the content in (parts of) the table. - public static DocumentTableCellKind Description { get; } = new DocumentTableCellKind(DescriptionValue); - /// Determines if two values are the same. - public static bool operator ==(DocumentTableCellKind left, DocumentTableCellKind right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(DocumentTableCellKind left, DocumentTableCellKind right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator DocumentTableCellKind(string value) => new DocumentTableCellKind(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is DocumentTableCellKind other && Equals(other); - /// - public bool Equals(DocumentTableCellKind 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/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentTypeDetails.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentTypeDetails.Serialization.cs deleted file mode 100644 index 0845c14c723a..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentTypeDetails.Serialization.cs +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class DocumentTypeDetails - { - internal static DocumentTypeDetails DeserializeDocumentTypeDetails(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional description = default; - Optional buildMode = default; - IReadOnlyDictionary fieldSchema = default; - Optional> fieldConfidence = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("buildMode"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - buildMode = new DocumentBuildMode(property.Value.GetString()); - continue; - } - if (property.NameEquals("fieldSchema"u8)) - { - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, DocumentFieldSchema.DeserializeDocumentFieldSchema(property0.Value)); - } - fieldSchema = dictionary; - continue; - } - if (property.NameEquals("fieldConfidence"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetSingle()); - } - fieldConfidence = dictionary; - continue; - } - } - return new DocumentTypeDetails(description.Value, Optional.ToNullable(buildMode), fieldSchema, Optional.ToDictionary(fieldConfidence)); - } - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static DocumentTypeDetails FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeDocumentTypeDetails(document.RootElement); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentTypeDetails.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentTypeDetails.cs deleted file mode 100644 index 3a9aac470c6f..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentTypeDetails.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - /// Document type info. - public partial class DocumentTypeDetails - { - /// Initializes a new instance of DocumentTypeDetails. - /// Description of the document semantic schema using a JSON Schema style syntax. - /// is null. - internal DocumentTypeDetails(IReadOnlyDictionary fieldSchema) - { - Argument.AssertNotNull(fieldSchema, nameof(fieldSchema)); - - FieldSchema = fieldSchema; - FieldConfidence = new ChangeTrackingDictionary(); - } - - /// Initializes a new instance of DocumentTypeDetails. - /// Document model description. - /// Custom document model build mode. - /// Description of the document semantic schema using a JSON Schema style syntax. - /// Estimated confidence for each field. - internal DocumentTypeDetails(string description, DocumentBuildMode? buildMode, IReadOnlyDictionary fieldSchema, IReadOnlyDictionary fieldConfidence) - { - Description = description; - BuildMode = buildMode; - FieldSchema = fieldSchema; - FieldConfidence = fieldConfidence; - } - - /// Document model description. - public string Description { get; } - /// Custom document model build mode. - public DocumentBuildMode? BuildMode { get; } - /// Description of the document semantic schema using a JSON Schema style syntax. - public IReadOnlyDictionary FieldSchema { get; } - /// Estimated confidence for each field. - public IReadOnlyDictionary FieldConfidence { get; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentWord.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentWord.Serialization.cs deleted file mode 100644 index cd2c2003f355..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentWord.Serialization.cs +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class DocumentWord - { - internal static DocumentWord DeserializeDocumentWord(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string content = default; - Optional> polygon = default; - DocumentSpan span = default; - float confidence = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("content"u8)) - { - content = property.Value.GetString(); - continue; - } - if (property.NameEquals("polygon"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetSingle()); - } - polygon = array; - continue; - } - if (property.NameEquals("span"u8)) - { - span = DocumentSpan.DeserializeDocumentSpan(property.Value); - continue; - } - if (property.NameEquals("confidence"u8)) - { - confidence = property.Value.GetSingle(); - continue; - } - } - return new DocumentWord(content, Optional.ToList(polygon), span, confidence); - } - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static DocumentWord FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeDocumentWord(document.RootElement); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentWord.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentWord.cs deleted file mode 100644 index 27a90931b026..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentWord.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - /// - /// A word object consisting of a contiguous sequence of characters. For non-space - /// delimited languages, such as Chinese, Japanese, and Korean, each character is - /// represented as its own word. - /// - public partial class DocumentWord - { - /// Initializes a new instance of DocumentWord. - /// Text content of the word. - /// Location of the word in the reading order concatenated content. - /// Confidence of correctly extracting the word. - /// or is null. - internal DocumentWord(string content, DocumentSpan span, float confidence) - { - Argument.AssertNotNull(content, nameof(content)); - Argument.AssertNotNull(span, nameof(span)); - - Content = content; - Polygon = new ChangeTrackingList(); - Span = span; - Confidence = confidence; - } - - /// Initializes a new instance of DocumentWord. - /// Text content of the word. - /// - /// Bounding polygon of the word, with coordinates specified relative to the - /// top-left of the page. The numbers represent the x, y values of the polygon - /// vertices, clockwise from the left (-180 degrees inclusive) relative to the - /// element orientation. - /// - /// Location of the word in the reading order concatenated content. - /// Confidence of correctly extracting the word. - internal DocumentWord(string content, IReadOnlyList polygon, DocumentSpan span, float confidence) - { - Content = content; - Polygon = polygon; - Span = span; - Confidence = confidence; - } - - /// Text content of the word. - public string Content { get; } - /// - /// Bounding polygon of the word, with coordinates specified relative to the - /// top-left of the page. The numbers represent the x, y values of the polygon - /// vertices, clockwise from the left (-180 degrees inclusive) relative to the - /// element orientation. - /// - public IReadOnlyList Polygon { get; } - /// Location of the word in the reading order concatenated content. - public DocumentSpan Span { get; } - /// Confidence of correctly extracting the word. - public float Confidence { get; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/FontStyle.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/FontStyle.cs deleted file mode 100644 index 2a90ea130cc0..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/FontStyle.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.AI.DocumentIntelligence -{ - /// Font style. - public readonly partial struct FontStyle : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public FontStyle(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string NormalValue = "normal"; - private const string ItalicValue = "italic"; - - /// Characters are represented normally. - public static FontStyle Normal { get; } = new FontStyle(NormalValue); - /// Characters are visually slanted to the right. - public static FontStyle Italic { get; } = new FontStyle(ItalicValue); - /// Determines if two values are the same. - public static bool operator ==(FontStyle left, FontStyle right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(FontStyle left, FontStyle right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator FontStyle(string value) => new FontStyle(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is FontStyle other && Equals(other); - /// - public bool Equals(FontStyle 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/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/FontWeight.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/FontWeight.cs deleted file mode 100644 index 67a390d233ab..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/FontWeight.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.AI.DocumentIntelligence -{ - /// Font weight. - public readonly partial struct FontWeight : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public FontWeight(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string NormalValue = "normal"; - private const string BoldValue = "bold"; - - /// Characters are represented normally. - public static FontWeight Normal { get; } = new FontWeight(NormalValue); - /// Characters are represented with thicker strokes. - public static FontWeight Bold { get; } = new FontWeight(BoldValue); - /// Determines if two values are the same. - public static bool operator ==(FontWeight left, FontWeight right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(FontWeight left, FontWeight right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator FontWeight(string value) => new FontWeight(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is FontWeight other && Equals(other); - /// - public bool Equals(FontWeight 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/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/InnerError.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/InnerError.Serialization.cs deleted file mode 100644 index fa561bb2d2f1..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/InnerError.Serialization.cs +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class InnerError - { - internal static InnerError DeserializeInnerError(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional code = default; - Optional message = default; - Optional innererror = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("code"u8)) - { - code = property.Value.GetString(); - continue; - } - if (property.NameEquals("message"u8)) - { - message = property.Value.GetString(); - continue; - } - if (property.NameEquals("innererror"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - innererror = DeserializeInnerError(property.Value); - continue; - } - } - return new InnerError(code.Value, message.Value, innererror.Value); - } - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static InnerError FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeInnerError(document.RootElement); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/InnerError.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/InnerError.cs deleted file mode 100644 index b0f6f71a9465..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/InnerError.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.AI.DocumentIntelligence -{ - /// An object containing more specific information about the error. - public partial class InnerError - { - /// Initializes a new instance of InnerError. - internal InnerError() - { - } - - /// Initializes a new instance of InnerError. - /// One of a server-defined set of error codes. - /// A human-readable representation of the error. - /// Inner error. - internal InnerError(string code, string message, InnerError innerErrorObject) - { - Code = code; - Message = message; - InnerErrorObject = innerErrorObject; - } - - /// One of a server-defined set of error codes. - public string Code { get; } - /// A human-readable representation of the error. - public string Message { get; } - /// Inner error. - public InnerError InnerErrorObject { get; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/LengthUnit.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/LengthUnit.cs deleted file mode 100644 index 8481f33359e5..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/LengthUnit.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.AI.DocumentIntelligence -{ - /// The unit used by the width, height, and polygon properties. For images, the unit is "pixel". For PDF, the unit is "inch". - public readonly partial struct LengthUnit : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public LengthUnit(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string PixelValue = "pixel"; - private const string InchValue = "inch"; - - /// Length unit for image files. - public static LengthUnit Pixel { get; } = new LengthUnit(PixelValue); - /// Length unit for PDF files. - public static LengthUnit Inch { get; } = new LengthUnit(InchValue); - /// Determines if two values are the same. - public static bool operator ==(LengthUnit left, LengthUnit right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(LengthUnit left, LengthUnit right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator LengthUnit(string value) => new LengthUnit(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is LengthUnit other && Equals(other); - /// - public bool Equals(LengthUnit 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/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/OperationDetails.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/OperationDetails.Serialization.cs deleted file mode 100644 index 71fcb4e201eb..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/OperationDetails.Serialization.cs +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class OperationDetails - { - internal static OperationDetails DeserializeOperationDetails(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - if (element.TryGetProperty("kind", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "documentModelBuild": return DocumentModelBuildOperationDetails.DeserializeDocumentModelBuildOperationDetails(element); - case "documentModelCompose": return DocumentModelComposeOperationDetails.DeserializeDocumentModelComposeOperationDetails(element); - case "documentModelCopyTo": return DocumentModelCopyToOperationDetails.DeserializeDocumentModelCopyToOperationDetails(element); - case "documentClassifierBuild": return DocumentClassifierBuildOperationDetails.DeserializeDocumentClassifierBuildOperationDetails(element); - } - } - return UnknownOperationDetails.DeserializeUnknownOperationDetails(element); - } - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static OperationDetails FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeOperationDetails(document.RootElement); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/OperationDetails.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/OperationDetails.cs deleted file mode 100644 index e1fc41af2fde..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/OperationDetails.cs +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - /// - /// Operation info. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , and . - /// - public abstract partial class OperationDetails - { - /// Initializes a new instance of OperationDetails. - /// Operation ID. - /// Operation status. - /// Date and time (UTC) when the operation was created. - /// Date and time (UTC) when the status was last updated. - /// URL of the resource targeted by this operation. - /// is null. - protected OperationDetails(Guid operationId, OperationStatus status, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, Uri resourceLocation) - { - Argument.AssertNotNull(resourceLocation, nameof(resourceLocation)); - - OperationId = operationId; - Status = status; - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; - ResourceLocation = resourceLocation; - Tags = new ChangeTrackingDictionary(); - } - - /// Initializes a new instance of OperationDetails. - /// Operation ID. - /// Operation status. - /// Operation progress (0-100). - /// Date and time (UTC) when the operation was created. - /// Date and time (UTC) when the status was last updated. - /// Type of operation. - /// URL of the resource targeted by this operation. - /// API version used to create this operation. - /// List of key-value tag attributes associated with the document model. - /// Encountered error. - internal OperationDetails(Guid operationId, OperationStatus status, int? percentCompleted, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, OperationKind kind, Uri resourceLocation, string apiVersion, IReadOnlyDictionary tags, DocumentIntelligenceError error) - { - OperationId = operationId; - Status = status; - PercentCompleted = percentCompleted; - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; - Kind = kind; - ResourceLocation = resourceLocation; - ApiVersion = apiVersion; - Tags = tags; - Error = error; - } - - /// Operation ID. - public Guid OperationId { get; } - /// Operation status. - public OperationStatus Status { get; } - /// Operation progress (0-100). - public int? PercentCompleted { get; } - /// Date and time (UTC) when the operation was created. - public DateTimeOffset CreatedDateTime { get; } - /// Date and time (UTC) when the status was last updated. - public DateTimeOffset LastUpdatedDateTime { get; } - /// Type of operation. - internal OperationKind Kind { get; set; } - /// URL of the resource targeted by this operation. - public Uri ResourceLocation { get; } - /// API version used to create this operation. - public string ApiVersion { get; } - /// List of key-value tag attributes associated with the document model. - public IReadOnlyDictionary Tags { get; } - /// Encountered error. - public DocumentIntelligenceError Error { get; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/OperationKind.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/OperationKind.cs deleted file mode 100644 index abe6a2365934..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/OperationKind.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.AI.DocumentIntelligence -{ - /// Type of operation. - internal readonly partial struct OperationKind : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public OperationKind(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string DocumentModelBuildValue = "documentModelBuild"; - private const string DocumentModelComposeValue = "documentModelCompose"; - private const string DocumentModelCopyToValue = "documentModelCopyTo"; - private const string DocumentClassifierBuildValue = "documentClassifierBuild"; - - /// Build a new custom document model. - public static OperationKind DocumentModelBuild { get; } = new OperationKind(DocumentModelBuildValue); - /// Compose a new custom document model from existing models. - public static OperationKind DocumentModelCompose { get; } = new OperationKind(DocumentModelComposeValue); - /// - /// Copy an existing document model to potentially a different resource, region, or - /// subscription. - /// - public static OperationKind DocumentModelCopyTo { get; } = new OperationKind(DocumentModelCopyToValue); - /// Build a new custom classifier model. - public static OperationKind DocumentClassifierBuild { get; } = new OperationKind(DocumentClassifierBuildValue); - /// Determines if two values are the same. - public static bool operator ==(OperationKind left, OperationKind right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(OperationKind left, OperationKind right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator OperationKind(string value) => new OperationKind(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is OperationKind other && Equals(other); - /// - public bool Equals(OperationKind 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/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/OperationStatus.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/OperationStatus.cs deleted file mode 100644 index 5f26f496fce1..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/OperationStatus.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.AI.DocumentIntelligence -{ - /// Operation status. - public readonly partial struct OperationStatus : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public OperationStatus(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string NotStartedValue = "notStarted"; - private const string RunningValue = "running"; - private const string FailedValue = "failed"; - private const string SucceededValue = "succeeded"; - private const string CanceledValue = "canceled"; - - /// The operation has not started yet. - public static OperationStatus NotStarted { get; } = new OperationStatus(NotStartedValue); - /// The operation is in progress. - public static OperationStatus Running { get; } = new OperationStatus(RunningValue); - /// The operation has failed. - public static OperationStatus Failed { get; } = new OperationStatus(FailedValue); - /// The operation has succeeded. - public static OperationStatus Succeeded { get; } = new OperationStatus(SucceededValue); - /// The operation has been canceled. - public static OperationStatus Canceled { get; } = new OperationStatus(CanceledValue); - /// Determines if two values are the same. - public static bool operator ==(OperationStatus left, OperationStatus right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(OperationStatus left, OperationStatus right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator OperationStatus(string value) => new OperationStatus(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is OperationStatus other && Equals(other); - /// - public bool Equals(OperationStatus 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/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ParagraphRole.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ParagraphRole.cs deleted file mode 100644 index 7125db4a4ebe..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ParagraphRole.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.AI.DocumentIntelligence -{ - /// Semantic role of the paragraph. - public readonly partial struct ParagraphRole : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ParagraphRole(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string PageHeaderValue = "pageHeader"; - private const string PageFooterValue = "pageFooter"; - private const string PageNumberValue = "pageNumber"; - private const string TitleValue = "title"; - private const string SectionHeadingValue = "sectionHeading"; - private const string FootnoteValue = "footnote"; - private const string FormulaBlockValue = "formulaBlock"; - - /// Text near the top edge of the page. - public static ParagraphRole PageHeader { get; } = new ParagraphRole(PageHeaderValue); - /// Text near the bottom edge of the page. - public static ParagraphRole PageFooter { get; } = new ParagraphRole(PageFooterValue); - /// Page number. - public static ParagraphRole PageNumber { get; } = new ParagraphRole(PageNumberValue); - /// Top-level title describing the entire document. - public static ParagraphRole Title { get; } = new ParagraphRole(TitleValue); - /// Sub heading describing a section of the document. - public static ParagraphRole SectionHeading { get; } = new ParagraphRole(SectionHeadingValue); - /// A note usually placed after the main content on a page. - public static ParagraphRole Footnote { get; } = new ParagraphRole(FootnoteValue); - /// A block of formulas, often with shared alignment. - public static ParagraphRole FormulaBlock { get; } = new ParagraphRole(FormulaBlockValue); - /// Determines if two values are the same. - public static bool operator ==(ParagraphRole left, ParagraphRole right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ParagraphRole left, ParagraphRole right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ParagraphRole(string value) => new ParagraphRole(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ParagraphRole other && Equals(other); - /// - public bool Equals(ParagraphRole 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/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/QuotaDetails.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/QuotaDetails.Serialization.cs deleted file mode 100644 index 3a0cd92c5c89..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/QuotaDetails.Serialization.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class QuotaDetails - { - internal static QuotaDetails DeserializeQuotaDetails(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - int used = default; - int quota = default; - DateTimeOffset quotaResetDateTime = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("used"u8)) - { - used = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("quota"u8)) - { - quota = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("quotaResetDateTime"u8)) - { - quotaResetDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - } - return new QuotaDetails(used, quota, quotaResetDateTime); - } - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static QuotaDetails FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeQuotaDetails(document.RootElement); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/QuotaDetails.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/QuotaDetails.cs deleted file mode 100644 index db023afbf932..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/QuotaDetails.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.AI.DocumentIntelligence -{ - /// Quota used, limit, and next reset date/time. - public partial class QuotaDetails - { - /// Initializes a new instance of QuotaDetails. - /// Amount of the resource quota used. - /// Resource quota limit. - /// Date/time when the resource quota usage will be reset. - internal QuotaDetails(int used, int quota, DateTimeOffset quotaResetDateTime) - { - Used = used; - Quota = quota; - QuotaResetDateTime = quotaResetDateTime; - } - - /// Amount of the resource quota used. - public int Used { get; } - /// Resource quota limit. - public int Quota { get; } - /// Date/time when the resource quota usage will be reset. - public DateTimeOffset QuotaResetDateTime { get; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ResourceDetails.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ResourceDetails.Serialization.cs deleted file mode 100644 index d932193d8ed9..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ResourceDetails.Serialization.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure; - -namespace Azure.AI.DocumentIntelligence -{ - public partial class ResourceDetails - { - internal static ResourceDetails DeserializeResourceDetails(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - CustomDocumentModelsDetails customDocumentModels = default; - QuotaDetails customNeuralDocumentModelBuilds = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("customDocumentModels"u8)) - { - customDocumentModels = CustomDocumentModelsDetails.DeserializeCustomDocumentModelsDetails(property.Value); - continue; - } - if (property.NameEquals("customNeuralDocumentModelBuilds"u8)) - { - customNeuralDocumentModelBuilds = QuotaDetails.DeserializeQuotaDetails(property.Value); - continue; - } - } - return new ResourceDetails(customDocumentModels, customNeuralDocumentModelBuilds); - } - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ResourceDetails FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeResourceDetails(document.RootElement); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ResourceDetails.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ResourceDetails.cs deleted file mode 100644 index 7c7f9ccea1ea..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ResourceDetails.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - /// General information regarding the current resource. - public partial class ResourceDetails - { - /// Initializes a new instance of ResourceDetails. - /// Details regarding custom document models. - /// Quota used, limit, and next reset date/time. - /// or is null. - internal ResourceDetails(CustomDocumentModelsDetails customDocumentModels, QuotaDetails customNeuralDocumentModelBuilds) - { - Argument.AssertNotNull(customDocumentModels, nameof(customDocumentModels)); - Argument.AssertNotNull(customNeuralDocumentModelBuilds, nameof(customNeuralDocumentModelBuilds)); - - CustomDocumentModels = customDocumentModels; - CustomNeuralDocumentModelBuilds = customNeuralDocumentModelBuilds; - } - - /// Details regarding custom document models. - public CustomDocumentModelsDetails CustomDocumentModels { get; } - /// Quota used, limit, and next reset date/time. - public QuotaDetails CustomNeuralDocumentModelBuilds { get; } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/SplitMode.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/SplitMode.cs deleted file mode 100644 index a14a683534eb..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/SplitMode.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.AI.DocumentIntelligence -{ - /// Document splitting mode. - public readonly partial struct SplitMode : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public SplitMode(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string AutoValue = "auto"; - private const string NoneValue = "none"; - private const string PerPageValue = "perPage"; - - /// Automatically split file into documents. - public static SplitMode Auto { get; } = new SplitMode(AutoValue); - /// Treat the entire file as a single document. - public static SplitMode None { get; } = new SplitMode(NoneValue); - /// Treat each page in the file as a separate document. - public static SplitMode PerPage { get; } = new SplitMode(PerPageValue); - /// Determines if two values are the same. - public static bool operator ==(SplitMode left, SplitMode right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(SplitMode left, SplitMode right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator SplitMode(string value) => new SplitMode(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is SplitMode other && Equals(other); - /// - public bool Equals(SplitMode 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/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/StringIndexType.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/StringIndexType.cs deleted file mode 100644 index a73b218696c7..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/StringIndexType.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.AI.DocumentIntelligence -{ - /// Method used to compute string offset and length. - public readonly partial struct StringIndexType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public StringIndexType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string TextElementsValue = "textElements"; - private const string UnicodeCodePointValue = "unicodeCodePoint"; - private const string Utf16CodeUnitValue = "utf16CodeUnit"; - - /// - /// User-perceived display character, or grapheme cluster, as defined by Unicode - /// 8.0.0. - /// - public static StringIndexType TextElements { get; } = new StringIndexType(TextElementsValue); - /// Character unit represented by a single unicode code point. Used by Python 3. - public static StringIndexType UnicodeCodePoint { get; } = new StringIndexType(UnicodeCodePointValue); - /// - /// Character unit represented by a 16-bit Unicode code unit. Used by JavaScript, - /// Java, and .NET. - /// - public static StringIndexType Utf16CodeUnit { get; } = new StringIndexType(Utf16CodeUnitValue); - /// Determines if two values are the same. - public static bool operator ==(StringIndexType left, StringIndexType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(StringIndexType left, StringIndexType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator StringIndexType(string value) => new StringIndexType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is StringIndexType other && Equals(other); - /// - public bool Equals(StringIndexType 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/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/UnknownOperationDetails.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/UnknownOperationDetails.Serialization.cs deleted file mode 100644 index 14758d28cdad..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/UnknownOperationDetails.Serialization.cs +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - internal partial class UnknownOperationDetails - { - internal static UnknownOperationDetails DeserializeUnknownOperationDetails(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Guid operationId = default; - OperationStatus status = default; - Optional percentCompleted = default; - DateTimeOffset createdDateTime = default; - DateTimeOffset lastUpdatedDateTime = default; - OperationKind kind = "Unknown"; - Uri resourceLocation = default; - Optional apiVersion = default; - Optional> tags = default; - Optional error = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("operationId"u8)) - { - operationId = property.Value.GetGuid(); - continue; - } - if (property.NameEquals("status"u8)) - { - status = new OperationStatus(property.Value.GetString()); - continue; - } - if (property.NameEquals("percentCompleted"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - percentCompleted = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("createdDateTime"u8)) - { - createdDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("lastUpdatedDateTime"u8)) - { - lastUpdatedDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("kind"u8)) - { - kind = new OperationKind(property.Value.GetString()); - continue; - } - if (property.NameEquals("resourceLocation"u8)) - { - resourceLocation = new Uri(property.Value.GetString()); - continue; - } - if (property.NameEquals("apiVersion"u8)) - { - apiVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("error"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - error = DocumentIntelligenceError.DeserializeDocumentIntelligenceError(property.Value); - continue; - } - } - return new UnknownOperationDetails(operationId, status, Optional.ToNullable(percentCompleted), createdDateTime, lastUpdatedDateTime, kind, resourceLocation, apiVersion.Value, Optional.ToDictionary(tags), error.Value); - } - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new UnknownOperationDetails FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeUnknownOperationDetails(document.RootElement); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/UnknownOperationDetails.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/UnknownOperationDetails.cs deleted file mode 100644 index 99fce2abd815..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/UnknownOperationDetails.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.AI.DocumentIntelligence -{ - /// Unknown version of OperationDetails. - internal partial class UnknownOperationDetails : OperationDetails - { - /// Initializes a new instance of UnknownOperationDetails. - /// Operation ID. - /// Operation status. - /// Date and time (UTC) when the operation was created. - /// Date and time (UTC) when the status was last updated. - /// URL of the resource targeted by this operation. - /// is null. - internal UnknownOperationDetails(Guid operationId, OperationStatus status, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, Uri resourceLocation) : base(operationId, status, createdDateTime, lastUpdatedDateTime, resourceLocation) - { - Argument.AssertNotNull(resourceLocation, nameof(resourceLocation)); - } - - /// Initializes a new instance of UnknownOperationDetails. - /// Operation ID. - /// Operation status. - /// Operation progress (0-100). - /// Date and time (UTC) when the operation was created. - /// Date and time (UTC) when the status was last updated. - /// Type of operation. - /// URL of the resource targeted by this operation. - /// API version used to create this operation. - /// List of key-value tag attributes associated with the document model. - /// Encountered error. - internal UnknownOperationDetails(Guid operationId, OperationStatus status, int? percentCompleted, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, OperationKind kind, Uri resourceLocation, string apiVersion, IReadOnlyDictionary tags, DocumentIntelligenceError error) : base(operationId, status, percentCompleted, createdDateTime, lastUpdatedDateTime, kind, resourceLocation, apiVersion, tags, error) - { - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Properties/AssemblyInfo.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Properties/AssemblyInfo.cs deleted file mode 100644 index 08aefdb8ea8f..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System.Runtime.CompilerServices; - -[assembly: InternalsVisibleTo("Azure.AI.DocumentIntelligence.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] -[assembly: Azure.Core.AzureResourceProviderNamespace("Microsoft.CognitiveServices")] diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Assets/IRS-1040_2.pdf b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Assets/IRS-1040_2.pdf deleted file mode 100644 index e3df747fddc7..000000000000 Binary files a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Assets/IRS-1040_2.pdf and /dev/null differ diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Assets/blank.pdf b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Assets/blank.pdf deleted file mode 100644 index 9bbfa949a1c8..000000000000 Binary files a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Assets/blank.pdf and /dev/null differ diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Azure.AI.DocumentIntelligence.Tests.csproj b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Azure.AI.DocumentIntelligence.Tests.csproj deleted file mode 100644 index 926052652396..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Azure.AI.DocumentIntelligence.Tests.csproj +++ /dev/null @@ -1,25 +0,0 @@ - - - $(RequiredTargetFrameworks) - - - $(NoWarn);CS1591 - - - - - - - - - - - - - - - - - - - diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentAnalysisClient/DocumentClassifierLiveTests.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentAnalysisClient/DocumentClassifierLiveTests.cs deleted file mode 100644 index ec3676818048..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentAnalysisClient/DocumentClassifierLiveTests.cs +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Azure.Core.TestFramework; -using NUnit.Framework; - -namespace Azure.AI.DocumentIntelligence.Tests -{ - public class DocumentClassifierLiveTests : DocumentIntelligenceLiveTestBase - { - public DocumentClassifierLiveTests(bool isAsync) - : base(isAsync) - { - } - - [RecordedTest] - public async Task ClassifyDocumentWithUrlSource() - { - var client = CreateDocumentAnalysisClient(); - - await using var disposableClassifier = await BuildDisposableDocumentClassifierAsync(); - - var request = new ClassifyDocumentRequest() - { - UrlSource = DocumentIntelligenceTestEnvironment.CreateUri(TestFile.Irs1040) - }; - - var operation = await client.ClassifyDocumentAsync(WaitUntil.Completed, disposableClassifier.ClassifierId, request); - - Assert.That(operation.HasCompleted); - Assert.That(operation.HasValue); - - ValidateIrs1040ClassifierResult(operation.Value, disposableClassifier.ClassifierId); - } - - [RecordedTest] - public async Task ClassifyDocumentCanParseBlankPage() - { - var client = CreateDocumentAnalysisClient(); - - await using var disposableClassifier = await BuildDisposableDocumentClassifierAsync(); - - var request = new ClassifyDocumentRequest() - { - UrlSource = DocumentIntelligenceTestEnvironment.CreateUri(TestFile.Blank) - }; - - var operation = await client.ClassifyDocumentAsync(WaitUntil.Completed, disposableClassifier.ClassifierId, request); - - Assert.That(operation.HasCompleted); - Assert.That(operation.HasValue); - - ValidateGenericClassifierResult(operation.Value, disposableClassifier.ClassifierId); - } - - private void ValidateGenericClassifierResult(AnalyzeResult analyzeResult, string classifierId) - { - Assert.That(analyzeResult.ModelId, Is.EqualTo(classifierId)); - Assert.That(analyzeResult.ApiVersion, Is.EqualTo(ServiceVersionString)); - Assert.That(analyzeResult.StringIndexType, Is.EqualTo(StringIndexType.TextElements)); - Assert.That(analyzeResult.ContentFormat, Is.Not.EqualTo(default(ContentFormat))); - - Assert.That(analyzeResult.Content, Is.Empty); - Assert.That(analyzeResult.Paragraphs, Is.Empty); - Assert.That(analyzeResult.Tables, Is.Empty); - Assert.That(analyzeResult.Figures, Is.Empty); - Assert.That(analyzeResult.Lists, Is.Empty); - Assert.That(analyzeResult.Sections, Is.Empty); - Assert.That(analyzeResult.KeyValuePairs, Is.Empty); - Assert.That(analyzeResult.Styles, Is.Empty); - Assert.That(analyzeResult.Languages, Is.Empty); - - for (int pageNumber = 1; pageNumber <= analyzeResult.Pages.Count; pageNumber++) - { - var page = analyzeResult.Pages[pageNumber - 1]; - - Assert.That(page.Width, Is.GreaterThan(0f)); - Assert.That(page.Height, Is.GreaterThan(0f)); - Assert.That(page.Unit, Is.Not.EqualTo(default(LengthUnit))); - - Assert.That(page.Words, Is.Empty); - Assert.That(page.SelectionMarks, Is.Empty); - Assert.That(page.Lines, Is.Empty); - Assert.That(page.Barcodes, Is.Empty); - Assert.That(page.Formulas, Is.Empty); - - AssertSingleEmptySpan(page.Spans); - - Assert.That(page.PageNumber, Is.EqualTo(pageNumber)); - } - - int expectedPageNumber = 1; - - foreach (var document in analyzeResult.Documents) - { - Assert.That(document.DocType, Is.Not.Null); - Assert.That(document.DocType, Is.Not.Empty); - Assert.That(document.Fields, Is.Empty); - - AssertSingleEmptySpan(document.Spans); - - foreach (var region in document.BoundingRegions) - { - Assert.That(region.PageNumber, Is.EqualTo(expectedPageNumber++)); - Assert.That(region.Polygon.Count, Is.EqualTo(8)); - } - - Assert.That(document.Confidence, Is.GreaterThanOrEqualTo(0f)); - Assert.That(document.Confidence, Is.LessThanOrEqualTo(1f)); - } - } - - private void ValidateIrs1040ClassifierResult(AnalyzeResult analyzeResult, string classifierId) - { - ValidateGenericClassifierResult(analyzeResult, classifierId); - - Assert.That(analyzeResult.ContentFormat, Is.EqualTo(ContentFormat.Text)); - - Assert.That(analyzeResult.Pages.Count, Is.EqualTo(4)); - - foreach (var page in analyzeResult.Pages) - { - Assert.That(page.Angle, Is.EqualTo(0f).Within(0.05f)); - Assert.That(page.Width, Is.EqualTo(8.5f)); - Assert.That(page.Height, Is.EqualTo(11f)); - Assert.That(page.Unit, Is.EqualTo(LengthUnit.Inch)); - } - - Assert.That(analyzeResult.Documents.Count, Is.EqualTo(1)); - - var document = analyzeResult.Documents.Single(); - - Assert.That(document.DocType, Is.EqualTo("IRS-1040-A")); - Assert.That(document.BoundingRegions.Count, Is.EqualTo(4)); - } - - private void AssertSingleEmptySpan(IReadOnlyList spans) - { - var span = spans.Single(); - - Assert.That(span.Offset, Is.EqualTo(0)); - Assert.That(span.Length, Is.EqualTo(0)); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentAssert.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentAssert.cs deleted file mode 100644 index 8050eaa7d7ee..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentAssert.cs +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Collections.Generic; -using NUnit.Framework; - -namespace Azure.AI.DocumentIntelligence.Tests -{ - internal static class DocumentAssert - { - public static void AreEqual(AzureBlobContentSource expected, AzureBlobContentSource actual) - { - if (expected == null) - { - Assert.That(actual, Is.Null); - return; - } - - Assert.That(actual, Is.Not.Null); - - // The URI returned by the service does not include query parameters, so we're - // making sure they're not included in our comparison. - string expectedContainerUrl = expected.ContainerUrl.GetLeftPart(UriPartial.Path); - string containerUrl = actual.ContainerUrl.GetLeftPart(UriPartial.Path); - - Assert.That(containerUrl, Is.EqualTo(expectedContainerUrl)); - Assert.That(actual.Prefix, Is.EqualTo(expected.Prefix)); - } - - public static void AreEqual(AzureBlobFileListContentSource expected, AzureBlobFileListContentSource actual) - { - if (expected == null) - { - Assert.That(actual, Is.Null); - return; - } - - Assert.That(actual, Is.Not.Null); - - // The URI returned by the service does not include query parameters, so we're - // making sure they're not included in our comparison. - string expectedContainerUrl = expected.ContainerUrl.GetLeftPart(UriPartial.Path); - string containerUrl = actual.ContainerUrl.GetLeftPart(UriPartial.Path); - - Assert.That(containerUrl, Is.EqualTo(expectedContainerUrl)); - Assert.That(actual.FileList, Is.EqualTo(expected.FileList)); - } - - public static void AreEqual(DocumentClassifierDetails expected, DocumentClassifierDetails actual) - { - Assert.AreEqual(expected.ClassifierId, actual.ClassifierId); - Assert.AreEqual(expected.Description, actual.Description); - Assert.AreEqual(expected.ApiVersion, actual.ApiVersion); - Assert.AreEqual(expected.CreatedDateTime, actual.CreatedDateTime); - Assert.AreEqual(expected.ExpirationDateTime, actual.ExpirationDateTime); - - AreEquivalent(expected.DocTypes, actual.DocTypes); - } - - public static void AreEqual(DocumentFieldSchema expected, DocumentFieldSchema actual) - { - if (expected == null) - { - Assert.That(actual, Is.Null); - return; - } - - Assert.That(actual, Is.Not.Null); - - Assert.That(actual.Type, Is.EqualTo(expected.Type)); - Assert.That(actual.Description, Is.EqualTo(expected.Description)); - Assert.That(actual.Example, Is.EqualTo(expected.Example)); - - AreEqual(expected.Items, actual.Items); - AreEquivalent(expected.Properties, actual.Properties); - } - - public static void AreEqual(DocumentModelDetails expected, DocumentModelDetails actual) - { - Assert.That(actual.ModelId, Is.EqualTo(expected.ModelId)); - Assert.That(actual.Description, Is.EqualTo(expected.Description)); - Assert.That(actual.ApiVersion, Is.EqualTo(expected.ApiVersion)); - Assert.That(actual.CreatedDateTime, Is.EqualTo(expected.CreatedDateTime)); - Assert.That(actual.ExpirationDateTime, Is.EqualTo(expected.ExpirationDateTime)); - Assert.That(actual.Tags, Is.EquivalentTo(expected.Tags)); - - AreEqual(expected.AzureBlobSource, actual.AzureBlobSource); - AreEqual(expected.AzureBlobFileListSource, actual.AzureBlobFileListSource); - - AreEquivalent(expected.DocTypes, actual.DocTypes); - } - - public static void AreEqual(DocumentTypeDetails expected, DocumentTypeDetails actual) - { - Assert.That(actual.Description, Is.EqualTo(expected.Description)); - Assert.That(actual.BuildMode, Is.EqualTo(expected.BuildMode)); - Assert.That(actual.FieldConfidence, Is.EquivalentTo(expected.FieldConfidence)); - - AreEquivalent(expected.FieldSchema, actual.FieldSchema); - } - - public static void AreEquivalent(IReadOnlyDictionary expected, IReadOnlyDictionary actual) - { - Assert.That(actual.Count, Is.EqualTo(expected.Count)); - - foreach (string key in expected.Keys) - { - ClassifierDocumentTypeDetails expectedDocType = expected[key]; - ClassifierDocumentTypeDetails docType = actual[key]; - - if (docType.SourceKind != null && expectedDocType.SourceKind != null) - { - Assert.That(docType.SourceKind, Is.EqualTo(expectedDocType.SourceKind)); - } - - AreEqual(docType.AzureBlobSource, expectedDocType.AzureBlobSource); - AreEqual(docType.AzureBlobFileListSource, expectedDocType.AzureBlobFileListSource); - } - } - - public static void AreEquivalent(IReadOnlyDictionary expected, IReadOnlyDictionary actual) - { - Assert.That(actual.Count, Is.EqualTo(expected.Count)); - - foreach (string key in expected.Keys) - { - DocumentFieldSchema expectedFieldSchema = expected[key]; - DocumentFieldSchema fieldSchema = actual[key]; - - AreEqual(expectedFieldSchema, fieldSchema); - } - } - - public static void AreEquivalent(IReadOnlyDictionary expected, IReadOnlyDictionary actual) - { - Assert.That(actual.Count, Is.EqualTo(expected.Count)); - - foreach (string key in expected.Keys) - { - DocumentTypeDetails expectedDocType = expected[key]; - DocumentTypeDetails docType = actual[key]; - - AreEqual(expectedDocType, docType); - } - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentModelAdministrationClient/DocumentClassifierAdministrationLiveTests.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentModelAdministrationClient/DocumentClassifierAdministrationLiveTests.cs deleted file mode 100644 index 10b3ca680e19..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentModelAdministrationClient/DocumentClassifierAdministrationLiveTests.cs +++ /dev/null @@ -1,239 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Collections.Generic; -using System.Net; -using System.Threading.Tasks; -using Azure.Core.TestFramework; -using NUnit.Framework; - -namespace Azure.AI.DocumentIntelligence.Tests -{ - public class DocumentClassifierAdministrationLiveTests : DocumentIntelligenceLiveTestBase - { - public DocumentClassifierAdministrationLiveTests(bool isAsync) - : base(isAsync) - { - } - - #region Build - - [RecordedTest] - public async Task BuildClassifierWithAzureBlobContentSource() - { - var client = CreateDocumentModelAdministrationClient(); - var classifierId = Recording.GenerateId(); - var description = "This classifier was generated by a .NET test."; - var startTime = Recording.UtcNow; - - var containerUrl = new Uri(TestEnvironment.ClassifierTrainingSasUrl); - var sourceA = new AzureBlobContentSource(containerUrl) { Prefix = "IRS-1040-A/train" }; - var sourceB = new AzureBlobContentSource(containerUrl) { Prefix = "IRS-1040-B/train" }; - var docTypeA = new ClassifierDocumentTypeDetails() { AzureBlobSource = sourceA }; - var docTypeB = new ClassifierDocumentTypeDetails() { AzureBlobSource = sourceB }; - var docTypes = new Dictionary() - { - { "IRS-1040-A", docTypeA }, - { "IRS-1040-B", docTypeB } - }; - - var request = new BuildDocumentClassifierRequest(classifierId, docTypes) - { - Description = description - }; - - Operation operation = null; - - try - { - operation = await client.BuildClassifierAsync(WaitUntil.Completed, request); - } - finally - { - if (operation != null && operation.HasCompleted) - { - await client.DeleteClassifierAsync(classifierId); - } - } - - Assert.That(operation.HasCompleted); - Assert.That(operation.HasValue); - - DocumentClassifierDetails classifier = operation.Value; - - Assert.That(classifier.ClassifierId, Is.EqualTo(classifierId)); - Assert.That(classifier.Description, Is.EqualTo(description)); - Assert.That(classifier.ApiVersion, Is.EqualTo(ServiceVersionString)); - Assert.That(classifier.CreatedDateTime, Is.GreaterThan(startTime)); - Assert.That(classifier.ExpirationDateTime, Is.GreaterThan(classifier.CreatedDateTime)); - - DocumentAssert.AreEquivalent(docTypes, classifier.DocTypes); - - foreach (var docType in classifier.DocTypes.Values) - { - Assert.That(docType.SourceKind, Is.Null); - } - } - - [RecordedTest] - public async Task BuildClassifierWithAzureBlobFileListContentSource() - { - var client = CreateDocumentModelAdministrationClient(); - var classifierId = Recording.GenerateId(); - var description = "This classifier was generated by a .NET test."; - var startTime = Recording.UtcNow; - - var containerUrl = new Uri(TestEnvironment.ClassifierTrainingSasUrl); - var sourceA = new AzureBlobFileListContentSource(containerUrl, "IRS-1040-A.jsonl"); - var sourceB = new AzureBlobFileListContentSource(containerUrl, "IRS-1040-B.jsonl"); - var docTypeA = new ClassifierDocumentTypeDetails() { AzureBlobFileListSource = sourceA }; - var docTypeB = new ClassifierDocumentTypeDetails() { AzureBlobFileListSource = sourceB }; - var docTypes = new Dictionary() - { - { "IRS-1040-A", docTypeA }, - { "IRS-1040-B", docTypeB } - }; - - var request = new BuildDocumentClassifierRequest(classifierId, docTypes) - { - Description = description - }; - - Operation operation = null; - - try - { - operation = await client.BuildClassifierAsync(WaitUntil.Completed, request); - } - finally - { - if (operation != null && operation.HasCompleted) - { - await client.DeleteClassifierAsync(classifierId); - } - } - - Assert.That(operation.HasCompleted); - Assert.That(operation.HasValue); - - DocumentClassifierDetails classifier = operation.Value; - - Assert.That(classifier.ClassifierId, Is.EqualTo(classifierId)); - Assert.That(classifier.Description, Is.EqualTo(description)); - Assert.That(classifier.ApiVersion, Is.EqualTo(ServiceVersionString)); - Assert.That(classifier.CreatedDateTime, Is.GreaterThan(startTime)); - Assert.That(classifier.ExpirationDateTime, Is.GreaterThan(classifier.CreatedDateTime)); - - DocumentAssert.AreEquivalent(docTypes, classifier.DocTypes); - - foreach (var docType in classifier.DocTypes.Values) - { - Assert.That(docType.SourceKind, Is.Null); - } - } - - #endregion Build - - #region Get - - [RecordedTest] - public async Task GetClassifier() - { - var client = CreateDocumentModelAdministrationClient(); - var description = "This classifier was generated by a .NET test."; - - await using var disposableClassifier = await BuildDisposableDocumentClassifierAsync(description); - - DocumentClassifierDetails expected = disposableClassifier.Value; - DocumentClassifierDetails classifier = await client.GetClassifierAsync(disposableClassifier.ClassifierId); - - DocumentAssert.AreEqual(expected, classifier); - } - - [RecordedTest] - public void GetClassifierCanParseError() - { - var client = CreateDocumentModelAdministrationClient(); - var classifierId = "00000000-0000-0000-0000-000000000000"; - - RequestFailedException ex = Assert.ThrowsAsync(async () => await client.GetClassifierAsync(classifierId)); - - Assert.That(ex.ErrorCode, Is.EqualTo("NotFound")); - } - - #endregion - - #region List - - [RecordedTest] - public async Task GetClassifiers() - { - var client = CreateDocumentModelAdministrationClient(); - var description = "This classifier was generated by a .NET test."; - - await using var disposableClassifier0 = await BuildDisposableDocumentClassifierAsync(description); - await using var disposableClassifier1 = await BuildDisposableDocumentClassifierAsync(description); - - var expectedIdMapping = new Dictionary() - { - { disposableClassifier0.ClassifierId, disposableClassifier0.Value }, - { disposableClassifier1.ClassifierId, disposableClassifier1.Value } - }; - var idMapping = new Dictionary(); - - await foreach (DocumentClassifierDetails classifier in client.GetClassifiersAsync()) - { - if (expectedIdMapping.ContainsKey(classifier.ClassifierId)) - { - idMapping.Add(classifier.ClassifierId, classifier); - } - - if (idMapping.Count == expectedIdMapping.Count) - { - break; - } - } - - Assert.That(idMapping.Count, Is.EqualTo(expectedIdMapping.Count)); - - foreach (string id in expectedIdMapping.Keys) - { - Assert.That(idMapping, Contains.Key(id)); - - DocumentClassifierDetails expected = expectedIdMapping[id]; - DocumentClassifierDetails classifier = idMapping[id]; - - DocumentAssert.AreEqual(expected, classifier); - } - } - - #endregion List - - #region Delete - - [RecordedTest] - public async Task DeleteClassifier() - { - var client = CreateDocumentModelAdministrationClient(); - - var disposableClassifier = await BuildDisposableDocumentClassifierAsync(); - var response = await client.DeleteClassifierAsync(disposableClassifier.ClassifierId); - - Assert.That(response.Status, Is.EqualTo((int)HttpStatusCode.NoContent)); - } - - [RecordedTest] - public void DeleteClassifierCanParseError() - { - var client = CreateDocumentModelAdministrationClient(); - var classifierId = "00000000-0000-0000-0000-000000000000"; - - RequestFailedException ex = Assert.ThrowsAsync(async () => await client.DeleteClassifierAsync(classifierId)); - - Assert.That(ex.ErrorCode, Is.EqualTo("NotFound")); - } - - #endregion Delete - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentModelAdministrationClient/DocumentModelAdministrationLiveTests.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentModelAdministrationClient/DocumentModelAdministrationLiveTests.cs deleted file mode 100644 index 5eabda55c38f..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentModelAdministrationClient/DocumentModelAdministrationLiveTests.cs +++ /dev/null @@ -1,428 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Collections.Generic; -using System.Net; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core.TestFramework; -using NUnit.Framework; - -namespace Azure.AI.DocumentIntelligence.Tests -{ - public class DocumentModelAdministrationLiveTests : DocumentIntelligenceLiveTestBase - { - private static readonly DocumentBuildMode[] s_buildDocumentModelTestCases = new[] - { - DocumentBuildMode.Template, - DocumentBuildMode.Neural - }; - - public DocumentModelAdministrationLiveTests(bool isAsync) - : base(isAsync) - { - } - - #region Build - - [RecordedTest] - [TestCaseSource(nameof(s_buildDocumentModelTestCases))] - public async Task BuildDocumentModelWithAzureBlobContentSource(DocumentBuildMode buildMode) - { - if (buildMode == DocumentBuildMode.Neural && Recording.Mode == RecordedTestMode.Live) - { - // Test takes too long to finish running, and seems to cause multiple failures in our - // live test pipeline. For this reason, this test is ignored when running in Live mode. - Assert.Ignore(); - } - - var client = CreateDocumentModelAdministrationClient(); - var modelId = Recording.GenerateId(); - var description = "This classifier was generated by a .NET test."; - var startTime = Recording.UtcNow; - - var containerUrl = new Uri(TestEnvironment.BlobContainerSasUrl); - var prefix = "subfolder"; - var source = new AzureBlobContentSource(containerUrl) { Prefix = prefix }; - - var request = new BuildDocumentModelRequest(modelId, buildMode) - { - AzureBlobSource = source, - Description = description, - Tags = { { "tag1", "value1" }, { "tag2", "value2" } } - }; - - Operation operation = null; - - try - { - operation = await client.BuildDocumentModelAsync(WaitUntil.Started, request); - - await (buildMode == DocumentBuildMode.Neural - ? operation.WaitForCompletionAsync(TimeSpan.FromMinutes(1), CancellationToken.None) - : operation.WaitForCompletionAsync()); - } - finally - { - if (operation != null && operation.HasCompleted) - { - await client.DeleteModelAsync(modelId); - } - } - - Assert.That(operation.HasCompleted); - Assert.That(operation.HasValue); - - DocumentModelDetails model = operation.Value; - - Assert.That(model.ModelId, Is.EqualTo(modelId)); - Assert.That(model.Description, Is.EqualTo(description)); - Assert.That(model.ApiVersion, Is.EqualTo(ServiceVersionString)); - - // Add a 4-hour tolerance because the model could have been cached before this test. - Assert.That(model.CreatedDateTime, Is.GreaterThan(startTime - TimeSpan.FromHours(4))); - Assert.That(model.ExpirationDateTime, Is.GreaterThan(model.CreatedDateTime)); - Assert.That(model.Tags, Is.EquivalentTo(request.Tags)); - - Assert.That(model.AzureBlobSource, Is.Null); - Assert.That(model.AzureBlobFileListSource, Is.Null); - - Assert.That(model.DocTypes.Count, Is.EqualTo(1)); - Assert.That(model.DocTypes.ContainsKey(modelId)); - - DocumentTypeDetails docType = model.DocTypes[modelId]; - - Assert.That(docType.Description, Is.Null); - Assert.That(docType.BuildMode, Is.EqualTo(buildMode)); - - if (buildMode == DocumentBuildMode.Template) - { - Assert.That(docType.FieldConfidence.Keys, Is.EquivalentTo(docType.FieldSchema.Keys)); - - foreach (float confidence in docType.FieldConfidence.Values) - { - Assert.That(confidence, Is.GreaterThanOrEqualTo(0f)); - Assert.That(confidence, Is.LessThanOrEqualTo(1f)); - } - } - else - { - Assert.That(docType.FieldConfidence, Is.Empty); - } - - foreach (DocumentFieldSchema fieldSchema in docType.FieldSchema.Values) - { - Assert.That(fieldSchema.Description, Is.Null); - Assert.That(fieldSchema.Example, Is.Null); - Assert.That(fieldSchema.Items, Is.Null); - Assert.That(fieldSchema.Properties, Is.Empty); - } - - DocumentFieldSchema merchantSchema = docType.FieldSchema["Merchant"]; - DocumentFieldSchema quantitySchema = docType.FieldSchema["Quantity"]; - - Assert.That(merchantSchema.Type, Is.EqualTo(DocumentFieldType.String)); - Assert.That(quantitySchema.Type, Is.EqualTo(DocumentFieldType.Number)); - } - - [RecordedTest] - public void BuildDocumentModelCanParseError() - { - var client = CreateDocumentModelAdministrationClient(); - var modelId = Recording.GenerateId(); - - var containerUrl = new Uri(TestEnvironment.BlobContainerSasUrl); - var prefix = "testfolder"; // folder exists but most training files are missing - var source = new AzureBlobContentSource(containerUrl) { Prefix = prefix }; - - var request = new BuildDocumentModelRequest(modelId, DocumentBuildMode.Template) - { - AzureBlobSource = source - }; - - RequestFailedException ex = Assert.ThrowsAsync(async () => await client.BuildDocumentModelAsync(WaitUntil.Started, request)); - - Assert.That(ex.ErrorCode, Is.EqualTo("InvalidRequest")); - } - - #endregion Build - - #region Copy - - [RecordedTest] - public async Task CopyModelTo() - { - var client = CreateDocumentModelAdministrationClient(); - var modelId = Recording.GenerateId(); - var description = "This model was generated by a .NET test."; - var tags = new Dictionary() { { "tag1", "value1" }, { "tag2", "value2" } }; - var startTime = Recording.UtcNow; - - await using var disposableModel = await BuildDisposableDocumentModelAsync(TestEnvironment.BlobContainerSasUrl); - - var authorizeCopyRequest = new AuthorizeCopyRequest(modelId, description, tags); - - CopyAuthorization copyAuthorization = await client.AuthorizeModelCopyAsync(authorizeCopyRequest); - - Operation operation = null; - - try - { - operation = await client.CopyModelToAsync(WaitUntil.Completed, disposableModel.ModelId, copyAuthorization); - } - finally - { - if (operation != null && operation.HasCompleted) - { - await client.DeleteModelAsync(modelId); - } - } - - Assert.That(operation.HasCompleted); - Assert.That(operation.HasValue); - - DocumentModelDetails sourceModel = disposableModel.Value; - DocumentModelDetails model = operation.Value; - - Assert.That(model.ModelId, Is.EqualTo(modelId)); - Assert.That(model.Description, Is.EqualTo(description)); - Assert.That(model.ApiVersion, Is.EqualTo(ServiceVersionString)); - - // Add a 4-hour tolerance because the model could have been cached before this test. - Assert.That(model.CreatedDateTime, Is.GreaterThan(startTime - TimeSpan.FromHours(4))); - Assert.That(model.ExpirationDateTime, Is.GreaterThan(model.CreatedDateTime)); - Assert.That(model.Tags, Is.EquivalentTo(tags)); - - Assert.That(model.AzureBlobSource, Is.Null); - Assert.That(model.AzureBlobFileListSource, Is.Null); - - // TODO: reenable validation once the following service issue has been fixed: https://github.com/Azure/azure-sdk-for-net/issues/37172 - // DocumentAssert.AreEquivalent(sourceModel.DocTypes, model.DocTypes); - } - - #endregion Copy - - #region Compose - - [RecordedTest] - public async Task ComposeModel() - { - var client = CreateDocumentModelAdministrationClient(); - var modelId = Recording.GenerateId(); - var description = "This model was generated by a .NET test."; - var startTime = Recording.UtcNow; - - // Note: this will fail once we implement model caching. We'll need to set different containers to make it work. - await using var disposableModel0 = await BuildDisposableDocumentModelAsync(TestEnvironment.BlobContainerSasUrl); - await using var disposableModel1 = await BuildDisposableDocumentModelAsync(TestEnvironment.BlobContainerSasUrl); - - var componentModels = new List() - { - new ComponentDocumentModelDetails(disposableModel0.ModelId), - new ComponentDocumentModelDetails(disposableModel1.ModelId) - }; - - var request = new ComposeDocumentModelRequest(modelId, componentModels) - { - Description = description, - Tags = { { "tag1", "value1" }, { "tag2", "value2" } } - }; - - Operation operation = null; - - try - { - operation = await client.ComposeModelAsync(WaitUntil.Completed, request); - } - finally - { - if (operation != null && operation.HasCompleted) - { - await client.DeleteModelAsync(modelId); - } - } - - Assert.That(operation.HasCompleted); - Assert.That(operation.HasValue); - - DocumentModelDetails componentModel0 = disposableModel0.Value; - DocumentModelDetails componentModel1 = disposableModel1.Value; - DocumentModelDetails model = operation.Value; - - Assert.That(model.ModelId, Is.EqualTo(modelId)); - Assert.That(model.Description, Is.EqualTo(description)); - Assert.That(model.ApiVersion, Is.EqualTo(ServiceVersionString)); - - // Add a 4-hour tolerance because the model could have been cached before this test. - Assert.That(model.CreatedDateTime, Is.GreaterThan(startTime - TimeSpan.FromHours(4))); - Assert.That(model.ExpirationDateTime, Is.GreaterThan(model.CreatedDateTime)); - Assert.That(model.Tags, Is.EquivalentTo(request.Tags)); - - Assert.That(model.AzureBlobSource, Is.Null); - Assert.That(model.AzureBlobFileListSource, Is.Null); - - Assert.That(model.DocTypes.Count, Is.EqualTo(2)); - - DocumentTypeDetails expectedDocType0 = componentModel0.DocTypes[componentModel0.ModelId]; - DocumentTypeDetails expectedDocType1 = componentModel1.DocTypes[componentModel1.ModelId]; - DocumentTypeDetails docType0 = model.DocTypes[componentModel0.ModelId]; - DocumentTypeDetails docType1 = model.DocTypes[componentModel1.ModelId]; - - DocumentAssert.AreEqual(expectedDocType0, docType0); - DocumentAssert.AreEqual(expectedDocType1, docType1); - } - - [RecordedTest] - public void ComposeModelCanParseError() - { - var client = CreateDocumentModelAdministrationClient(); - var modelId = Recording.GenerateId(); - - var componentModels = new List() - { - new ComponentDocumentModelDetails("00000000-0000-0000-0000-000000000000"), - new ComponentDocumentModelDetails("00000000-0000-0000-0000-000000000001") - }; - - var request = new ComposeDocumentModelRequest(modelId, componentModels); - - RequestFailedException ex = Assert.ThrowsAsync(async () => await client.ComposeModelAsync(WaitUntil.Started, request)); - - Assert.That(ex.ErrorCode, Is.EqualTo("InvalidRequest")); - } - - #endregion Compose - - #region Get - - [RecordedTest] - public async Task GetModel() - { - var client = CreateDocumentModelAdministrationClient(); - var description = "This model was generated by a .NET test."; - var tags = new Dictionary() { { "tag1", "value1" }, { "tag2", "value2" } }; - - await using var disposableModel = await BuildDisposableDocumentModelAsync(TestEnvironment.BlobContainerSasUrl, description, tags); - - DocumentModelDetails expected = disposableModel.Value; - DocumentModelDetails model = await client.GetModelAsync(disposableModel.ModelId); - - DocumentAssert.AreEqual(expected, model); - } - - [RecordedTest] - public void GetModelCanParseError() - { - var client = CreateDocumentModelAdministrationClient(); - var modelId = "00000000-0000-0000-0000-000000000000"; - - RequestFailedException ex = Assert.ThrowsAsync(async () => await client.GetModelAsync(modelId)); - - Assert.That(ex.ErrorCode, Is.EqualTo("NotFound")); - } - - #endregion Get - - #region List - - [RecordedTest] - public async Task GetModels() - { - var client = CreateDocumentModelAdministrationClient(); - var description = "This model was generated by a .NET test."; - var tags = new Dictionary() { { "tag1", "value1" }, { "tag2", "value2" } }; - - // Once model caching is implemented, we should make the models slightly different to make sure the cache won't return copies of the same model. - await using var disposableModel0 = await BuildDisposableDocumentModelAsync(TestEnvironment.BlobContainerSasUrl, description, tags); - await using var disposableModel1 = await BuildDisposableDocumentModelAsync(TestEnvironment.BlobContainerSasUrl, description, tags); - - var expectedIdMapping = new Dictionary() - { - { disposableModel0.ModelId, disposableModel0.Value }, - { disposableModel1.ModelId, disposableModel1.Value } - }; - var idMapping = new Dictionary(); - - await foreach (DocumentModelDetails model in client.GetModelsAsync()) - { - if (expectedIdMapping.ContainsKey(model.ModelId)) - { - idMapping.Add(model.ModelId, model); - } - - if (idMapping.Count == expectedIdMapping.Count) - { - break; - } - } - - Assert.That(idMapping.Count, Is.EqualTo(expectedIdMapping.Count)); - - foreach (string id in expectedIdMapping.Keys) - { - Assert.That(idMapping, Contains.Key(id)); - - DocumentModelDetails expected = expectedIdMapping[id]; - DocumentModelDetails model = idMapping[id]; - - Assert.That(model.ModelId, Is.EqualTo(expected.ModelId)); - Assert.That(model.Description, Is.EqualTo(expected.Description)); - Assert.That(model.ApiVersion, Is.EqualTo(expected.ApiVersion)); - Assert.That(model.CreatedDateTime, Is.EqualTo(expected.CreatedDateTime)); - Assert.That(model.ExpirationDateTime, Is.EqualTo(expected.ExpirationDateTime)); - Assert.That(model.Tags, Is.EquivalentTo(expected.Tags)); - - Assert.That(model.AzureBlobSource, Is.Null); - Assert.That(model.AzureBlobFileListSource, Is.Null); - Assert.That(model.DocTypes, Is.Empty); - } - } - - #endregion List - - #region Delete - - [RecordedTest] - public async Task DeleteModel() - { - var client = CreateDocumentModelAdministrationClient(); - - // Once model caching is implemented, make sure we don't cache the model we'll delete, otherwise this may affect other tests. - var disposableModel = await BuildDisposableDocumentModelAsync(TestEnvironment.BlobContainerSasUrl); - var response = await client.DeleteModelAsync(disposableModel.ModelId); - - Assert.That(response.Status, Is.EqualTo((int)HttpStatusCode.NoContent)); - } - - [RecordedTest] - public void DeleteModelCanParseError() - { - var client = CreateDocumentModelAdministrationClient(); - var modelId = "00000000-0000-0000-0000-000000000000"; - - RequestFailedException ex = Assert.ThrowsAsync(async () => await client.DeleteModelAsync(modelId)); - - Assert.That(ex.ErrorCode, Is.EqualTo("NotFound")); - } - - #endregion Delete - - [RecordedTest] - public async Task AuthorizeModelCopy() - { - var client = CreateDocumentModelAdministrationClient(); - var modelId = Recording.GenerateId(); - var request = new AuthorizeCopyRequest(modelId); - - CopyAuthorization copyAuthorization = await client.AuthorizeModelCopyAsync(request); - - Assert.That(copyAuthorization.TargetModelId, Is.EqualTo(modelId)); - Assert.That(copyAuthorization.TargetResourceId, Is.EqualTo(TestEnvironment.ResourceId)); - Assert.That(copyAuthorization.TargetResourceRegion, Is.EqualTo(TestEnvironment.ResourceRegion)); - Assert.That(copyAuthorization.AccessToken, Is.Not.Null); - Assert.That(copyAuthorization.AccessToken, Is.Not.Empty); - Assert.That(copyAuthorization.ExpirationDateTime, Is.GreaterThan(Recording.UtcNow)); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentModelAdministrationClient/MiscellaneousOperationsLiveTests.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentModelAdministrationClient/MiscellaneousOperationsLiveTests.cs deleted file mode 100644 index 0542099db620..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentModelAdministrationClient/MiscellaneousOperationsLiveTests.cs +++ /dev/null @@ -1,191 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Azure.Core.TestFramework; -using NUnit.Framework; - -namespace Azure.AI.DocumentIntelligence.Tests -{ - public class MiscellaneousOperationsLiveTests : DocumentIntelligenceLiveTestBase - { - public MiscellaneousOperationsLiveTests(bool isAsync) - : base(isAsync) - { - } - - #region Resource Info - - [RecordedTest] - public async Task GetResourceInfo() - { - var client = CreateDocumentModelAdministrationClient(); - var startTime = Recording.UtcNow; - - // Ensure we will have at least one custom model to populate the resource details. - await using var disposableModel = await BuildDisposableDocumentModelAsync(TestEnvironment.BlobContainerSasUrl); - - ResourceDetails resourceDetails = await client.GetResourceInfoAsync(); - - Assert.That(resourceDetails.CustomDocumentModels, Is.Not.Null); - Assert.That(resourceDetails.CustomDocumentModels.Count, Is.GreaterThan(0)); - Assert.That(resourceDetails.CustomDocumentModels.Limit, Is.GreaterThanOrEqualTo(resourceDetails.CustomDocumentModels.Count)); - - Assert.That(resourceDetails.CustomNeuralDocumentModelBuilds, Is.Not.Null); - Assert.That(resourceDetails.CustomNeuralDocumentModelBuilds.Used, Is.GreaterThanOrEqualTo(0)); - Assert.That(resourceDetails.CustomNeuralDocumentModelBuilds.Quota, Is.GreaterThanOrEqualTo(resourceDetails.CustomNeuralDocumentModelBuilds.Used)); - Assert.That(resourceDetails.CustomNeuralDocumentModelBuilds.QuotaResetDateTime, Is.GreaterThan(startTime)); - } - - #endregion Resource Info - - #region Get Operation - - [RecordedTest] - [Ignore("Calling Operation.Id throws a NotSupportedException: https://github.com/Azure/autorest.csharp/issues/2158")] - public async Task GetOperationWithDocumentModelBuild() - { - var client = CreateDocumentModelAdministrationClient(); - var description = "This model was generated by a .NET test."; - var tags = new Dictionary() { { "tag1", "value1" }, { "tag2", "value2" } }; - var startTime = Recording.UtcNow; - - await using var disposableModel = await BuildDisposableDocumentModelAsync(TestEnvironment.BlobContainerSasUrl, description, tags); - - var operationId = new Guid(disposableModel.Operation.Id); - - OperationDetails operationDetails = await client.GetOperationAsync(operationId); - - var resourceLocation = $"{TestEnvironment.Endpoint}formrecognizer/documentModels/{disposableModel.ModelId}?api-version={ServiceVersionString}"; - - ValidateOperationDetails(operationDetails, operationId, resourceLocation, startTime, tags); - - var buildOperationDetails = operationDetails as DocumentModelBuildOperationDetails; - - Assert.That(buildOperationDetails, Is.Not.Null); - - DocumentAssert.AreEqual(disposableModel.Value, buildOperationDetails.Result); - } - - [RecordedTest] - [Ignore("Calling Operation.Id throws a NotSupportedException: https://github.com/Azure/autorest.csharp/issues/2158")] - public async Task GetOperationWithDocumentClassifierBuild() - { - var client = CreateDocumentModelAdministrationClient(); - var description = "This model was generated by a .NET test."; - var tags = new Dictionary(); - var startTime = Recording.UtcNow; - - await using var disposableClassifier = await BuildDisposableDocumentClassifierAsync(description); - - var operationId = new Guid(disposableClassifier.ClassifierId); - - OperationDetails operationDetails = await client.GetOperationAsync(operationId); - - var resourceLocation = $"{TestEnvironment.Endpoint}formrecognizer/documentClassifiers/{disposableClassifier.ClassifierId}?api-version={ServiceVersionString}"; - - ValidateOperationDetails(operationDetails, operationId, resourceLocation, startTime, tags); - - var buildOperationDetails = operationDetails as DocumentClassifierBuildOperationDetails; - - Assert.That(buildOperationDetails, Is.Not.Null); - - DocumentAssert.AreEqual(disposableClassifier.Value, buildOperationDetails.Result); - } - - [RecordedTest] - public void GetOperationCanParseError() - { - var client = CreateDocumentModelAdministrationClient(); - var operationId = new Guid("00000000-0000-0000-0000-000000000000"); - - RequestFailedException ex = Assert.ThrowsAsync(() => client.GetOperationAsync(operationId)); - - Assert.That(ex.ErrorCode, Is.EqualTo("NotFound")); - } - - #endregion Get Operation - - #region List Operations - - [RecordedTest] - [Ignore("Calling Operation.Id throws a NotSupportedException: https://github.com/Azure/autorest.csharp/issues/2158")] - public async Task GetOperations() - { - var client = CreateDocumentModelAdministrationClient(); - var description = "This model was generated by a .NET test."; - var tags = new Dictionary() { { "tag1", "value1" }, { "tag2", "value2" } }; - - // Once model caching is implemented, we should make the models slightly different to make sure the cache won't return copies of the same model. - await using var disposableModel0 = await BuildDisposableDocumentModelAsync(TestEnvironment.BlobContainerSasUrl, description, tags); - await using var disposableModel1 = await BuildDisposableDocumentModelAsync(TestEnvironment.BlobContainerSasUrl, description, tags); - - var operationId0 = new Guid(disposableModel0.Operation.Id); - var operationId1 = new Guid(disposableModel1.Operation.Id); - - OperationDetails expectedOperation0 = await client.GetOperationAsync(operationId0); - OperationDetails expectedOperation1 = await client.GetOperationAsync(operationId1); - - var expectedIdMapping = new Dictionary() - { - { operationId0, expectedOperation0 }, - { operationId1, expectedOperation1 } - }; - var idMapping = new Dictionary(); - - await foreach (OperationDetails operation in client.GetOperationsAsync()) - { - if (expectedIdMapping.ContainsKey(operation.OperationId)) - { - idMapping.Add(operation.OperationId, operation); - } - - if (idMapping.Count == expectedIdMapping.Count) - { - break; - } - } - - Assert.That(idMapping.Count, Is.EqualTo(expectedIdMapping.Count)); - - foreach (Guid id in expectedIdMapping.Keys) - { - Assert.That(idMapping, Contains.Key(id)); - - OperationDetails expected = expectedIdMapping[id]; - OperationDetails operation = idMapping[id]; - - Assert.That(operation.OperationId, Is.EqualTo(expected.OperationId)); - Assert.That(operation.ApiVersion, Is.EqualTo(expected.ApiVersion)); - Assert.That(operation.Status, Is.EqualTo(expected.Status)); - Assert.That(operation.PercentCompleted, Is.EqualTo(expected.PercentCompleted)); - Assert.That(operation.ResourceLocation.AbsoluteUri, Is.EqualTo(expected.ResourceLocation.AbsoluteUri)); - Assert.That(operation.CreatedDateTime, Is.EqualTo(expected.CreatedDateTime)); - Assert.That(operation.LastUpdatedDateTime, Is.EqualTo(expected.LastUpdatedDateTime)); - Assert.That(operation.Tags, Is.EquivalentTo(expected.Tags)); - - Assert.That(operation.Error, Is.Null); - } - } - - #endregion List Operations - - private void ValidateOperationDetails(OperationDetails operationDetails, Guid operationId, string resourceLocation, DateTimeOffset startTime, IDictionary tags) - { - Assert.That(operationDetails.OperationId, Is.EqualTo(operationId)); - Assert.That(operationDetails.Status, Is.EqualTo(OperationStatus.Succeeded)); - Assert.That(operationDetails.PercentCompleted, Is.EqualTo(100)); - Assert.That(operationDetails.ResourceLocation.AbsoluteUri, Is.EqualTo(resourceLocation)); - - Assert.That(operationDetails.ApiVersion, Is.Null); - Assert.That(operationDetails.Error, Is.Null); - - // Add a 4-hour tolerance because the model could have been cached before this test. - Assert.That(operationDetails.CreatedDateTime, Is.GreaterThan(startTime - TimeSpan.FromHours(4))); - Assert.That(operationDetails.LastUpdatedDateTime, Is.GreaterThan(operationDetails.CreatedDateTime)); - Assert.That(operationDetails.Tags, Is.EquivalentTo(tags)); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Generated/Samples/Samples_DocumentAnalysisClient.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Generated/Samples/Samples_DocumentAnalysisClient.cs deleted file mode 100644 index 040217ef026d..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Generated/Samples/Samples_DocumentAnalysisClient.cs +++ /dev/null @@ -1,1103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading.Tasks; -using Azure; -using Azure.AI.DocumentIntelligence; -using Azure.Core; -using Azure.Identity; -using NUnit.Framework; - -namespace Azure.AI.DocumentIntelligence.Samples -{ - public partial class Samples_DocumentAnalysisClient - { - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeDocument_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentAnalysisClient client = new DocumentAnalysisClient(endpoint, credential); - - using RequestContent content = null; - Operation operation = client.AnalyzeDocument(WaitUntil.Completed, "", content); - BinaryData responseData = operation.Value; - - JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("apiVersion").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("stringIndexType").ToString()); - Console.WriteLine(result.GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeDocument_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentAnalysisClient client = new DocumentAnalysisClient(endpoint, credential); - - using RequestContent content = null; - Operation operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "", content); - BinaryData responseData = operation.Value; - - JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("apiVersion").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("stringIndexType").ToString()); - Console.WriteLine(result.GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeDocument_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentAnalysisClient client = new DocumentAnalysisClient(endpoint, credential); - - Operation operation = client.AnalyzeDocument(WaitUntil.Completed, ""); - AnalyzeResult responseData = operation.Value; - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeDocument_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentAnalysisClient client = new DocumentAnalysisClient(endpoint, credential); - - Operation operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, ""); - AnalyzeResult responseData = operation.Value; - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeDocument_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentAnalysisClient client = new DocumentAnalysisClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new - { - urlSource = "http://localhost:3000", - base64Source = new object(), - }); - Operation operation = client.AnalyzeDocument(WaitUntil.Completed, "", content, pages: "", locale: "", stringIndexType: "textElements", features: new DocumentAnalysisFeature[] { DocumentAnalysisFeature.OcrHighResolution }, queryFields: new string[] { "" }, outputContentFormat: "text"); - BinaryData responseData = operation.Value; - - JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("apiVersion").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("stringIndexType").ToString()); - Console.WriteLine(result.GetProperty("contentFormat").ToString()); - Console.WriteLine(result.GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("angle").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("width").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("height").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("unit").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("words")[0].GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("words")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("words")[0].GetProperty("span").GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("words")[0].GetProperty("span").GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("words")[0].GetProperty("confidence").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("selectionMarks")[0].GetProperty("state").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("selectionMarks")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("selectionMarks")[0].GetProperty("span").GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("selectionMarks")[0].GetProperty("span").GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("selectionMarks")[0].GetProperty("confidence").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("lines")[0].GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("lines")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("lines")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("lines")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("barcodes")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("barcodes")[0].GetProperty("value").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("barcodes")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("barcodes")[0].GetProperty("span").GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("barcodes")[0].GetProperty("span").GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("barcodes")[0].GetProperty("confidence").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("formulas")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("formulas")[0].GetProperty("value").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("formulas")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("formulas")[0].GetProperty("span").GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("formulas")[0].GetProperty("span").GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("formulas")[0].GetProperty("confidence").ToString()); - Console.WriteLine(result.GetProperty("paragraphs")[0].GetProperty("role").ToString()); - Console.WriteLine(result.GetProperty("paragraphs")[0].GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("paragraphs")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("paragraphs")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("paragraphs")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("paragraphs")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("rowCount").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("columnCount").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("rowIndex").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("columnIndex").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("rowSpan").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("columnSpan").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("elements")[0].ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("caption").GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("caption").GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("caption").GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("caption").GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("caption").GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("caption").GetProperty("elements")[0].ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("footnotes")[0].GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("footnotes")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("footnotes")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("footnotes")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("footnotes")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("footnotes")[0].GetProperty("elements")[0].ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("elements")[0].ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("caption").GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("caption").GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("caption").GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("caption").GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("caption").GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("caption").GetProperty("elements")[0].ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("footnotes")[0].GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("footnotes")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("footnotes")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("footnotes")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("footnotes")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("footnotes")[0].GetProperty("elements")[0].ToString()); - Console.WriteLine(result.GetProperty("lists")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("lists")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("level").ToString()); - Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("elements")[0].ToString()); - Console.WriteLine(result.GetProperty("sections")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("sections")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("sections")[0].GetProperty("elements")[0].ToString()); - Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("key").GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("key").GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("key").GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("key").GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("key").GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("value").GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("value").GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("value").GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("value").GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("value").GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("confidence").ToString()); - Console.WriteLine(result.GetProperty("styles")[0].GetProperty("isHandwritten").ToString()); - Console.WriteLine(result.GetProperty("styles")[0].GetProperty("similarFontFamily").ToString()); - Console.WriteLine(result.GetProperty("styles")[0].GetProperty("fontStyle").ToString()); - Console.WriteLine(result.GetProperty("styles")[0].GetProperty("fontWeight").ToString()); - Console.WriteLine(result.GetProperty("styles")[0].GetProperty("color").ToString()); - Console.WriteLine(result.GetProperty("styles")[0].GetProperty("backgroundColor").ToString()); - Console.WriteLine(result.GetProperty("styles")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("styles")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("styles")[0].GetProperty("confidence").ToString()); - Console.WriteLine(result.GetProperty("languages")[0].GetProperty("locale").ToString()); - Console.WriteLine(result.GetProperty("languages")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("languages")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("languages")[0].GetProperty("confidence").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("docType").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("type").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueString").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueDate").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueTime").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valuePhoneNumber").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueNumber").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueInteger").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueSelectionMark").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueSignature").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueCountryRegion").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("type").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueString").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueDate").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueTime").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valuePhoneNumber").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueNumber").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueInteger").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueSelectionMark").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueSignature").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueCountryRegion").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueCurrency").GetProperty("amount").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueCurrency").GetProperty("currencySymbol").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueCurrency").GetProperty("currencyCode").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("houseNumber").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("poBox").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("road").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("city").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("state").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("postalCode").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("countryRegion").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("streetAddress").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("unit").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("cityDistrict").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("stateDistrict").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("suburb").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("house").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("level").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueBoolean").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("confidence").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueCurrency").GetProperty("amount").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueCurrency").GetProperty("currencySymbol").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueCurrency").GetProperty("currencyCode").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("houseNumber").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("poBox").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("road").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("city").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("state").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("postalCode").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("countryRegion").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("streetAddress").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("unit").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("cityDistrict").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("stateDistrict").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("suburb").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("house").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("level").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueBoolean").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("confidence").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("confidence").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeDocument_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentAnalysisClient client = new DocumentAnalysisClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new - { - urlSource = "http://localhost:3000", - base64Source = new object(), - }); - Operation operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "", content, pages: "", locale: "", stringIndexType: "textElements", features: new DocumentAnalysisFeature[] { DocumentAnalysisFeature.OcrHighResolution }, queryFields: new string[] { "" }, outputContentFormat: "text"); - BinaryData responseData = operation.Value; - - JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("apiVersion").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("stringIndexType").ToString()); - Console.WriteLine(result.GetProperty("contentFormat").ToString()); - Console.WriteLine(result.GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("angle").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("width").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("height").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("unit").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("words")[0].GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("words")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("words")[0].GetProperty("span").GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("words")[0].GetProperty("span").GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("words")[0].GetProperty("confidence").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("selectionMarks")[0].GetProperty("state").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("selectionMarks")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("selectionMarks")[0].GetProperty("span").GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("selectionMarks")[0].GetProperty("span").GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("selectionMarks")[0].GetProperty("confidence").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("lines")[0].GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("lines")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("lines")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("lines")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("barcodes")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("barcodes")[0].GetProperty("value").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("barcodes")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("barcodes")[0].GetProperty("span").GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("barcodes")[0].GetProperty("span").GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("barcodes")[0].GetProperty("confidence").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("formulas")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("formulas")[0].GetProperty("value").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("formulas")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("formulas")[0].GetProperty("span").GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("formulas")[0].GetProperty("span").GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("formulas")[0].GetProperty("confidence").ToString()); - Console.WriteLine(result.GetProperty("paragraphs")[0].GetProperty("role").ToString()); - Console.WriteLine(result.GetProperty("paragraphs")[0].GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("paragraphs")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("paragraphs")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("paragraphs")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("paragraphs")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("rowCount").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("columnCount").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("rowIndex").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("columnIndex").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("rowSpan").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("columnSpan").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("elements")[0].ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("caption").GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("caption").GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("caption").GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("caption").GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("caption").GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("caption").GetProperty("elements")[0].ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("footnotes")[0].GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("footnotes")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("footnotes")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("footnotes")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("footnotes")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("footnotes")[0].GetProperty("elements")[0].ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("elements")[0].ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("caption").GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("caption").GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("caption").GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("caption").GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("caption").GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("caption").GetProperty("elements")[0].ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("footnotes")[0].GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("footnotes")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("footnotes")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("footnotes")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("footnotes")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("footnotes")[0].GetProperty("elements")[0].ToString()); - Console.WriteLine(result.GetProperty("lists")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("lists")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("level").ToString()); - Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("elements")[0].ToString()); - Console.WriteLine(result.GetProperty("sections")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("sections")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("sections")[0].GetProperty("elements")[0].ToString()); - Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("key").GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("key").GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("key").GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("key").GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("key").GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("value").GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("value").GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("value").GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("value").GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("value").GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("confidence").ToString()); - Console.WriteLine(result.GetProperty("styles")[0].GetProperty("isHandwritten").ToString()); - Console.WriteLine(result.GetProperty("styles")[0].GetProperty("similarFontFamily").ToString()); - Console.WriteLine(result.GetProperty("styles")[0].GetProperty("fontStyle").ToString()); - Console.WriteLine(result.GetProperty("styles")[0].GetProperty("fontWeight").ToString()); - Console.WriteLine(result.GetProperty("styles")[0].GetProperty("color").ToString()); - Console.WriteLine(result.GetProperty("styles")[0].GetProperty("backgroundColor").ToString()); - Console.WriteLine(result.GetProperty("styles")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("styles")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("styles")[0].GetProperty("confidence").ToString()); - Console.WriteLine(result.GetProperty("languages")[0].GetProperty("locale").ToString()); - Console.WriteLine(result.GetProperty("languages")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("languages")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("languages")[0].GetProperty("confidence").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("docType").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("type").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueString").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueDate").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueTime").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valuePhoneNumber").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueNumber").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueInteger").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueSelectionMark").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueSignature").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueCountryRegion").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("type").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueString").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueDate").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueTime").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valuePhoneNumber").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueNumber").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueInteger").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueSelectionMark").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueSignature").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueCountryRegion").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueCurrency").GetProperty("amount").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueCurrency").GetProperty("currencySymbol").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueCurrency").GetProperty("currencyCode").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("houseNumber").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("poBox").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("road").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("city").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("state").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("postalCode").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("countryRegion").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("streetAddress").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("unit").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("cityDistrict").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("stateDistrict").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("suburb").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("house").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("level").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueBoolean").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("confidence").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueCurrency").GetProperty("amount").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueCurrency").GetProperty("currencySymbol").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueCurrency").GetProperty("currencyCode").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("houseNumber").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("poBox").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("road").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("city").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("state").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("postalCode").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("countryRegion").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("streetAddress").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("unit").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("cityDistrict").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("stateDistrict").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("suburb").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("house").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("level").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueBoolean").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("confidence").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("confidence").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeDocument_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentAnalysisClient client = new DocumentAnalysisClient(endpoint, credential); - - AnalyzeDocumentRequest analyzeRequest = new AnalyzeDocumentRequest - { - UrlSource = new Uri("http://localhost:3000"), - Base64Source = BinaryData.FromObjectAsJson(new object()), - }; - Operation operation = client.AnalyzeDocument(WaitUntil.Completed, "", analyzeRequest: analyzeRequest, pages: "", locale: "", stringIndexType: StringIndexType.TextElements, features: new DocumentAnalysisFeature[] { DocumentAnalysisFeature.OcrHighResolution }, queryFields: new string[] { "" }, outputContentFormat: ContentFormat.Text); - AnalyzeResult responseData = operation.Value; - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeDocument_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentAnalysisClient client = new DocumentAnalysisClient(endpoint, credential); - - AnalyzeDocumentRequest analyzeRequest = new AnalyzeDocumentRequest - { - UrlSource = new Uri("http://localhost:3000"), - Base64Source = BinaryData.FromObjectAsJson(new object()), - }; - Operation operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "", analyzeRequest: analyzeRequest, pages: "", locale: "", stringIndexType: StringIndexType.TextElements, features: new DocumentAnalysisFeature[] { DocumentAnalysisFeature.OcrHighResolution }, queryFields: new string[] { "" }, outputContentFormat: ContentFormat.Text); - AnalyzeResult responseData = operation.Value; - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_ClassifyDocument_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentAnalysisClient client = new DocumentAnalysisClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new object()); - Operation operation = client.ClassifyDocument(WaitUntil.Completed, "", content); - BinaryData responseData = operation.Value; - - JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("apiVersion").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("stringIndexType").ToString()); - Console.WriteLine(result.GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_ClassifyDocument_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentAnalysisClient client = new DocumentAnalysisClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new object()); - Operation operation = await client.ClassifyDocumentAsync(WaitUntil.Completed, "", content); - BinaryData responseData = operation.Value; - - JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("apiVersion").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("stringIndexType").ToString()); - Console.WriteLine(result.GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_ClassifyDocument_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentAnalysisClient client = new DocumentAnalysisClient(endpoint, credential); - - ClassifyDocumentRequest classifyRequest = new ClassifyDocumentRequest(); - Operation operation = client.ClassifyDocument(WaitUntil.Completed, "", classifyRequest); - AnalyzeResult responseData = operation.Value; - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_ClassifyDocument_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentAnalysisClient client = new DocumentAnalysisClient(endpoint, credential); - - ClassifyDocumentRequest classifyRequest = new ClassifyDocumentRequest(); - Operation operation = await client.ClassifyDocumentAsync(WaitUntil.Completed, "", classifyRequest); - AnalyzeResult responseData = operation.Value; - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_ClassifyDocument_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentAnalysisClient client = new DocumentAnalysisClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new - { - urlSource = "http://localhost:3000", - base64Source = new object(), - }); - Operation operation = client.ClassifyDocument(WaitUntil.Completed, "", content, stringIndexType: "textElements", split: "auto"); - BinaryData responseData = operation.Value; - - JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("apiVersion").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("stringIndexType").ToString()); - Console.WriteLine(result.GetProperty("contentFormat").ToString()); - Console.WriteLine(result.GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("angle").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("width").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("height").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("unit").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("words")[0].GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("words")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("words")[0].GetProperty("span").GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("words")[0].GetProperty("span").GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("words")[0].GetProperty("confidence").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("selectionMarks")[0].GetProperty("state").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("selectionMarks")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("selectionMarks")[0].GetProperty("span").GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("selectionMarks")[0].GetProperty("span").GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("selectionMarks")[0].GetProperty("confidence").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("lines")[0].GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("lines")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("lines")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("lines")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("barcodes")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("barcodes")[0].GetProperty("value").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("barcodes")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("barcodes")[0].GetProperty("span").GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("barcodes")[0].GetProperty("span").GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("barcodes")[0].GetProperty("confidence").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("formulas")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("formulas")[0].GetProperty("value").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("formulas")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("formulas")[0].GetProperty("span").GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("formulas")[0].GetProperty("span").GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("formulas")[0].GetProperty("confidence").ToString()); - Console.WriteLine(result.GetProperty("paragraphs")[0].GetProperty("role").ToString()); - Console.WriteLine(result.GetProperty("paragraphs")[0].GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("paragraphs")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("paragraphs")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("paragraphs")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("paragraphs")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("rowCount").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("columnCount").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("rowIndex").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("columnIndex").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("rowSpan").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("columnSpan").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("elements")[0].ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("caption").GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("caption").GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("caption").GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("caption").GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("caption").GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("caption").GetProperty("elements")[0].ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("footnotes")[0].GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("footnotes")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("footnotes")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("footnotes")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("footnotes")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("footnotes")[0].GetProperty("elements")[0].ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("elements")[0].ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("caption").GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("caption").GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("caption").GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("caption").GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("caption").GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("caption").GetProperty("elements")[0].ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("footnotes")[0].GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("footnotes")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("footnotes")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("footnotes")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("footnotes")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("footnotes")[0].GetProperty("elements")[0].ToString()); - Console.WriteLine(result.GetProperty("lists")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("lists")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("level").ToString()); - Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("elements")[0].ToString()); - Console.WriteLine(result.GetProperty("sections")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("sections")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("sections")[0].GetProperty("elements")[0].ToString()); - Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("key").GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("key").GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("key").GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("key").GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("key").GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("value").GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("value").GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("value").GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("value").GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("value").GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("confidence").ToString()); - Console.WriteLine(result.GetProperty("styles")[0].GetProperty("isHandwritten").ToString()); - Console.WriteLine(result.GetProperty("styles")[0].GetProperty("similarFontFamily").ToString()); - Console.WriteLine(result.GetProperty("styles")[0].GetProperty("fontStyle").ToString()); - Console.WriteLine(result.GetProperty("styles")[0].GetProperty("fontWeight").ToString()); - Console.WriteLine(result.GetProperty("styles")[0].GetProperty("color").ToString()); - Console.WriteLine(result.GetProperty("styles")[0].GetProperty("backgroundColor").ToString()); - Console.WriteLine(result.GetProperty("styles")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("styles")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("styles")[0].GetProperty("confidence").ToString()); - Console.WriteLine(result.GetProperty("languages")[0].GetProperty("locale").ToString()); - Console.WriteLine(result.GetProperty("languages")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("languages")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("languages")[0].GetProperty("confidence").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("docType").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("type").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueString").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueDate").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueTime").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valuePhoneNumber").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueNumber").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueInteger").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueSelectionMark").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueSignature").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueCountryRegion").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("type").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueString").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueDate").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueTime").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valuePhoneNumber").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueNumber").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueInteger").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueSelectionMark").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueSignature").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueCountryRegion").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueCurrency").GetProperty("amount").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueCurrency").GetProperty("currencySymbol").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueCurrency").GetProperty("currencyCode").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("houseNumber").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("poBox").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("road").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("city").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("state").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("postalCode").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("countryRegion").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("streetAddress").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("unit").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("cityDistrict").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("stateDistrict").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("suburb").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("house").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("level").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueBoolean").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("confidence").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueCurrency").GetProperty("amount").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueCurrency").GetProperty("currencySymbol").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueCurrency").GetProperty("currencyCode").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("houseNumber").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("poBox").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("road").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("city").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("state").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("postalCode").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("countryRegion").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("streetAddress").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("unit").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("cityDistrict").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("stateDistrict").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("suburb").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("house").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("level").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueBoolean").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("confidence").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("confidence").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_ClassifyDocument_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentAnalysisClient client = new DocumentAnalysisClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new - { - urlSource = "http://localhost:3000", - base64Source = new object(), - }); - Operation operation = await client.ClassifyDocumentAsync(WaitUntil.Completed, "", content, stringIndexType: "textElements", split: "auto"); - BinaryData responseData = operation.Value; - - JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("apiVersion").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("stringIndexType").ToString()); - Console.WriteLine(result.GetProperty("contentFormat").ToString()); - Console.WriteLine(result.GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("angle").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("width").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("height").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("unit").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("words")[0].GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("words")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("words")[0].GetProperty("span").GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("words")[0].GetProperty("span").GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("words")[0].GetProperty("confidence").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("selectionMarks")[0].GetProperty("state").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("selectionMarks")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("selectionMarks")[0].GetProperty("span").GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("selectionMarks")[0].GetProperty("span").GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("selectionMarks")[0].GetProperty("confidence").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("lines")[0].GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("lines")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("lines")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("lines")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("barcodes")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("barcodes")[0].GetProperty("value").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("barcodes")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("barcodes")[0].GetProperty("span").GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("barcodes")[0].GetProperty("span").GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("barcodes")[0].GetProperty("confidence").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("formulas")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("formulas")[0].GetProperty("value").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("formulas")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("formulas")[0].GetProperty("span").GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("formulas")[0].GetProperty("span").GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("pages")[0].GetProperty("formulas")[0].GetProperty("confidence").ToString()); - Console.WriteLine(result.GetProperty("paragraphs")[0].GetProperty("role").ToString()); - Console.WriteLine(result.GetProperty("paragraphs")[0].GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("paragraphs")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("paragraphs")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("paragraphs")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("paragraphs")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("rowCount").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("columnCount").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("rowIndex").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("columnIndex").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("rowSpan").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("columnSpan").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("cells")[0].GetProperty("elements")[0].ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("caption").GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("caption").GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("caption").GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("caption").GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("caption").GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("caption").GetProperty("elements")[0].ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("footnotes")[0].GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("footnotes")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("footnotes")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("footnotes")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("footnotes")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("tables")[0].GetProperty("footnotes")[0].GetProperty("elements")[0].ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("elements")[0].ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("caption").GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("caption").GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("caption").GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("caption").GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("caption").GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("caption").GetProperty("elements")[0].ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("footnotes")[0].GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("footnotes")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("footnotes")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("footnotes")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("footnotes")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("figures")[0].GetProperty("footnotes")[0].GetProperty("elements")[0].ToString()); - Console.WriteLine(result.GetProperty("lists")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("lists")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("level").ToString()); - Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("lists")[0].GetProperty("items")[0].GetProperty("elements")[0].ToString()); - Console.WriteLine(result.GetProperty("sections")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("sections")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("sections")[0].GetProperty("elements")[0].ToString()); - Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("key").GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("key").GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("key").GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("key").GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("key").GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("value").GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("value").GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("value").GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("value").GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("value").GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("keyValuePairs")[0].GetProperty("confidence").ToString()); - Console.WriteLine(result.GetProperty("styles")[0].GetProperty("isHandwritten").ToString()); - Console.WriteLine(result.GetProperty("styles")[0].GetProperty("similarFontFamily").ToString()); - Console.WriteLine(result.GetProperty("styles")[0].GetProperty("fontStyle").ToString()); - Console.WriteLine(result.GetProperty("styles")[0].GetProperty("fontWeight").ToString()); - Console.WriteLine(result.GetProperty("styles")[0].GetProperty("color").ToString()); - Console.WriteLine(result.GetProperty("styles")[0].GetProperty("backgroundColor").ToString()); - Console.WriteLine(result.GetProperty("styles")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("styles")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("styles")[0].GetProperty("confidence").ToString()); - Console.WriteLine(result.GetProperty("languages")[0].GetProperty("locale").ToString()); - Console.WriteLine(result.GetProperty("languages")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("languages")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("languages")[0].GetProperty("confidence").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("docType").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("type").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueString").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueDate").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueTime").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valuePhoneNumber").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueNumber").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueInteger").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueSelectionMark").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueSignature").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueCountryRegion").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("type").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueString").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueDate").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueTime").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valuePhoneNumber").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueNumber").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueInteger").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueSelectionMark").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueSignature").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueCountryRegion").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueCurrency").GetProperty("amount").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueCurrency").GetProperty("currencySymbol").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueCurrency").GetProperty("currencyCode").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("houseNumber").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("poBox").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("road").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("city").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("state").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("postalCode").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("countryRegion").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("streetAddress").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("unit").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("cityDistrict").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("stateDistrict").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("suburb").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("house").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueAddress").GetProperty("level").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("valueBoolean").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueArray")[0].GetProperty("confidence").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueCurrency").GetProperty("amount").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueCurrency").GetProperty("currencySymbol").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueCurrency").GetProperty("currencyCode").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("houseNumber").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("poBox").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("road").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("city").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("state").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("postalCode").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("countryRegion").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("streetAddress").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("unit").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("cityDistrict").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("stateDistrict").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("suburb").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("house").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueAddress").GetProperty("level").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("valueBoolean").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("content").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("boundingRegions")[0].GetProperty("pageNumber").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("boundingRegions")[0].GetProperty("polygon")[0].ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("spans")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("spans")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("fields").GetProperty("").GetProperty("confidence").ToString()); - Console.WriteLine(result.GetProperty("documents")[0].GetProperty("confidence").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_ClassifyDocument_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentAnalysisClient client = new DocumentAnalysisClient(endpoint, credential); - - ClassifyDocumentRequest classifyRequest = new ClassifyDocumentRequest - { - UrlSource = new Uri("http://localhost:3000"), - Base64Source = BinaryData.FromObjectAsJson(new object()), - }; - Operation operation = client.ClassifyDocument(WaitUntil.Completed, "", classifyRequest, stringIndexType: StringIndexType.TextElements, split: SplitMode.Auto); - AnalyzeResult responseData = operation.Value; - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_ClassifyDocument_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentAnalysisClient client = new DocumentAnalysisClient(endpoint, credential); - - ClassifyDocumentRequest classifyRequest = new ClassifyDocumentRequest - { - UrlSource = new Uri("http://localhost:3000"), - Base64Source = BinaryData.FromObjectAsJson(new object()), - }; - Operation operation = await client.ClassifyDocumentAsync(WaitUntil.Completed, "", classifyRequest, stringIndexType: StringIndexType.TextElements, split: SplitMode.Auto); - AnalyzeResult responseData = operation.Value; - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Generated/Samples/Samples_DocumentModelAdministrationClient.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Generated/Samples/Samples_DocumentModelAdministrationClient.cs deleted file mode 100644 index ff2fc8b02de6..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Generated/Samples/Samples_DocumentModelAdministrationClient.cs +++ /dev/null @@ -1,2118 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using System.Threading.Tasks; -using Azure; -using Azure.AI.DocumentIntelligence; -using Azure.Core; -using Azure.Identity; -using NUnit.Framework; - -namespace Azure.AI.DocumentIntelligence.Samples -{ - public partial class Samples_DocumentModelAdministrationClient - { - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AuthorizeModelCopy_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new - { - modelId = "", - }); - Response response = client.AuthorizeModelCopy(content); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("targetResourceId").ToString()); - Console.WriteLine(result.GetProperty("targetResourceRegion").ToString()); - Console.WriteLine(result.GetProperty("targetModelId").ToString()); - Console.WriteLine(result.GetProperty("targetModelLocation").ToString()); - Console.WriteLine(result.GetProperty("accessToken").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AuthorizeModelCopy_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new - { - modelId = "", - }); - Response response = await client.AuthorizeModelCopyAsync(content); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("targetResourceId").ToString()); - Console.WriteLine(result.GetProperty("targetResourceRegion").ToString()); - Console.WriteLine(result.GetProperty("targetModelId").ToString()); - Console.WriteLine(result.GetProperty("targetModelLocation").ToString()); - Console.WriteLine(result.GetProperty("accessToken").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AuthorizeModelCopy_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - AuthorizeCopyRequest authorizeCopyRequest = new AuthorizeCopyRequest(""); - Response response = client.AuthorizeModelCopy(authorizeCopyRequest); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AuthorizeModelCopy_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - AuthorizeCopyRequest authorizeCopyRequest = new AuthorizeCopyRequest(""); - Response response = await client.AuthorizeModelCopyAsync(authorizeCopyRequest); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AuthorizeModelCopy_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new - { - modelId = "", - description = "", - tags = new - { - key = "", - }, - }); - Response response = client.AuthorizeModelCopy(content); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("targetResourceId").ToString()); - Console.WriteLine(result.GetProperty("targetResourceRegion").ToString()); - Console.WriteLine(result.GetProperty("targetModelId").ToString()); - Console.WriteLine(result.GetProperty("targetModelLocation").ToString()); - Console.WriteLine(result.GetProperty("accessToken").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AuthorizeModelCopy_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new - { - modelId = "", - description = "", - tags = new - { - key = "", - }, - }); - Response response = await client.AuthorizeModelCopyAsync(content); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("targetResourceId").ToString()); - Console.WriteLine(result.GetProperty("targetResourceRegion").ToString()); - Console.WriteLine(result.GetProperty("targetModelId").ToString()); - Console.WriteLine(result.GetProperty("targetModelLocation").ToString()); - Console.WriteLine(result.GetProperty("accessToken").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AuthorizeModelCopy_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - AuthorizeCopyRequest authorizeCopyRequest = new AuthorizeCopyRequest("") - { - Description = "", - Tags = -{ -["key"] = "" -}, - }; - Response response = client.AuthorizeModelCopy(authorizeCopyRequest); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AuthorizeModelCopy_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - AuthorizeCopyRequest authorizeCopyRequest = new AuthorizeCopyRequest("") - { - Description = "", - Tags = -{ -["key"] = "" -}, - }; - Response response = await client.AuthorizeModelCopyAsync(authorizeCopyRequest); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_GetModel_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - Response response = client.GetModel("", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_GetModel_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - Response response = await client.GetModelAsync("", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_GetModel_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - Response response = client.GetModel(""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_GetModel_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - Response response = await client.GetModelAsync(""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_GetModel_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - Response response = client.GetModel("", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("apiVersion").ToString()); - Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("buildMode").ToString()); - Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("containerUrl").ToString()); - Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("prefix").ToString()); - Console.WriteLine(result.GetProperty("azureBlobFileListSource").GetProperty("containerUrl").ToString()); - Console.WriteLine(result.GetProperty("azureBlobFileListSource").GetProperty("fileList").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("buildMode").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("type").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("example").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("type").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("example").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldConfidence").GetProperty("").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_GetModel_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - Response response = await client.GetModelAsync("", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("apiVersion").ToString()); - Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("buildMode").ToString()); - Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("containerUrl").ToString()); - Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("prefix").ToString()); - Console.WriteLine(result.GetProperty("azureBlobFileListSource").GetProperty("containerUrl").ToString()); - Console.WriteLine(result.GetProperty("azureBlobFileListSource").GetProperty("fileList").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("buildMode").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("type").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("example").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("type").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("example").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldConfidence").GetProperty("").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_GetModel_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - Response response = client.GetModel(""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_GetModel_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - Response response = await client.GetModelAsync(""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_DeleteModel_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - Response response = client.DeleteModel(""); - - Console.WriteLine(response.Status); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_DeleteModel_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - Response response = await client.DeleteModelAsync(""); - - Console.WriteLine(response.Status); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_DeleteModel_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - Response response = client.DeleteModel(""); - - Console.WriteLine(response.Status); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_DeleteModel_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - Response response = await client.DeleteModelAsync(""); - - Console.WriteLine(response.Status); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_GetResourceInfo_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - Response response = client.GetResourceInfo(null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("customDocumentModels").GetProperty("count").ToString()); - Console.WriteLine(result.GetProperty("customDocumentModels").GetProperty("limit").ToString()); - Console.WriteLine(result.GetProperty("customNeuralDocumentModelBuilds").GetProperty("used").ToString()); - Console.WriteLine(result.GetProperty("customNeuralDocumentModelBuilds").GetProperty("quota").ToString()); - Console.WriteLine(result.GetProperty("customNeuralDocumentModelBuilds").GetProperty("quotaResetDateTime").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_GetResourceInfo_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - Response response = await client.GetResourceInfoAsync(null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("customDocumentModels").GetProperty("count").ToString()); - Console.WriteLine(result.GetProperty("customDocumentModels").GetProperty("limit").ToString()); - Console.WriteLine(result.GetProperty("customNeuralDocumentModelBuilds").GetProperty("used").ToString()); - Console.WriteLine(result.GetProperty("customNeuralDocumentModelBuilds").GetProperty("quota").ToString()); - Console.WriteLine(result.GetProperty("customNeuralDocumentModelBuilds").GetProperty("quotaResetDateTime").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_GetResourceInfo_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - Response response = client.GetResourceInfo(); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_GetResourceInfo_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - Response response = await client.GetResourceInfoAsync(); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_GetResourceInfo_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - Response response = client.GetResourceInfo(null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("customDocumentModels").GetProperty("count").ToString()); - Console.WriteLine(result.GetProperty("customDocumentModels").GetProperty("limit").ToString()); - Console.WriteLine(result.GetProperty("customNeuralDocumentModelBuilds").GetProperty("used").ToString()); - Console.WriteLine(result.GetProperty("customNeuralDocumentModelBuilds").GetProperty("quota").ToString()); - Console.WriteLine(result.GetProperty("customNeuralDocumentModelBuilds").GetProperty("quotaResetDateTime").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_GetResourceInfo_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - Response response = await client.GetResourceInfoAsync(null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("customDocumentModels").GetProperty("count").ToString()); - Console.WriteLine(result.GetProperty("customDocumentModels").GetProperty("limit").ToString()); - Console.WriteLine(result.GetProperty("customNeuralDocumentModelBuilds").GetProperty("used").ToString()); - Console.WriteLine(result.GetProperty("customNeuralDocumentModelBuilds").GetProperty("quota").ToString()); - Console.WriteLine(result.GetProperty("customNeuralDocumentModelBuilds").GetProperty("quotaResetDateTime").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_GetResourceInfo_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - Response response = client.GetResourceInfo(); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_GetResourceInfo_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - Response response = await client.GetResourceInfoAsync(); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_GetOperation_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - Response response = client.GetOperation(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("operationId").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("resourceLocation").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_GetOperation_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - Response response = await client.GetOperationAsync(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("operationId").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("resourceLocation").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_GetOperation_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - Response response = client.GetOperation(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a")); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_GetOperation_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - Response response = await client.GetOperationAsync(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a")); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_GetOperation_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - Response response = client.GetOperation(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("operationId").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("percentCompleted").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("resourceLocation").ToString()); - Console.WriteLine(result.GetProperty("apiVersion").ToString()); - Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("error").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("error").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("error").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("message").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_GetOperation_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - Response response = await client.GetOperationAsync(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("operationId").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("percentCompleted").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("resourceLocation").ToString()); - Console.WriteLine(result.GetProperty("apiVersion").ToString()); - Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("error").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("error").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("error").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("message").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_GetOperation_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - Response response = client.GetOperation(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a")); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_GetOperation_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - Response response = await client.GetOperationAsync(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a")); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_GetClassifier_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - Response response = client.GetClassifier("", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("classifierId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("apiVersion").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_GetClassifier_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - Response response = await client.GetClassifierAsync("", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("classifierId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("apiVersion").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_GetClassifier_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - Response response = client.GetClassifier(""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_GetClassifier_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - Response response = await client.GetClassifierAsync(""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_GetClassifier_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - Response response = client.GetClassifier("", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("classifierId").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("apiVersion").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("sourceKind").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("azureBlobSource").GetProperty("containerUrl").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("azureBlobSource").GetProperty("prefix").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("azureBlobFileListSource").GetProperty("containerUrl").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("azureBlobFileListSource").GetProperty("fileList").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_GetClassifier_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - Response response = await client.GetClassifierAsync("", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("classifierId").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("apiVersion").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("sourceKind").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("azureBlobSource").GetProperty("containerUrl").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("azureBlobSource").GetProperty("prefix").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("azureBlobFileListSource").GetProperty("containerUrl").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("azureBlobFileListSource").GetProperty("fileList").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_GetClassifier_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - Response response = client.GetClassifier(""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_GetClassifier_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - Response response = await client.GetClassifierAsync(""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_DeleteClassifier_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - Response response = client.DeleteClassifier(""); - - Console.WriteLine(response.Status); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_DeleteClassifier_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - Response response = await client.DeleteClassifierAsync(""); - - Console.WriteLine(response.Status); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_DeleteClassifier_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - Response response = client.DeleteClassifier(""); - - Console.WriteLine(response.Status); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_DeleteClassifier_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - Response response = await client.DeleteClassifierAsync(""); - - Console.WriteLine(response.Status); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_GetModels_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - foreach (BinaryData item in client.GetModels(null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_GetModels_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - await foreach (BinaryData item in client.GetModelsAsync(null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_GetModels_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - foreach (DocumentModelDetails item in client.GetModels()) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_GetModels_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - await foreach (DocumentModelDetails item in client.GetModelsAsync()) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_GetModels_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - foreach (BinaryData item in client.GetModels(null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("apiVersion").ToString()); - Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("buildMode").ToString()); - Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("containerUrl").ToString()); - Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("prefix").ToString()); - Console.WriteLine(result.GetProperty("azureBlobFileListSource").GetProperty("containerUrl").ToString()); - Console.WriteLine(result.GetProperty("azureBlobFileListSource").GetProperty("fileList").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("buildMode").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("type").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("example").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("type").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("example").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldConfidence").GetProperty("").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_GetModels_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - await foreach (BinaryData item in client.GetModelsAsync(null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("apiVersion").ToString()); - Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("buildMode").ToString()); - Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("containerUrl").ToString()); - Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("prefix").ToString()); - Console.WriteLine(result.GetProperty("azureBlobFileListSource").GetProperty("containerUrl").ToString()); - Console.WriteLine(result.GetProperty("azureBlobFileListSource").GetProperty("fileList").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("buildMode").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("type").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("example").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("type").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("example").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldConfidence").GetProperty("").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_GetModels_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - foreach (DocumentModelDetails item in client.GetModels()) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_GetModels_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - await foreach (DocumentModelDetails item in client.GetModelsAsync()) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_GetOperations_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - foreach (BinaryData item in client.GetOperations(null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("operationId").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("resourceLocation").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_GetOperations_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - await foreach (BinaryData item in client.GetOperationsAsync(null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("operationId").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("resourceLocation").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_GetOperations_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - foreach (OperationDetails item in client.GetOperations()) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_GetOperations_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - await foreach (OperationDetails item in client.GetOperationsAsync()) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_GetOperations_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - foreach (BinaryData item in client.GetOperations(null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("operationId").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("percentCompleted").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("resourceLocation").ToString()); - Console.WriteLine(result.GetProperty("apiVersion").ToString()); - Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("error").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("error").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("error").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("message").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_GetOperations_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - await foreach (BinaryData item in client.GetOperationsAsync(null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("operationId").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("percentCompleted").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("resourceLocation").ToString()); - Console.WriteLine(result.GetProperty("apiVersion").ToString()); - Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("error").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("error").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("error").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("message").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_GetOperations_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - foreach (OperationDetails item in client.GetOperations()) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_GetOperations_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - await foreach (OperationDetails item in client.GetOperationsAsync()) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_GetClassifiers_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - foreach (BinaryData item in client.GetClassifiers(null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("classifierId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("apiVersion").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_GetClassifiers_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - await foreach (BinaryData item in client.GetClassifiersAsync(null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("classifierId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("apiVersion").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_GetClassifiers_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - foreach (DocumentClassifierDetails item in client.GetClassifiers()) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_GetClassifiers_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - await foreach (DocumentClassifierDetails item in client.GetClassifiersAsync()) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_GetClassifiers_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - foreach (BinaryData item in client.GetClassifiers(null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("classifierId").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("apiVersion").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("sourceKind").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("azureBlobSource").GetProperty("containerUrl").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("azureBlobSource").GetProperty("prefix").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("azureBlobFileListSource").GetProperty("containerUrl").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("azureBlobFileListSource").GetProperty("fileList").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_GetClassifiers_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - await foreach (BinaryData item in client.GetClassifiersAsync(null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("classifierId").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("apiVersion").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("sourceKind").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("azureBlobSource").GetProperty("containerUrl").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("azureBlobSource").GetProperty("prefix").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("azureBlobFileListSource").GetProperty("containerUrl").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("azureBlobFileListSource").GetProperty("fileList").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_GetClassifiers_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - foreach (DocumentClassifierDetails item in client.GetClassifiers()) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_GetClassifiers_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - await foreach (DocumentClassifierDetails item in client.GetClassifiersAsync()) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_BuildDocumentModel_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new - { - modelId = "", - buildMode = "template", - }); - Operation operation = client.BuildDocumentModel(WaitUntil.Completed, content); - BinaryData responseData = operation.Value; - - JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_BuildDocumentModel_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new - { - modelId = "", - buildMode = "template", - }); - Operation operation = await client.BuildDocumentModelAsync(WaitUntil.Completed, content); - BinaryData responseData = operation.Value; - - JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_BuildDocumentModel_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - BuildDocumentModelRequest buildRequest = new BuildDocumentModelRequest("", DocumentBuildMode.Template); - Operation operation = client.BuildDocumentModel(WaitUntil.Completed, buildRequest); - DocumentModelDetails responseData = operation.Value; - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_BuildDocumentModel_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - BuildDocumentModelRequest buildRequest = new BuildDocumentModelRequest("", DocumentBuildMode.Template); - Operation operation = await client.BuildDocumentModelAsync(WaitUntil.Completed, buildRequest); - DocumentModelDetails responseData = operation.Value; - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_BuildDocumentModel_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new - { - modelId = "", - description = "", - buildMode = "template", - azureBlobSource = new - { - containerUrl = "http://localhost:3000", - prefix = "", - }, - azureBlobFileListSource = new - { - containerUrl = "http://localhost:3000", - fileList = "", - }, - tags = new - { - key = "", - }, - }); - Operation operation = client.BuildDocumentModel(WaitUntil.Completed, content); - BinaryData responseData = operation.Value; - - JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("apiVersion").ToString()); - Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("buildMode").ToString()); - Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("containerUrl").ToString()); - Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("prefix").ToString()); - Console.WriteLine(result.GetProperty("azureBlobFileListSource").GetProperty("containerUrl").ToString()); - Console.WriteLine(result.GetProperty("azureBlobFileListSource").GetProperty("fileList").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("buildMode").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("type").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("example").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("type").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("example").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldConfidence").GetProperty("").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_BuildDocumentModel_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new - { - modelId = "", - description = "", - buildMode = "template", - azureBlobSource = new - { - containerUrl = "http://localhost:3000", - prefix = "", - }, - azureBlobFileListSource = new - { - containerUrl = "http://localhost:3000", - fileList = "", - }, - tags = new - { - key = "", - }, - }); - Operation operation = await client.BuildDocumentModelAsync(WaitUntil.Completed, content); - BinaryData responseData = operation.Value; - - JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("apiVersion").ToString()); - Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("buildMode").ToString()); - Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("containerUrl").ToString()); - Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("prefix").ToString()); - Console.WriteLine(result.GetProperty("azureBlobFileListSource").GetProperty("containerUrl").ToString()); - Console.WriteLine(result.GetProperty("azureBlobFileListSource").GetProperty("fileList").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("buildMode").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("type").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("example").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("type").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("example").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldConfidence").GetProperty("").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_BuildDocumentModel_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - BuildDocumentModelRequest buildRequest = new BuildDocumentModelRequest("", DocumentBuildMode.Template) - { - Description = "", - AzureBlobSource = new AzureBlobContentSource(new Uri("http://localhost:3000")) - { - Prefix = "", - }, - AzureBlobFileListSource = new AzureBlobFileListContentSource(new Uri("http://localhost:3000"), ""), - Tags = -{ -["key"] = "" -}, - }; - Operation operation = client.BuildDocumentModel(WaitUntil.Completed, buildRequest); - DocumentModelDetails responseData = operation.Value; - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_BuildDocumentModel_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - BuildDocumentModelRequest buildRequest = new BuildDocumentModelRequest("", DocumentBuildMode.Template) - { - Description = "", - AzureBlobSource = new AzureBlobContentSource(new Uri("http://localhost:3000")) - { - Prefix = "", - }, - AzureBlobFileListSource = new AzureBlobFileListContentSource(new Uri("http://localhost:3000"), ""), - Tags = -{ -["key"] = "" -}, - }; - Operation operation = await client.BuildDocumentModelAsync(WaitUntil.Completed, buildRequest); - DocumentModelDetails responseData = operation.Value; - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_ComposeModel_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new - { - modelId = "", - componentModels = new object[] - { -new -{ -modelId = "", -} - }, - }); - Operation operation = client.ComposeModel(WaitUntil.Completed, content); - BinaryData responseData = operation.Value; - - JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_ComposeModel_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new - { - modelId = "", - componentModels = new object[] - { -new -{ -modelId = "", -} - }, - }); - Operation operation = await client.ComposeModelAsync(WaitUntil.Completed, content); - BinaryData responseData = operation.Value; - - JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_ComposeModel_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - ComposeDocumentModelRequest composeRequest = new ComposeDocumentModelRequest("", new ComponentDocumentModelDetails[] - { -new ComponentDocumentModelDetails("") - }); - Operation operation = client.ComposeModel(WaitUntil.Completed, composeRequest); - DocumentModelDetails responseData = operation.Value; - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_ComposeModel_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - ComposeDocumentModelRequest composeRequest = new ComposeDocumentModelRequest("", new ComponentDocumentModelDetails[] - { -new ComponentDocumentModelDetails("") - }); - Operation operation = await client.ComposeModelAsync(WaitUntil.Completed, composeRequest); - DocumentModelDetails responseData = operation.Value; - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_ComposeModel_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new - { - modelId = "", - description = "", - componentModels = new object[] - { -new -{ -modelId = "", -} - }, - tags = new - { - key = "", - }, - }); - Operation operation = client.ComposeModel(WaitUntil.Completed, content); - BinaryData responseData = operation.Value; - - JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("apiVersion").ToString()); - Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("buildMode").ToString()); - Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("containerUrl").ToString()); - Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("prefix").ToString()); - Console.WriteLine(result.GetProperty("azureBlobFileListSource").GetProperty("containerUrl").ToString()); - Console.WriteLine(result.GetProperty("azureBlobFileListSource").GetProperty("fileList").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("buildMode").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("type").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("example").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("type").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("example").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldConfidence").GetProperty("").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_ComposeModel_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new - { - modelId = "", - description = "", - componentModels = new object[] - { -new -{ -modelId = "", -} - }, - tags = new - { - key = "", - }, - }); - Operation operation = await client.ComposeModelAsync(WaitUntil.Completed, content); - BinaryData responseData = operation.Value; - - JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("apiVersion").ToString()); - Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("buildMode").ToString()); - Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("containerUrl").ToString()); - Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("prefix").ToString()); - Console.WriteLine(result.GetProperty("azureBlobFileListSource").GetProperty("containerUrl").ToString()); - Console.WriteLine(result.GetProperty("azureBlobFileListSource").GetProperty("fileList").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("buildMode").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("type").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("example").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("type").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("example").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldConfidence").GetProperty("").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_ComposeModel_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - ComposeDocumentModelRequest composeRequest = new ComposeDocumentModelRequest("", new ComponentDocumentModelDetails[] - { -new ComponentDocumentModelDetails("") - }) - { - Description = "", - Tags = -{ -["key"] = "" -}, - }; - Operation operation = client.ComposeModel(WaitUntil.Completed, composeRequest); - DocumentModelDetails responseData = operation.Value; - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_ComposeModel_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - ComposeDocumentModelRequest composeRequest = new ComposeDocumentModelRequest("", new ComponentDocumentModelDetails[] - { -new ComponentDocumentModelDetails("") - }) - { - Description = "", - Tags = -{ -["key"] = "" -}, - }; - Operation operation = await client.ComposeModelAsync(WaitUntil.Completed, composeRequest); - DocumentModelDetails responseData = operation.Value; - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_CopyModelTo_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new - { - targetResourceId = "", - targetResourceRegion = "", - targetModelId = "", - targetModelLocation = "http://localhost:3000", - accessToken = "", - expirationDateTime = "2022-05-10T14:57:31.2311892-04:00", - }); - Operation operation = client.CopyModelTo(WaitUntil.Completed, "", content); - BinaryData responseData = operation.Value; - - JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_CopyModelTo_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new - { - targetResourceId = "", - targetResourceRegion = "", - targetModelId = "", - targetModelLocation = "http://localhost:3000", - accessToken = "", - expirationDateTime = "2022-05-10T14:57:31.2311892-04:00", - }); - Operation operation = await client.CopyModelToAsync(WaitUntil.Completed, "", content); - BinaryData responseData = operation.Value; - - JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_CopyModelTo_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - CopyAuthorization copyToRequest = new CopyAuthorization("", "", "", new Uri("http://localhost:3000"), "", DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00")); - Operation operation = client.CopyModelTo(WaitUntil.Completed, "", copyToRequest); - DocumentModelDetails responseData = operation.Value; - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_CopyModelTo_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - CopyAuthorization copyToRequest = new CopyAuthorization("", "", "", new Uri("http://localhost:3000"), "", DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00")); - Operation operation = await client.CopyModelToAsync(WaitUntil.Completed, "", copyToRequest); - DocumentModelDetails responseData = operation.Value; - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_CopyModelTo_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new - { - targetResourceId = "", - targetResourceRegion = "", - targetModelId = "", - targetModelLocation = "http://localhost:3000", - accessToken = "", - expirationDateTime = "2022-05-10T14:57:31.2311892-04:00", - }); - Operation operation = client.CopyModelTo(WaitUntil.Completed, "", content); - BinaryData responseData = operation.Value; - - JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("apiVersion").ToString()); - Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("buildMode").ToString()); - Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("containerUrl").ToString()); - Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("prefix").ToString()); - Console.WriteLine(result.GetProperty("azureBlobFileListSource").GetProperty("containerUrl").ToString()); - Console.WriteLine(result.GetProperty("azureBlobFileListSource").GetProperty("fileList").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("buildMode").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("type").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("example").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("type").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("example").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldConfidence").GetProperty("").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_CopyModelTo_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new - { - targetResourceId = "", - targetResourceRegion = "", - targetModelId = "", - targetModelLocation = "http://localhost:3000", - accessToken = "", - expirationDateTime = "2022-05-10T14:57:31.2311892-04:00", - }); - Operation operation = await client.CopyModelToAsync(WaitUntil.Completed, "", content); - BinaryData responseData = operation.Value; - - JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("apiVersion").ToString()); - Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("buildMode").ToString()); - Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("containerUrl").ToString()); - Console.WriteLine(result.GetProperty("azureBlobSource").GetProperty("prefix").ToString()); - Console.WriteLine(result.GetProperty("azureBlobFileListSource").GetProperty("containerUrl").ToString()); - Console.WriteLine(result.GetProperty("azureBlobFileListSource").GetProperty("fileList").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("buildMode").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("type").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("example").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("type").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldSchema").GetProperty("").GetProperty("items").GetProperty("example").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("fieldConfidence").GetProperty("").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_CopyModelTo_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - CopyAuthorization copyToRequest = new CopyAuthorization("", "", "", new Uri("http://localhost:3000"), "", DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00")); - Operation operation = client.CopyModelTo(WaitUntil.Completed, "", copyToRequest); - DocumentModelDetails responseData = operation.Value; - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_CopyModelTo_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - CopyAuthorization copyToRequest = new CopyAuthorization("", "", "", new Uri("http://localhost:3000"), "", DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00")); - Operation operation = await client.CopyModelToAsync(WaitUntil.Completed, "", copyToRequest); - DocumentModelDetails responseData = operation.Value; - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_BuildClassifier_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new - { - classifierId = "", - docTypes = new - { - key = new object(), - }, - }); - Operation operation = client.BuildClassifier(WaitUntil.Completed, content); - BinaryData responseData = operation.Value; - - JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("classifierId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("apiVersion").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_BuildClassifier_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new - { - classifierId = "", - docTypes = new - { - key = new object(), - }, - }); - Operation operation = await client.BuildClassifierAsync(WaitUntil.Completed, content); - BinaryData responseData = operation.Value; - - JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("classifierId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("apiVersion").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_BuildClassifier_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - BuildDocumentClassifierRequest buildRequest = new BuildDocumentClassifierRequest("", new Dictionary - { - ["key"] = new ClassifierDocumentTypeDetails() - }); - Operation operation = client.BuildClassifier(WaitUntil.Completed, buildRequest); - DocumentClassifierDetails responseData = operation.Value; - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_BuildClassifier_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - BuildDocumentClassifierRequest buildRequest = new BuildDocumentClassifierRequest("", new Dictionary - { - ["key"] = new ClassifierDocumentTypeDetails() - }); - Operation operation = await client.BuildClassifierAsync(WaitUntil.Completed, buildRequest); - DocumentClassifierDetails responseData = operation.Value; - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_BuildClassifier_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new - { - classifierId = "", - description = "", - docTypes = new - { - key = new - { - sourceKind = "url", - azureBlobSource = new - { - containerUrl = "http://localhost:3000", - prefix = "", - }, - azureBlobFileListSource = new - { - containerUrl = "http://localhost:3000", - fileList = "", - }, - }, - }, - }); - Operation operation = client.BuildClassifier(WaitUntil.Completed, content); - BinaryData responseData = operation.Value; - - JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("classifierId").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("apiVersion").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("sourceKind").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("azureBlobSource").GetProperty("containerUrl").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("azureBlobSource").GetProperty("prefix").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("azureBlobFileListSource").GetProperty("containerUrl").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("azureBlobFileListSource").GetProperty("fileList").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_BuildClassifier_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new - { - classifierId = "", - description = "", - docTypes = new - { - key = new - { - sourceKind = "url", - azureBlobSource = new - { - containerUrl = "http://localhost:3000", - prefix = "", - }, - azureBlobFileListSource = new - { - containerUrl = "http://localhost:3000", - fileList = "", - }, - }, - }, - }); - Operation operation = await client.BuildClassifierAsync(WaitUntil.Completed, content); - BinaryData responseData = operation.Value; - - JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("classifierId").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("apiVersion").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("sourceKind").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("azureBlobSource").GetProperty("containerUrl").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("azureBlobSource").GetProperty("prefix").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("azureBlobFileListSource").GetProperty("containerUrl").ToString()); - Console.WriteLine(result.GetProperty("docTypes").GetProperty("").GetProperty("azureBlobFileListSource").GetProperty("fileList").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_BuildClassifier_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - BuildDocumentClassifierRequest buildRequest = new BuildDocumentClassifierRequest("", new Dictionary - { - ["key"] = new ClassifierDocumentTypeDetails - { - SourceKind = ContentSourceKind.Url, - AzureBlobSource = new AzureBlobContentSource(new Uri("http://localhost:3000")) - { - Prefix = "", - }, - AzureBlobFileListSource = new AzureBlobFileListContentSource(new Uri("http://localhost:3000"), ""), - } - }) - { - Description = "", - }; - Operation operation = client.BuildClassifier(WaitUntil.Completed, buildRequest); - DocumentClassifierDetails responseData = operation.Value; - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_BuildClassifier_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentModelAdministrationClient client = new DocumentModelAdministrationClient(endpoint, credential); - - BuildDocumentClassifierRequest buildRequest = new BuildDocumentClassifierRequest("", new Dictionary - { - ["key"] = new ClassifierDocumentTypeDetails - { - SourceKind = ContentSourceKind.Url, - AzureBlobSource = new AzureBlobContentSource(new Uri("http://localhost:3000")) - { - Prefix = "", - }, - AzureBlobFileListSource = new AzureBlobFileListContentSource(new Uri("http://localhost:3000"), ""), - } - }) - { - Description = "", - }; - Operation operation = await client.BuildClassifierAsync(WaitUntil.Completed, buildRequest); - DocumentClassifierDetails responseData = operation.Value; - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Infrastructure/DisposableDocumentClassifier.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Infrastructure/DisposableDocumentClassifier.cs deleted file mode 100644 index f1d4880db59f..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Infrastructure/DisposableDocumentClassifier.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Threading.Tasks; - -namespace Azure.AI.DocumentIntelligence.Tests -{ - public class DisposableDocumentClassifier : IAsyncDisposable - { - private readonly DocumentModelAdministrationClient _client; - - private DisposableDocumentClassifier(DocumentModelAdministrationClient client, Operation operation) - { - _client = client; - Operation = operation; - } - - public Operation Operation { get; } - - public DocumentClassifierDetails Value => Operation.Value; - - public string ClassifierId => Value.ClassifierId; - - public static async Task BuildAsync(DocumentModelAdministrationClient client, BuildDocumentClassifierRequest buildRequest) - { - Operation operation = await client.BuildClassifierAsync(WaitUntil.Completed, buildRequest); - - return new DisposableDocumentClassifier(client, operation); - } - - public async ValueTask DisposeAsync() - { - await _client.DeleteClassifierAsync(Value.ClassifierId); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Infrastructure/DisposableDocumentModel.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Infrastructure/DisposableDocumentModel.cs deleted file mode 100644 index 991c1f2c77e3..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Infrastructure/DisposableDocumentModel.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Threading.Tasks; - -namespace Azure.AI.DocumentIntelligence.Tests -{ - public class DisposableDocumentModel : IAsyncDisposable - { - private readonly DocumentModelAdministrationClient _client; - - private DisposableDocumentModel(DocumentModelAdministrationClient client, Operation operation) - { - _client = client; - Operation = operation; - } - - public Operation Operation { get; } - - public DocumentModelDetails Value => Operation.Value; - - public string ModelId => Value.ModelId; - - public static async Task BuildAsync(DocumentModelAdministrationClient client, BuildDocumentModelRequest buildRequest) - { - Operation operation = await client.BuildDocumentModelAsync(WaitUntil.Completed, buildRequest); - - return new DisposableDocumentModel(client, operation); - } - - public async ValueTask DisposeAsync() - { - await _client.DeleteModelAsync(Value.ModelId); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Infrastructure/DocumentIntelligenceLiveTestBase.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Infrastructure/DocumentIntelligenceLiveTestBase.cs deleted file mode 100644 index da00dcd4373e..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Infrastructure/DocumentIntelligenceLiveTestBase.cs +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Azure.Core.TestFramework; -using Azure.Core.TestFramework.Models; - -namespace Azure.AI.DocumentIntelligence.Tests -{ - public class DocumentIntelligenceLiveTestBase : RecordedTestBase - { - public DocumentIntelligenceLiveTestBase(bool isAsync, RecordedTestMode? mode = null) - : base(isAsync, mode) - { - JsonPathSanitizers.Add("$..accessToken"); - BodyKeySanitizers.Add(new BodyKeySanitizer("https://sanitized.blob.core.windows.net") { JsonPath = "$..containerUrl" }); - SanitizedHeaders.Add("Ocp-Apim-Subscription-Key"); - } - - protected string ServiceVersionString { get; } = "2023-10-31-preview"; - - protected DocumentAnalysisClient CreateDocumentAnalysisClient() - { - var endpoint = new Uri(TestEnvironment.Endpoint); - var credential = new AzureKeyCredential(TestEnvironment.ApiKey); - - var nonInstrumentedClient = new DocumentAnalysisClient(endpoint, credential); - - return InstrumentClient(nonInstrumentedClient); - } - - protected DocumentModelAdministrationClient CreateDocumentModelAdministrationClient() - { - var endpoint = new Uri(TestEnvironment.Endpoint); - var credential = new AzureKeyCredential(TestEnvironment.ApiKey); - - var nonInstrumentedClient = new DocumentModelAdministrationClient(endpoint, credential); - - return InstrumentClient(nonInstrumentedClient); - } - - protected async Task BuildDisposableDocumentModelAsync(string containerUrlString, string description = null, IReadOnlyDictionary tags = null) - { - var client = CreateDocumentModelAdministrationClient(); - var modelId = Recording.GenerateId(); - var containerUrl = new Uri(containerUrlString); - var source = new AzureBlobContentSource(containerUrl); - - var request = new BuildDocumentModelRequest(modelId, DocumentBuildMode.Template) - { - AzureBlobSource = source, - Description = description - }; - - if (tags != null) - { - foreach (var tag in tags) - { - request.Tags.Add(tag); - } - } - - return await DisposableDocumentModel.BuildAsync(client, request); - } - - protected async Task BuildDisposableDocumentClassifierAsync(string description = null) - { - var client = CreateDocumentModelAdministrationClient(); - var classifierId = Recording.GenerateId(); - var containerUrl = new Uri(TestEnvironment.ClassifierTrainingSasUrl); - var sourceA = new AzureBlobContentSource(containerUrl) { Prefix = "IRS-1040-A/train" }; - var sourceB = new AzureBlobContentSource(containerUrl) { Prefix = "IRS-1040-B/train" }; - var sourceC = new AzureBlobContentSource(containerUrl) { Prefix = "IRS-1040-C/train" }; - var sourceD = new AzureBlobContentSource(containerUrl) { Prefix = "IRS-1040-D/train" }; - var sourceE = new AzureBlobContentSource(containerUrl) { Prefix = "IRS-1040-E/train" }; - var docTypeA = new ClassifierDocumentTypeDetails() { AzureBlobSource = sourceA }; - var docTypeB = new ClassifierDocumentTypeDetails() { AzureBlobSource = sourceB }; - var docTypeC = new ClassifierDocumentTypeDetails() { AzureBlobSource = sourceC }; - var docTypeD = new ClassifierDocumentTypeDetails() { AzureBlobSource = sourceD }; - var docTypeE = new ClassifierDocumentTypeDetails() { AzureBlobSource = sourceE }; - var docTypes = new Dictionary() - { - { "IRS-1040-A", docTypeA }, - { "IRS-1040-B", docTypeB }, - { "IRS-1040-C", docTypeC }, - { "IRS-1040-D", docTypeD }, - { "IRS-1040-E", docTypeE } - }; - - var request = new BuildDocumentClassifierRequest(classifierId, docTypes) - { - Description = description - }; - - return await DisposableDocumentClassifier.BuildAsync(client, request); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Infrastructure/DocumentIntelligenceTestEnvironment.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Infrastructure/DocumentIntelligenceTestEnvironment.cs deleted file mode 100644 index 4d2e4372f2fd..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Infrastructure/DocumentIntelligenceTestEnvironment.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using Azure.Core.TestFramework; - -namespace Azure.AI.DocumentIntelligence.Tests -{ - public class DocumentIntelligenceTestEnvironment : TestEnvironment - { - private const string SanitizedSasUrl = "https://sanitized.blob.core.windows.net"; - - private const string AssetsFolderName = "Assets"; - - // We are using assets from the old Form Recognizer package while this package hasn't moved to the public repository. - // Files are exactly the same, so this doesn't affect test behavior. - private const string FileUriFormat = "https://raw.githubusercontent.com/Azure/azure-sdk-for-net/main/sdk/formrecognizer/Azure.AI.FormRecognizer/tests/{0}/{1}"; - - public string Endpoint => GetRecordedVariable("ENDPOINT"); - - public string ApiKey => GetRecordedVariable("API_KEY", options => options.IsSecret()); - - public string ResourceId => GetRecordedVariable("RESOURCE_ID"); - - public string ResourceRegion => GetRecordedVariable("RESOURCE_REGION"); - - public string BlobContainerSasUrl => GetRecordedVariable("SINGLEPAGE_BLOB_CONTAINER_SAS_URL", options => options.IsSecret(SanitizedSasUrl)); - - public string ClassifierTrainingSasUrl => GetRecordedVariable("CLASSIFIER_BLOB_CONTAINER_SAS_URL", options => options.IsSecret(SanitizedSasUrl)); - - public static Uri CreateUri(string filename) - { - var uriString = string.Format(FileUriFormat, AssetsFolderName, filename); - - return new Uri(uriString); - } - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Infrastructure/TestFile.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Infrastructure/TestFile.cs deleted file mode 100644 index e21b699fe0a7..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Infrastructure/TestFile.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -namespace Azure.AI.DocumentIntelligence.Tests -{ - internal static class TestFile - { - public const string Blank = "blank.pdf"; - - public const string Irs1040 = "IRS-1040_2.pdf"; - } -} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tsp-location.yaml b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tsp-location.yaml deleted file mode 100644 index 8abaa5f25655..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tsp-location.yaml +++ /dev/null @@ -1,3 +0,0 @@ -directory: specification/cognitiveservices/DocumentIntelligence -commit: 848f569574785ce962c31e7de25082e942b8486a -repo: Azure/azure-rest-api-specs-pr diff --git a/sdk/documentintelligence/ci.yml b/sdk/documentintelligence/ci.yml deleted file mode 100644 index 9427556d76cc..000000000000 --- a/sdk/documentintelligence/ci.yml +++ /dev/null @@ -1,31 +0,0 @@ -# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. - -trigger: - branches: - include: - - main - - hotfix/* - - release/* - paths: - include: - - sdk/documentintelligence/ - -pr: - branches: - include: - - main - - feature/* - - hotfix/* - - release/* - paths: - include: - - sdk/documentintelligence/ - -extends: - template: /eng/pipelines/templates/stages/archetype-sdk-client.yml - parameters: - ServiceDirectory: documentintelligence - ArtifactName: packages - Artifacts: - - name: Azure.AI.DocumentIntelligence - safeName: AzureAIDocumentIntelligence